From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Compilation to JS Date: Mon, 5 Jun 2017 17:11:35 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1496679125 2964 195.159.176.226 (5 Jun 2017 16:12:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 16:12:05 +0000 (UTC) To: "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 05 18:11:57 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHubl-0000P7-DT for guile-user@m.gmane.org; Mon, 05 Jun 2017 18:11:57 +0200 Original-Received: from localhost ([::1]:34207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHubq-0004mP-Jd for guile-user@m.gmane.org; Mon, 05 Jun 2017 12:12:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHubT-0004m7-Ht for guile-user@gnu.org; Mon, 05 Jun 2017 12:11:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHubS-0003Fs-3C for guile-user@gnu.org; Mon, 05 Jun 2017 12:11:39 -0400 Original-Received: from mail-ua0-x232.google.com ([2607:f8b0:400c:c08::232]:34933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHubR-0003Dw-Sk for guile-user@gnu.org; Mon, 05 Jun 2017 12:11:38 -0400 Original-Received: by mail-ua0-x232.google.com with SMTP id y4so78481535uay.2 for ; Mon, 05 Jun 2017 09:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=s/pqxSfpoqMqQFtcbcRUfZRBIbtAPt+sfrq0m30mh/s=; b=Mf9vfJDnrkvqhnGAZ/W+zv7JhBlPvu7PAOh26JZKjG5Qq/lgeUAT5CqZv7oO7TqZPT j6nRt4suHMPHzHABQiuAN/UobSMUvq0H6bw2Zw5XnAXvCsl37BYtoMaN3qiKyfT5N2EF X9qr68lBzFs6CayVIXSvDZhgK9EmQk7/n/Zhn06MS/DcDWg2AHXZ8yQ1LJ78RaFow+Ep 9zqMjFOa1ToMnkbLWYcq5tnvC5BmluSNPLEImvNgDD8QnAzdkWRPM35HkCNaMKhlWIOa g/spm0zW0s+tWRS5fLej97MKO2hEagrMSR7BVP3U0sFCjDHHVzztXjM+mE96uIvDyEhy HcVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=s/pqxSfpoqMqQFtcbcRUfZRBIbtAPt+sfrq0m30mh/s=; b=TPmc1qKnp+b4NZQBS+xU5InPSYljmo07MY2z1O/lf0jYk4CthtBtFr09ADads44603 3sO4NYLa8ifOjePbJwqrwrrMGCRRazODxvMHvKaXhB05wd+vPJ42l2gjsn+PjP99woQ+ 1dR0W6li49v/Isz0uf4cbjqMn68l4ggl71f7jH48MbhyYyvxMovyvrK95swBtaOjheOq eB1Rj0OcgWoTzSIGblryhXwG0+dJ6dNf3sN3kb9uXtP1S9hIPT0C0Ht7i+5nPxWVYc8H ScGOSX6hcPxD+6imrYxY4xtBI6ZT7RVY+qO+x+iSEANQeHSe1ATy1raxOvL/0u/JtasP MyiA== X-Gm-Message-State: AODbwcBlMdhRYujtCZo0oHNbKLzcz6evUrHZrFRH85r24Iequd8JtoeA mOfSX6WWdm1P3+SmA4lmMyzZj0Lsxr2m6UY= X-Received: by 10.176.0.248 with SMTP id 111mr8135247uaj.133.1496679095589; Mon, 05 Jun 2017 09:11:35 -0700 (PDT) Original-Received: by 10.31.108.65 with HTTP; Mon, 5 Jun 2017 09:11:35 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::232 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13775 Archived-At: 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