3 ms·
Scheme on CoffeeScript
- mrspeaker 16y agoHa 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_calls http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_c... )
- qzprt 16y agoObligatory: http://en.m.wikipedia.org/wiki/Greenspuns_Tenth_Rule http://en.m.wikipedia.org/wiki/Greenspuns_Tenth_Rule
- jashkenas 16y agoHere's direct links to the source (which is worth looking at). The parser : https://github.com/DmitrySoshnikov/scheme-on-coffee/blob/master/parse.coffee https://github.com/DmitrySoshnikov/scheme-on-coffee/blob/mas... The evaluator: https://github.com/DmitrySoshnikov/scheme-on-coffee/blob/master/eval.coffee 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.
- spacemanaki 16y ago> 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.
- spacemanaki 16y agoScheme 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 http://javascript.crockford.com/little.html This one seems to support call/cc: https://csel.cs.colorado.edu/~silkense/js-scheme/cps/ https://csel.cs.colorado.edu/~silkense/js-scheme/cps/
- deleted 16y ago[deleted]