guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GSOC: First update


From: Ian Price
Subject: GSOC: First update
Date: Sun, 07 Jun 2015 18:39:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi,

As some of you will know, I am implementing a guile->js backend as
part of Google Summer of Code. This is a small update so that those of
you who do hang out on the guile irc channel can see some of the
(small) progress.

A temporary git branch is available at
https://gitlab.com/ijp/guile/commits/compile-to-js

I'm not going to list all the reasons you shouldn't use this code yet,
suffice to say you shouldn't. It's so far before alpha it's not even
funny.

That said, code you can compile today includes multiple values [1],
mutual recursion [2] and using call/cc to escape early from a
loop [3].

1. scheme: http://shift-reset.com/pastes/merge.html
   js:     http://shift-reset.com/pastes/merge-js.html

2. scheme: http://shift-reset.com/pastes/even.html
   js:     http://shift-reset.com/pastes/even-js.html

3. scheme: http://shift-reset.com/pastes/product.html
   js:     http://shift-reset.com/pastes/product-js.html

To make the examples self-contained and runnable in node.js, I
included the code from module/language/js-il/runtime.js, assigned the
result to a var and call console.log, and beautified it with uglifyjs
for good measure. The actual output of "guild compile --to=javascript
foo.scm" can be found between the comments.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]