DailyJS

Scriptjure and JavaScript/Scheme

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

lisp javascript clojure

Scriptjure and JavaScript/Scheme

Posted by Alex R. Young on .
Featured

lisp javascript clojure

Scriptjure and JavaScript/Scheme

Posted by Alex R. Young on .

Scriptjure is an interesting project for those of you who like Clojure. It
generates JavaScript like this:

(js (alert "hello world")) 
=> "alert(\"hello world\")"

(js (foo x y)) 
=> "foo(x, y)"

(js (if (== foo 3) (foo x) (bar y)))
=> "if ( (foo == 3) ) {
   foo(x);
   }
   else {
   bar(y);
   }"

Other related projects that are worth looking at are Lisp in
JavaScript
and
Parenscript.

This reminded me of The Little
JavaScripter
which was an
interesting essay by Douglas Crockford, based on The Little LISPer. If
you've heard people saying Scheme and JavaScript are related but aren't
sure what this means, it's worth reading it. Google Books has a viewable
version of The Littler Schemer so you can follow
along.