unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ian Price <ianprice90@gmail.com>
To: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Compilation to JS
Date: Mon, 5 Jun 2017 17:11:35 +0100	[thread overview]
Message-ID: <CACpaFSSGNxY-=-0BARjauHOn-wuR0+Ynhniuno4TXCNX6sOVqw@mail.gmail.com> (raw)

Hello Everyone,

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
in Guile.

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
the CPS language (as it existed two years ago) to a Javascript
intermediate language, and some transformations, particularly
inlining, were performed to improve the readability of the Javascript
before emitting it. A boot.js script was written which implemented all
the necessary VM primitives in Javascript. The majority of boot-9 was
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
   representation
2. Complete porting boot-9 to js (in particular, the guile module
   system)
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.

--
ijp


             reply	other threads:[~2017-06-05 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 16:11 Ian Price [this message]
2017-06-06  2:52 ` Compilation to JS Mike Gerwitz
2017-06-06 14:37   ` Christopher Allan Webber
2017-06-06  9:08 ` Arne Babenhauserheide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACpaFSSGNxY-=-0BARjauHOn-wuR0+Ynhniuno4TXCNX6sOVqw@mail.gmail.com' \
    --to=ianprice90@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).