3 ms·
ParenScript (or CoffeeScript) is not the same as ClojureScript. ParenScript "transforms" a subset of CL to JS, while ClojureScript is a full-fledged target runt
by zaph0d 15y ago
ParenScript (or CoffeeScript) is not the same as ClojureScript. ParenScript "transforms" a subset of CL to JS, while ClojureScript is a full-fledged target runtime for Clojure. For example, something like
(parenscript:ps (defun square (x) (* x n))) ;; [sic]
will compile fine to "incorrect" JS code. Try doing the same in ClojureScript, you'll get an error/warning from the compiler. This applies to CoffeeScript, etc. as well.
Update - To summarise, ClojureScript is to Clojure what ABCL is to Common Lisp.
- felideon 15y agoThanks, it makes sense now also thanks to brehaut's comment. I hadn't realized it actually _is_ a Clojure implementation in JavaScript. Edit: Actually that's not strictly true. "What ClojureScript is Not" https://github.com/clojure/clojurescript/wiki/Core-blog-post-for-launch https://github.com/clojure/clojurescript/wiki/Core-blog-post...
- sedachv 15y ago> (parenscript:ps (defun square (x) (* x n))) ;; [sic] Why is this example incorrect? n might be a dynamic or global variable; there's no way to know during compilation.