5 ms·
I'm glad for the Clojure community if this didn't exist before, but I'm pretty sure Lispers (ie Common Lispers) have written "entire" web apps in Lisp for quite
by felideon 15y ago
I'm glad for the Clojure community if this didn't exist before, but I'm pretty sure Lispers (ie Common Lispers) have written "entire" web apps in Lisp for quite a while[1].
For example, Kenny Tilton wrote a Lisp wrapper to qooxdoo on top of his data-flow library (Cells). The only time we need to write JS code now is for additional glue for widgets or functionality we haven't wrapped yet. And since it wraps qooxdoo, this means not writing (or needing to know) a lick of HTML/CSS. We just write Lisp. And we persist data to a triple store that "shapes" the Lisp/qooxdoo code at runtime.
</smug>
[1] I want to say "years" but I'm not sure how many people have used CL to write "entire" web apps.
- gfodor 15y agoI notice you keep replying about Parenscript, but the difference here is important. The reason this is a bigger deal than you make it out to be is because Clojure is hosted on the JVM. That means it's generally had a chance to enter the enterprise, and beyond that, has access to the entire JVM library and interop. What this means now is, for the first time, you can write Clojure code on the server, interop with legacy Java code or well-tested libraries, and then write Clojure code on the client, full stack. This, as far as I know, is a pretty big game changer since it allows you to write a full-stack web application that is part of the Java ecosystem in a single language that happens to not suck either. Edit: To clarify, I'm sure there are other JVM lisps, and other Javascript lisps. But this is the first one that is both, I'd wager. This is important.
- felideon 15y agoSo the only reason it's a big deal is because it's Clojure? It was only a matter of time this library was written by somebody. Edit: I guess this somebody also happens to be Rich Hickey. Indeed it would be a big deal if John McCarthy had written Parenscript. :D
- Tiomaidh 15y agoTo play devil's advocate, wouldn't the exact same thing be possible with the above alternatives and Armed Bear Common Lisp? You can write full-stack in Common Lisp, it's just that different parts need to go through different compilers/interpreters/transformers/what-have-you. Just as it is with Clojure. No, I think the thing to note here is that Clojure--for reasons I can only guess at--has a lot more sex appeal than CL.
- icey 15y agoI think if Parenscript were just announced today it would get a big reaction as well. Just like there's a big reaction any time a language comes out and says it can compile down to Javascript. There was a big reaction when a guy did it for C# / XNA, for example. Just because people are excited about developments in the Clojure ecosystem doesn't mean they aren't excited you can do this elsewhere. It's interesting right now because it's new, and it opens up some new ways of development for people who enjoy writing software in Clojure.
- felideon 15y ago"Just because people are excited about developments in the Clojure ecosystem..." Good point. My comment was more of a response to the "thought provoking" part rather than being excited about ClojureScript itself.
- gfodor 15y agoI could be wrong, but I think this is different. Are there any other languages that are both hosted on the JVM and also in Javascript VMs? Beyond that, there almost certainly isn't a lisp that is.
- spullara 15y agoJava via GWT runs on the JVM and in JavaScript.
- deleted 15y ago[deleted]
- gfodor 15y agoAh, how could I forget! I guess the "non suck" criteria made me forget about GWT :)
- nl 15y agoTheoretically almost any language that can run on x86 will now run in Javascript thanks to Fabrice Bellard: http://bellard.org/jslinux/ http://bellard.org/jslinux/ I don't think anyone has managed to get a JVM to run on his Linux port yet though. More practically, Javascript itself runs fine on the JVM (via Rhino). There are Ruby-on-JS[1] and Python-on-JS[2] efforts as well (both Ruby & Python run on the JVM) [1] http://ejohn.org/blog/ruby-vm-in-javascript/ http://ejohn.org/blog/ruby-vm-in-javascript/ [2] http://pyjs.org/ http://pyjs.org/
- scottjad 15y agoClojure has had things like Parenscript for a while, including scriptjure (~1.75 years old) and clojurejs.
- felideon 15y agoWhat's new/exciting/different about ClojureScript? No one has really made it clear here. Edit: Trimmed unnecessary banter as it's a genuine question.
- fogus 15y agoWhat would you expect to be different? Your post says the important point: it's Clojure. For some an additonal point is that it's not JavaScript. There is nothing deeper than that.
- felideon 15y agoIf that's the most important point I fail to understand why it's #1 Hacker News, sorry. This makes HN no better than a "hype engine" as some say. If someone would at least mention that Google Closure makes it pretty neat, then I would have let it go, so to say. Even worse, two other relevant Clojure libs are mentioned and the important point is still "it's Clojure"?
- brehaut 15y agoThe other libraries are clojure libs that implement javascript analogies[1] as clojure macros and functions and generate javascript. ClojureScript is a Clojure The Language compiler that implements Clojure (its datastructures, standard lib, protocols, deftypes etc etc) and is hosted[2] on javascript rather than the JVM. In ClojureScript you are not writing reskinned javascript, you are writing Clojure. [1] simplified for the argument [2] By outputting javascript
- felideon 15y agoAha! Great, this is definitely pretty awesome. I don't think anyone's written something like that in Common Lisp yet.
- zaph0d 15y agoParenScript (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.