> One of the things I'm looking into is whether it would be possible to
> have a single code base for SchemeUnit for MzScheme and SISC.
MJ Ray wrote:
> It's definitely possible. There are various mechanisms for doing it,
> including have different top-level files and then common included
> files, or using a system like Dorai Sitram's scmxlate or Hans
> Oesterholt-Dijkema's staste.
Thank you for these links to prior art! I hadn't known about them
Now, I should explain, when I said "is it possible" what I actually
was thinking was "can I find a solution that meets all of my various
competing desires that I haven't articulated yet" :-)
So! I will attempt to actually articulate my desires...
Noel Welsh wrote:
> My current thinking is [having common included files]. I don't
> believe the other frameworks are really necessary nor would provide
> the degree of integration with the host language that I want.
Right, I don't want to have to run a preprocessor every time I make a
change to my program, or lose the integration with the host language.
Let's take a look at the common include file option.
Suppose we had assert-util.inc with just the definitions:
;; syntax->location-values : syntax -> list
(define (syntax->location-values stx)
(list (syntax-source stx)
And an assert-util.ss wrapper for PLT:
(module assert-util mzscheme
(require (lib "plt-match.ss")
And an assert-util.scm wrapper for SISC:
Now, this is pretty good. There's no code duplication in the
implementation, and the code can be directly loaded and compiled by
both PLT and SISC.
Which doesn't mean I'm actually *satisfied*. I'm greedy enough to
want something even better. As a programmer, I'm quite lazy, and when
I write code, I don't want to have to define a procedure in one place,
and then add it to a wrapper for PLT, and then add it again to a
wrapper for SISC. That's the kind of tedious activity that I'd much
prefer to have my computer do for me!
My first preference is to have some macros which expand my code into
either a PLT module or an SISC module as required. That seems like
just the kind of transformation that a macro should be good at, and
with source location tracking, I don't lose any integration with the
SISC is quite flexible about modules and macros. Want to have a macro
that expands into a module? Sure, no problem! I don't know enough
about PLT yet to know what can be done in PLT.