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.

LispyScript: A JavaScript With Lispy Syntax And Macros

79 pointsby friggeriover 12 years ago

7 comments

aufreak3over 12 years ago
Some time back, I tried to take JSON as the AST and see if I can build a Scheme-like programming language with it. I did it just for kicks, but if it interests anyone .. [1].<p>It's lacking in docs, but this might be of interest - you get a Scheme-like language (without tail recursion), keyword arguments, lambda, macro, quote &#38; quasi-quote, let expression, where clauses, generators, and some degree of code isolation. The compiler is a very simple one and is written in "stream of thought" style [2] and so might be quite easy to follow.<p>[1] <a href="http://github.com/srikumarks/jexpr" rel="nofollow">http://github.com/srikumarks/jexpr</a> [2] <a href="http://srikumarks.github.com/jexpr/" rel="nofollow">http://srikumarks.github.com/jexpr/</a>
jhrobertover 12 years ago
Add "SweetExpressions" and I wonder how far from coffeescript it would get.<p>"SweetExpressions" is probably the best method so far to get rid of excessive parentheses in lisp. See <a href="http://readable.sourceforge.net/" rel="nofollow">http://readable.sourceforge.net/</a>
评论 #4554487 未加载
评论 #4554710 未加载
评论 #4554434 未加载
评论 #4554472 未加载
cheezover 12 years ago
I prefer Parenscript <a href="http://common-lisp.net/project/parenscript/" rel="nofollow">http://common-lisp.net/project/parenscript/</a>
评论 #4554866 未加载
postfuturistover 12 years ago
This is just a light lisp-like syntactic layer, as the docs say "LispyScript is not a dialect of Lisp. There is no list processing in LispyScript ." It's just enough to allow nice macros, which adds quite a bit, IMO. There's no CONS, etc. It adds a couple nice things, like an "each" function that does the right thing, and (= foo bar) becomes foo === bar.
ajanuaryover 12 years ago
Cool, but could do with shortening the 'function' keyword. It's just too long for the amount it's used.
评论 #4554993 未加载
Xurinosover 12 years ago
I experience a kind of jolt when I read lispy syntax mixed with constructs like [1, 2, 3]. It shouldn't be a big step to make a syntax for #(1 2 3) or (make-array 1 2 3) instead. Get rid of that infix comma syntax! Then there is the record syntax... {foo: 3, bar: 4}... Infix commas and colons! How about (make-object foo 3 bar 4) or #O(foo 3 bar 4)? Or support reader macros so that you can override []s and {}s to do something a little prettier.
评论 #4554860 未加载
评论 #4554888 未加载
wes-expover 12 years ago
Why the dependency on node?
评论 #4554640 未加载