
Cell: Lisp in Javascript - SoCool
http://cell-lang.org/
======
crescendo
Hi everyone, original author here. Thanks for all the feedback! My friend
posted this before it was really ready for public consumption.

My goal here was to learn how Lisp works at a really low level. I'm planning
to add the features you would expect from a Lisp (e.g. macros) very soon.

~~~
jeremiep
That's a very nice beginning, I love being able to interpret Lisp in the
browser!

Your interpreter would be even more awesome if its interface was a file buffer
instead of a toplevel. But so far, great work!

~~~
tantaman
Have you taken a look at clojurescript? It is a very mature project that lets
you use lisp in the browser: <https://github.com/clojure/clojurescript>

------
xyzzyz
I found one bug: you cannot create a zero argument lambda, e.g. (lambda () 42)
will not work. You could also benefit from separate `let' construct, because
simulating them with lambdas is a bit painful.

Apart from that, it works quite nicely (I was positively surprised you went
for lexical scoping), but without macros, you can hardly say it's a Lisp, it's
a language with Lispy syntax.

~~~
JoshTriplett
> You could also benefit from separate `let' construct, because simulating
> them with lambdas is a bit painful.

> without macros, you can hardly say it's a Lisp, it's a language with Lispy
> syntax.

These two things go together: many lisps have let as a macro that uses lambda
internally.

> I was positively surprised you went for lexical scoping

Indeed; that makes for a much more usable language.

------
jacques_chester
Consider a different name -- "Cells" is the name of a cool Common Lisp library
by a ... let's say notorious ... Lisp programmer.

<http://common-lisp.net/project/cells/>

~~~
batgaijin
What's notorious about Kenny Tilton?

~~~
bazzargh
He was a regular poster on comp.lang.lisp, and one of the contributors there
described him thusly:

 _"Ken Tilton is an aquired taste - if you can ignore his inflammatory remarks
his advice is usually good. When I first saw some (most!) of his posts I
initially thought WTF! but think of him as someone with Tourettes Syndrome and
just look at what he is saying not how he is saying it!"_

There's a couple of fortune cookie files of quotes from him (collected by
someone else, but you can find them on his blog), they do make for funny
reading, but you can see how some of this would sting if the remarks were
directed at you: [http://smuglispweeny.blogspot.co.uk/2010/08/fortune-
cookie-f...](http://smuglispweeny.blogspot.co.uk/2010/08/fortune-cookie-file-
number-two.html)

------
alol
Cool. I have been working through the lessons in Nathan's University
(<http://nathansuniversity.com/>) which take you writing a Lisp interpreter
(though admittedly with less rigor than this project) in Javascript.

Definitely recommended if you want a starting point for something similar and
don't know where to begin.

------
ganley
Gotta shout out to my own Lisp-in-JavaScript interpreter from long, long ago:
<http://joeganley.com/code/jslisp.html> ... far less complete than this, but
perhaps interesting to someone for archeological reasons or something.

------
archgoon
Thank you for implementing command history :).

There is a slight bug though. Since the position gets updated after the
position is calculated, the displayed value is out of sync.

So entering

1

2

3

And then typing: UP (3), UP (2), DOWN (1)

Displays 1, rather than 3.

------
jfaucett
nice job! I like how clean the source is, it would be really easy to extend or
use as a base for writing ones own interpreter.

------
cabalamat
Why does this happen:

    
    
        (def a 3)
        3
    
        a
        null
    

a should be 3, not null.

~~~
juan_juarez
Same thing happens if you just try to pass it a bare 3. I'm thinking nothing
gets evaluated without parens.

------
diminish
good work, just was checking arc in js;
<http://jonathan.tang.name/files/arclite/index.html> and was surprised to see
cell on hn.

------
keithgabryelski
here is a basic lisp interpreter written in python:
<https://github.com/keithgabryelski/plisp>

