I've just started working on full-featured Lisp in javascript over the past few weeks: <a href="https://github.com/jlongster/outlet" rel="nofollow">https://github.com/jlongster/outlet</a><p>It will compile to js and lua, and I'm focusing on writing games with it. I can attest that writing a Lisp compiler is really fun and shockingly simple in some places.<p>Current features I'm working on: <a href="http://jlongster.com/2012/01/16/outlet-gets-a-personality.html" rel="nofollow">http://jlongster.com/2012/01/16/outlet-gets-a-personality.ht...</a>
This "lisp in x lines of y" tradition started with the original Lisp paper back in 1960, which defined lisp in a few lines of lisp. Which, when you think about it, is an extraordinarily lispy thing to do.
Hey guys<p>This seems like it would be perfect stuff for an educational lightning talk<p>If any of you are in the SF Bay Area, please consider doing a ~5 min presentation on your lisp-in-x implementation at the lisp meetup "revival" this saturday at the blackbox mansion in Atherton<p>...free beer... ;-)<p><a href="http://www.meetup.com/balisp/events/48872022/" rel="nofollow">http://www.meetup.com/balisp/events/48872022/</a>
<a href="http://balisp.org/" rel="nofollow">http://balisp.org/</a>
A similar endeavor in Python: <a href="http://www.brool.com/index.php/the-tiniest-lisp-in-python" rel="nofollow">http://www.brool.com/index.php/the-tiniest-lisp-in-python</a><p>I find it quite entertaining to see how specific language features allow for differing patterns. It is much more apparent with such Lisp implementations than with your typical <i>Hello, World</i> app or hidden by some library or framework.
See also: Heist, a feature-rich implementation of Scheme in Ruby: <a href="https://github.com/jcoglan/heist" rel="nofollow">https://github.com/jcoglan/heist</a>
Shameless Self Promotion. Here are two version of the LISP interpreter in JavaScript that I wrote:<p>1. Direct port of Peter Norvig's version in Python:<p><a href="https://bitbucket.org/sainamdar/lisp2js/" rel="nofollow">https://bitbucket.org/sainamdar/lisp2js/</a><p>2. Separate Syntactic Analysis from Execution:<p><a href="https://bitbucket.org/sainamdar/lisp2js2/" rel="nofollow">https://bitbucket.org/sainamdar/lisp2js2/</a>
Lisp (including full lexical closures) in 50 lines of Python:<p><a href="http://www.flownet.com/ron/lisp/l.py" rel="nofollow">http://www.flownet.com/ron/lisp/l.py</a>
Cute, but from like 28 [1] it looks like there is no macro support, so this isn't a lisp but is rather a way to write a ruby expression in a ruby array.<p>[1] <a href="https://github.com/fogus/ulithp/blob/master/lithp.rb#L28" rel="nofollow">https://github.com/fogus/ulithp/blob/master/lithp.rb#L28</a>
32 lines of Ruby and a hundred thousand lines of C, let's not forget. Anyone can write any short program in a DSL, that is not represenative of the true complexity of it.
It seems funny to me, that it needs most probably more lines to write a good lisp tutorial for beginners, than a lisp implementation. Lisps beauty lies in its simplicity.
I translated it to js -> <a href="https://gist.github.com/1679611" rel="nofollow">https://gist.github.com/1679611</a>
Earned 1 line, and packed it with a cheap implementation of zip :3
<p><pre><code> :if => lambda { |(cond, thn, els), ctx| eval(cond, ctx) ? eval(thn, ctx) : eval(els, ctx) },
</code></pre>
Seriously, any production code like that (very long line, cryptic variable names to make it fit better on said line) would get nasty review comments here.<p>Why not put the whole thing a single line and have an even prettier page title?