[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compilation to JS
Compilation to JS
Mon, 5 Jun 2017 17:11:35 +0100
This summer I am following up on the work of two years ago to compile
Guile to JS. As some of you may remember from irc back then, I was
making good progress until personal circumstances intervened. This
year I intend to get it into shape where we can consider including it
You can read my GSOC Proposal at http://shift-reset.com/tmp/gsoc3.pdf,
but a summary is in order. I was able to compile a large portion of
intermediate language, and some transformations, particularly
before emitting it. A boot.js script was written which implemented all
supported, and I had written, compiled (and with some manual tweaking
ran) a bunch of programs that handled a large range of what we would
expect from Guile, and could handle mutual recursion, keyword
arguments, case-lambda, continuations, etc. You can see some of the
programs that were compiled and their (very hideous js output) on my
site at http://shift-reset.com/pastes/ (e.g.
http://shift-reset.com/pastes/mergesort_new_inliner.html was the
output of http://shift-reset.com/pastes/merge.html)
The main work that needs to be done
1. Move from the previous cps representation to the new cps soup
2. Complete porting boot-9 to js (in particular, the guile module
3. Cheney on the MTA to handle tail calls for browsers that do not
support tail call optimisation.
4. An addition to (scripts) to allow compilation to js, bundling in
the new boot.js and necessary libraries.
Initially I am working on (1), as this will allow me to take advantage
of the work from two years ago. In order to rebase on a current Guile,
I think as a stopgap measure it makes sense to bring back the the
original cps representation first, and then to change the compiler I
wrote to use the new representation afterwards. Once this has been
accomplished I will feel comfortable posting a link to let you all
play with the stuff from previous years.
I will likely then proceed in numerical order.
On a personal note, it's good to be back here, paying attention to the
Guile project after a hiatus.
- Compilation to JS,
Ian Price <=