top | item 9687657

LispyScript

145 points| amelius | 10 years ago |lispyscript.com | reply

42 comments

order
[+] lighthawk|10 years ago|reply
[+] zupatol|10 years ago|reply
Clojurescript has to be compiled by the google closure compiler on the server side. The closure compiler doesn't work out of the box with other libraries, you need some kind of bridge.

Lispyscript has the very nice advantage of being able to run directly in the browser. Since it's translated directly to javascript, I expect it won't have problems using other javascript libraries.

[+] evmar|10 years ago|reply
Coincidentally, I've been fiddling with a rather similar project, just as a hobbyist thing. It looks like this one is much farther along, kudos! Unfortunately from the contributions graph perhaps interest in it is dying off -- the last 10% (aka the last 90%) is always the hardest part to slog through...

I've been meaning to write up the various approaches to sexpressions+macros in JS. Mine differs from the others (and perhaps is closer to LispyScript) mostly in that it's close to JS in its names and semantics (e.g. "function" defines a function and you're still required to use a "return" statement), but then it lets you write macros to e.g. define "fn" where the return is implicit.

Anyway, here's some sample code from mine (which is itself defining macros used elsewhere in the compiler): https://github.com/martine/pjs/blob/master/lib/macro.pjs

[+] lispm|10 years ago|reply
Doesn't look like Lisp, more like Clojure. Basically none of the functions, macros or syntax is from Lisp.

The documentation says:

http://lispyscript.com/docs/

> LispyScript is not a dialect of Lisp. There is no list processing in LispyScript . LispyScript is Javascript using a Lispy syntax (a tree syntax).

That's about right. It actually uses some kind of s-expressions, but not Lisp syntax.

[+] gjm11|10 years ago|reply
> Basically none of the functions, macros or syntax is from Lisp.

Sounds like it's extremely well named, then. LispyScript is to Lisp as Javascript is to Java: an entirely different language with different syntax, semantics, standard library and performance characteristics, but with just enough superficial similarity to provide plausible deniability for the name.

[+] aidenn0|10 years ago|reply
See also: https://github.com/vsedach/Parenscript

TLDR: s-expression syntax for javascript, macros are written in common lisp.

[+] TeMPOraL|10 years ago|reply
Macros can actually be written in Parenscript as well, AFAIR. But the language blends itself very naturally with CL code.
[+] 1971genocide|10 years ago|reply
Also check out LiveScript.

http://livescript.net/

and its awesome FP library inspired by haskell's prelude.hs

http://www.preludels.com/

I have done all forms of projects using LiveScript - robotics, simple websites, blog, cryptography, computer vision.

Its actually becoming silently fairly mature.

It helps when it doesn't generate any hype like most languages.

The community around is also very helpful !

And LiveScript is awesome with React.js or any other virtual DOM based MVC framework.

[+] amyjess|10 years ago|reply
Why did they name it that?

LiveScript was Netscape's original name for JavaScript, before Sun asked them to throw in some Java branding.

[+] jestar_jokin|10 years ago|reply
Doesn't it say something about JavaScript, dissatisfaction with it, and the overwhelmingly splintered ecosystem, when every comment is suggesting alternatives to the solution in the article?

I guess we chalk this one up to "neat if you're a hobbyist or solo dev with no maintenance handover, but generally commercially unviable."

[+] grayrest|10 years ago|reply
> An inherent problem with Javascript is that it has no macro support, unlike other Lisp like languages.

http://sweetjs.org/

There are macro systems for Javascript, just not native ones.

[+] JoelMcCracken|10 years ago|reply
Not that you're wrong -- you're correct -- but I want to bring up that this was likely true at the time this was written. LispyScript has been around for a while.
[+] breuleux|10 years ago|reply
I wouldn't say Lisp-like syntax is necessary for a macro system. It helps a bit... but all things considered, I believe pattern matching is a bigger boon to macro writing than syntax per se.

For those it may interest, I have made a language with mostly conventional syntax which supports macros: http://breuleux.github.io/earl-grey/

The macro system is modular, so you can easily write and publish macro libraries. I have written some for testing, gulp, and react. It's not super mature but it's getting there.

[+] rndn|10 years ago|reply
There is no shortage of JavaScript-Lisps, that’s for sure!