I have an itch I want to scratch so here we are.
I simply want to take advantage of homoiconicity while working with React. Expressing the ReactDOM as an s-exp list which can be broken apart, recombined, and eval-ed without losing its parse-abilty sounds, well, fun, for lack of a better word or reason. The first step of course becomes, how do I work with Scheme on the frontend...
Scheme -> JS existing options
RacketScript does disclaim: "RacketScript is work-in-progress and is not mature and stable. Several Racket features and libraries are not yet implemented (eg. number pyramid, contracts, proper tail calls, continuations). There are also quite a few missing primitive functions. That said, we encourage experimentation, user feedback, discussions, bug reports and pull requests."
- It leans into modern web-tooling, fitting nicely into projects that are already using
Bigloo / Hop
- I created a very simple blog framework in bigloo / hop that uses their MySql connection, embeds an editor and leans into their auth model. _
- this reddit post by u/amirouche showcases both a hosted example and the source code for it. _
Gambit Universal Backend
- R7RS conformance including R7RS modules
- a thread system built on top of first-class continuations
- serializable closures and continuations allowing task migration
- access to files on the server using Scheme file I/O
- Scheme to JS compilation for fast execution
- Demo: https://udem-dlteam.github.io/ribbit/repl-max-tc.html
- Repo: https://github.com/udem-dlteam/ribbit https://udem-dlteam.github.io/ribbit/repl-max-tc.html
- Paper: http://www.iro.umontreal.ca/~feeley/papers/YvonFeeleyVMIL21.pdf https://udem-dlteam.github.io/ribbit/repl-max-tc.html
(credit to Marc Feeley for the Gambit feature list and the above listing of Ribbit features)
The chibi repo can be cloned, and
make js will create an Emscripten build:
chibi.js. It also provides an example of its usage. Emscripten allows some C/C++ code to be compiled for the browser and thus this same approach can be taken for other schemes that compile on LLVM toolchain. The same approach can be seen taken here with Gambit: http://feeley.github.io/gambit-in-the-browser/.
wasamasa on the scheme discord also brought to my attention the following archive link with A LOT MORE schemes on the web: https://web.archive.org/web/20200405073418/http://ceaude.twoticketsplease.de/js-lisps.html. I'd like to thank
inglrs for bringing the chibi build to my attention. Marc Feeley brought ribbit to my attention and surfaced several gambit feetures worth pointing out.
Let me know if I missed any!
As for the proof of concepts I'm curious about, after researching and experimenting for a few days I decided it would be a fun exercise to implement something like Rackt in Gambit.