scmutils->chez->Racket

I see that Gerry Sussman's scmutils has finally been ported to chez

In a sentence or two, could anyone let me know what would be involved in making it run as a Racket #lang, now that Racket runs off cs?

I'd like to have a stab at that soon, but any hints, guidelines, suggestions along the way very welcome.

Racket could help solve one or two remaining issues with the port, plus provide a great graphical interactive environment for it. (At the moment the authors recommend a GnuPlot interface)

Thanks!

1 Like

Here are my first impressions:

The Chez Scheme code uses the R6RS module system.
This is a good sign, since it is easier to port R6RS modules to Racket modules,
than a mess of load and include.

The individual files are written in MIT Scheme, but are included in a module which import a compatibility layer. The separation seems clean in the sense that the MIT Scheme parts are in a separate repo called chez-mit.

First step in porting to Racket would be to port chez-mit.

The nice thing about this approach is that it will make porting other MIT Scheme programs easier.

1 Like

Thanks Jens

The separation seems clean in the sense that the MIT Scheme parts are in a separate repo called chez-mit.
[...]
First step in porting to Racket would be to port chez-mit.

Agreed.
So I guess I treat all the supplied chez code as R6RS under Racket. Should be interesting.

I think the main challenge would be the environment-manipulating code here: chez-mit/mit/environment.sls at master · fedeinthemix/chez-mit · GitHub

Hm, yes, the goofy MIT-Scheme environments code. Bit of a throwback, isn't it?

Would there be any possibility of compiling the code under chez, since that works, allegedly :slight_smile: and then importing it into Racket somehow?

That code appears to rely on the Chez treatment of the top-level environment and is likely to only work with definitions at the REPL. I think this would likely run into problems in porting to Racket but one would have to try it out.

@AlexG I know you have tried out my (partial) port of scmutils. Based on the timestamps this chez-scheme version is based on code from 9y ago (instead of Susman's latest version from 2023).
Is there anything in particular missing, unintuitive or broken in my port that you are looking for?
[GitHub - bdeket/rktsicm]

Hey pal, No, no problem with your port, nor have I found anything missing for my needs so far. In fact I quite enjoy using it.

I guess I'm just exploring the matter further, maybe I'm asking the wrong question. Like, for instance, could a working version of MIT-Scheme be implemented in Racket with chez. :zany_face:
No matter...