Before this devolves into another farcical, Lisp arm-chair punditry: at 9 operators it's pretty much a kernel untyped lambda-calculus with pairs. And just that.
The implementation is as trivial as the concept is profound. The discussion should be about the lambda-calculus, not Lisp, which is a far more complex beast. And much less about Lisp dialects, Greenspun's, or the usual BS topics that invariably appear on any L-word thread.
The fun part that distinguishes an early Lisp from the pure lambda calculus is the mixing of strict evaluation and call-by-need. I had to hack that a bit by making a distinction between Procs created with proc vs those with lambda and by tearing apart function bodies. I forget how the original Lisp made the distinction. It looks like I need to re-re-re-re-re-read the Lisp 1.5 manual.
I think this is a neat project and a nice demonstration of how Lisp-influenced Ruby is.
However, whenever people post "Lisp in Ruby" stories, I always hope that it'll be a "Clojure in Ruby" implementation. I am surprised no-one has done it yet.
Why would anyone? Clojure runs on the JVM which supports native os threads, concurrent garbage collection, etc, for one thing. Different tools for different purposes.
Syntactic transformation isn't really what it's about, is it? Parsing S-expressions into some internal representation is easily the most boring component of a working Lisp.
1993: «Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.» [1]
20 years later: for Ruby users, situation improves! :)
I can't say for sure- but I would guess that it would be normal for a lot of HN articles to go over your head if you are not technical or lack a C-S degree.
I've never understood the line-count craze some people get on. If it was that important, we'd all be using J or APL. Since we're not — in fact, almost nobody is — it must not be that critical.
I love the economy of lisp implementations in dynamic languages. It's especially nice because you don't have to worry about the memory management.
On the otherhand, I've been interested in doing a lisp in low memory environments (uC's, etc). I've done a dialect in C using a semi-space garbage collector. But I'm curious if anyone's done any work on lisps in resource constrained environments.
[+] [-] mahmud|13 years ago|reply
The implementation is as trivial as the concept is profound. The discussion should be about the lambda-calculus, not Lisp, which is a far more complex beast. And much less about Lisp dialects, Greenspun's, or the usual BS topics that invariably appear on any L-word thread.
[+] [-] fogus|13 years ago|reply
[+] [-] fogus|13 years ago|reply
[+] [-] meric|13 years ago|reply
Once upon a time I wrote a lisp to lua compiler in 100 lines. https://github.com/meric/l2l/commit/a530f0133e002c3981937d21...
It's now over a thousand. https://github.com/meric/l2l/
[+] [-] bitops|13 years ago|reply
However, whenever people post "Lisp in Ruby" stories, I always hope that it'll be a "Clojure in Ruby" implementation. I am surprised no-one has done it yet.
[+] [-] bentoner|13 years ago|reply
They have: http://rouge.io/ https://github.com/rouge-lang/rouge
[+] [-] pekk|13 years ago|reply
[+] [-] jjtheblunt|13 years ago|reply
[+] [-] dschiptsov|13 years ago|reply
Lisp begins with something like this:
Without using underlying list structure, environments, lexical scoping and reader function it is just a lisp-like syntax.Lisp without lists at its core is nothing but another clumsy language. Look at Clojure - what a mess.
[+] [-] guard-of-terra|13 years ago|reply
[+] [-] quarterto|13 years ago|reply
https://github.com/aarongough/sexpistol
[+] [-] apl|13 years ago|reply
[+] [-] fogus|13 years ago|reply
A minimal Lisp (the bare minimal) does not require sexprs though.
[+] [-] draegtun|13 years ago|reply
Above was HN submission from early last year, Lisp in 32 lines of Ruby, which was the original blog post of this code by Fogus.
[+] [-] joethephish|13 years ago|reply
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] sejje|13 years ago|reply
Any obvious choice? (If not, I imagine I'd like to learn the most widely-used)
[+] [-] steveklabnik|13 years ago|reply
Learn yourself some Clojure for great good.
[+] [-] 6cxs2hd6|13 years ago|reply
[+] [-] blue1|13 years ago|reply
[+] [-] krosaen|13 years ago|reply
http://norvig.com/lispy.html
[+] [-] lispm|13 years ago|reply
http://books.google.de/books?id=QzGuHnDhvZIC&lpg=PA756...
[+] [-] nine_k|13 years ago|reply
20 years later: for Ruby users, situation improves! :)
[1] http://en.wikipedia.org/wiki/Greenspuns_tenth_rule
[+] [-] jrockway|13 years ago|reply
[+] [-] wonderzombie|13 years ago|reply
:)
[+] [-] tzaman|13 years ago|reply
[+] [-] nine_k|13 years ago|reply
Lisp is very simple and very powerful. Those who don't learn it are doomed to reinvent it, badly (cough XSLT cough).
[+] [-] wonderzombie|13 years ago|reply
I have been playing with a Clojure, a Lisp dialect, for six or so months (it seems so much longer), but this was still really interesting to me.
[+] [-] voidlogic|13 years ago|reply
[+] [-] hk__2|13 years ago|reply
[+] [-] codemac|13 years ago|reply
He could probably set up his publish templates to accomplish the same formatting.
(huge org mode nerd, checking in)
--- EDIT ---
And what do you know, Eric Schulte already implemented this for org mode! It's checked in under contrib.
Instructions: http://eschulte.me/org-docco/org-docco.html
Org source: http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/...
[+] [-] fogus|13 years ago|reply
[1]: http://github.com/fogus/marginalia
[+] [-] judofyr|13 years ago|reply
[+] [-] dbyrd|13 years ago|reply
[+] [-] JasonFruit|13 years ago|reply
[+] [-] nine_k|13 years ago|reply
[+] [-] fogus|13 years ago|reply
[+] [-] asimjalis|13 years ago|reply
[+] [-] rrmm|13 years ago|reply
On the otherhand, I've been interested in doing a lisp in low memory environments (uC's, etc). I've done a dialect in C using a semi-space garbage collector. But I'm curious if anyone's done any work on lisps in resource constrained environments.
[+] [-] lopatin|13 years ago|reply
[+] [-] pohl|13 years ago|reply
[+] [-] dmcdougall_|13 years ago|reply
[+] [-] albertoavila|13 years ago|reply
Some times it's cool to do things just because you can, maybe he was bored or he always wanted to implement a lisp dialect.
It might not be that useful, but i'm sure that the autor had a blast doing it, otherwise he wouldn't have done it.
[+] [-] fogus|13 years ago|reply
[+] [-] fogus|13 years ago|reply
[+] [-] redler|13 years ago|reply