TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Cell: Lisp in Javascript

64 点作者 SoCool将近 13 年前

10 条评论

crescendo将近 13 年前
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 未加载
xyzzyz将近 13 年前
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_chester将近 13 年前
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 未加载
alol将近 13 年前
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.
ganley将近 13 年前
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.
archgoon将近 13 年前
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.
jfaucett将近 13 年前
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将近 13 年前
Why does this happen:<p><pre><code> (def a 3) 3 a null </code></pre> a should be 3, not null.
评论 #4405839 未加载
diminish将近 13 年前
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.
keithgabryelski将近 13 年前
here is a basic lisp interpreter written in python: <a href="https://github.com/keithgabryelski/plisp" rel="nofollow">https://github.com/keithgabryelski/plisp</a>