by schemescape · 3y ago · 0 comments
I think today, you can use Racket in its special SICP mode to get a much better experience. But maybe the HTML (Bootstrap) formatting is a little nicer to read (and with the bonus that it probably works on phones).
The interpreter was incomplete and written from scratch, as a learning project [2]. This was done in the pre-WebAssembly days, so I couldn't just recompile, say, a Scheme written in C for use in the browser.
If I recall correctly, I took the SICP source files, ran a bunch of regular expressions on them to convert the content into XML [3], and then used XSLT to generate the web pages [1]. I was really into XSLT at the time :)
Anyway, hope people find this useful! It's outdated and incomplete, and the interpreter has an odd implementation, but it was a fun project.
Source code links:
[1] HTML generator: https://github.com/jaredkrinke/learn-scheme
[2] Interpreter: https://github.com/jaredkrinke/jslisp
[3] SICP-to-XML converter: https://github.com/jaredkrinke/sicp-reformatter
If this is a direction you (or anyone else!) would like to explore, GNU Guile has been having work done to port it to WebAssembly under the Hoot project[0].
Racket with Wasm-PB Chunk, https://github.com/adamperlin/racket
Videos should be posted here shortly, https://www.youtube.com/@racketlang/videos
You mentioned Racket. Were you at Racket Con this weekend? I attended remotely, and really enjoyed it.
Pardon the self-promotion, but speaking of Scheme/Racket you can read my newly released (last Friday) book "Practical Artificial Intelligence Development With Racket - Using Racket Scheme for implementing many short AI examples including LLMs, vector datastore, NLP, semantic web and non-AI utilities" for free online. [1]
[1] https://leanpub.com/racket-ai/read
EDIT: my book is only 80% done. Example programs: https://github.com/mark-watson/Racket-AI-book-code
So you can continue to explore the rest of the book for free (without the aid of the built-in interactive interpreter). Check out Racket and its included support for the particular Scheme used by SICP: https://docs.racket-lang.org/sicp-manual/
Edit: wow, it even predates my attempt: https://news.ycombinator.com/item?id=4860370
We all have embarasing skeletons in our closets, and that's one of mine, too.
https://news.ycombinator.com/item?id=33728303
>My impression of XSLT is that there were representatives from every different programming language paradigm on the XSLT standard committee, and each one of them was able to get just enough of what was special about their own paradigm into the standard to showcase it while sabotaging the others and making them all look foolish, but not enough to actually get any work done or lord forbid synergistically dovetail together into a unified whole.
>The only way I was ever able to get anything done with XLST was to use Microsoft's script extensions to drop down into JavaScript and just solve the problem with a few lines of code. And that begs the question of why am I not just solving this problem with a few lines of JavaScript code instead of inviting XSLT to the party?
XPath was a joy to use, and I thought XHTML made more sense than HTML. But I was naive to think the “more logical” technology would take over!
That said, it's a lot like that old joke about regular expressions, "now you have two problems."
In fact, our own take on AOLServer used xml namespaces for our widget libraries, but alas we got HTML 5 instead, and Web Components are still not widely adopted.
from https://mitp-content-server.mit.edu/books/content/sectbyfn/b...
https://mitp-content-server.mit.edu/books/content/sectbyfn/b...
> Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman with Julie Sussman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License by the MIT Press.
XSLT was my first Lisp ;-)