Hacker News new | past | comments | ask | show | jobs | submit login
Scheme on CoffeeScript (dmitrysoshnikov.com)
41 points by franze on May 13, 2011 | hide | past | favorite | 5 comments



Ha ha ha! Absolutely fantastic. The wizard would be proud! How do you handle tail call optimization with JavaScript? (at least, until the next version of JS with proper tail calls - woot! http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_c... )


Here's direct links to the source (which is worth looking at).

The parser : https://github.com/DmitrySoshnikov/scheme-on-coffee/blob/mas...

The evaluator: https://github.com/DmitrySoshnikov/scheme-on-coffee/blob/mas...

The definitions of all the caddr, cdadr variants is kind of fun, and the definition of "lookupVariableValue" is enlightening, if you were curious about how that sort of thing worked in Scheme.


> if you were curious about how that sort of thing worked in Scheme.

If that's the case you should really read SICP, since there's a lot more enlightenment where that came from, so to speak.


Scheme in JS is an attractive idea, but it looks like the reader isn't doing reader-macros correctly:

    '(a b c)
    (Error: Unbound variable: "a" Error: Unbound variable: "b" Error: Unbound variable: "c")
There are a couple others of these:

http://javascript.crockford.com/little.html

This one seems to support call/cc:

https://csel.cs.colorado.edu/~silkense/js-scheme/cps/





Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: