Arc Forumnew | comments | leaders | submitlogin
(Norvig's (Lisp) Interpreter (Ported to CoffeeScript)) (github.com)
7 points by evanrmurphy 4820 days ago | 3 comments


3 points by drcode 4820 days ago | link

Thanks for this- I'm actually writing a Python interpreter in Coffeescript right now, so the Norvig interpreter and this coffeescript version are a great reference to compare against!

-----

1 point by evanrmurphy 4819 days ago | link

> I'm actually writing a Python interpreter in Coffeescript

How intriguing! What got you interested in this project, if you don't mind my asking?

-----

1 point by evanrmurphy 4820 days ago | link

Based on http://norvig.com/lispy.html, not http://norvig.com/lispy2.html. Some of the core operators use arc names rather than scheme, i.e. do, fn and = instead of begin, lambda and define/set!. Depends on underscore.js (http://documentcloud.github.com/underscore/).

There's some sloppiness in the code so don't look at it too closely: left-in console.log calls and window variables for debugging, a couple outdated comments. You can look to later commits for improvements if you're interested (note that the file gets renamed from lispy.coffee to sweet.coffee).

-----