TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Cell: Lisp in Javascript

64 pointsby SoCoolalmost 13 years ago

10 comments

crescendoalmost 13 years ago
Hi everyone, original author here. Thanks for all the feedback! My friend posted this before it was really ready for public consumption.<p>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.
评论 #4405595 未加载
评论 #4405527 未加载
xyzzyzalmost 13 years ago
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.<p>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.
评论 #4405403 未加载
评论 #4405380 未加载
jacques_chesteralmost 13 years ago
Consider a different name -- "Cells" is the name of a cool Common Lisp library by a ... let's say notorious ... Lisp programmer.<p><a href="http://common-lisp.net/project/cells/" rel="nofollow">http://common-lisp.net/project/cells/</a>
评论 #4405996 未加载
评论 #4406160 未加载
alolalmost 13 years ago
Cool. I have been working through the lessons in Nathan's University (<a href="http://nathansuniversity.com/" rel="nofollow">http://nathansuniversity.com/</a>) which take you writing a Lisp interpreter (though admittedly with less rigor than this project) in Javascript.<p>Definitely recommended if you want a starting point for something similar and don't know where to begin.
ganleyalmost 13 years ago
Gotta shout out to my own Lisp-in-JavaScript interpreter from long, long ago: <a href="http://joeganley.com/code/jslisp.html" rel="nofollow">http://joeganley.com/code/jslisp.html</a> ... far less complete than this, but perhaps interesting to someone for archeological reasons or something.
archgoonalmost 13 years ago
Thank you for implementing command history :).<p>There is a slight bug though. Since the position gets updated after the position is calculated, the displayed value is out of sync.<p>So entering<p>1<p>2<p>3<p>And then typing: UP (3), UP (2), DOWN (1)<p>Displays 1, rather than 3.
jfaucettalmost 13 years ago
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.
cabalamatalmost 13 years ago
Why does this happen:<p><pre><code> (def a 3) 3 a null </code></pre> a should be 3, not null.
评论 #4405839 未加载
diminishalmost 13 years ago
good work, just was checking arc in js; <a href="http://jonathan.tang.name/files/arclite/index.html" rel="nofollow">http://jonathan.tang.name/files/arclite/index.html</a> and was surprised to see cell on hn.
keithgabryelskialmost 13 years ago
here is a basic lisp interpreter written in python: <a href="https://github.com/keithgabryelski/plisp" rel="nofollow">https://github.com/keithgabryelski/plisp</a>