Live data from Hacker News

ClojureScript

github.com

71–80 of 95 posts

Re: ClojureScript

#71

I havent look at the implementation yet, but the question that comes to mind is is this one step closer to "Clojure in Clojure"?

Yes, it's a big step in that direction. Rich said it should be easy to change JS target for another.

Re: ClojureScript

#72
post #2

Now we have a "solid" Lispy alternative to imperative languages that compile to JS. Nice surprise Rich !

You mean other than Parenscript[1], which seems to have been written about 4 years ago? Edit: Parenscript was just the first to come to mind, but check out http://www.cliki.net/JavaScript [1] http://common-lisp.net/project/parenscript/

See this comment - http://news.ycombinator.com/item?id=2788849

Re: ClojureScript

#74
post #64

Given a radical departure from the JavaScript core (comparing to Coffeescript), I wonder how easy the debugging would be.

Presumably, you wouldn't have to look at the Javascript source because the Clojurescript should directly tell what's wrong when it's compiling to Javascript. This is different from Coffee because Coffee is only a compiler front-end (a lexer/parser) and thus, doesn't really provide any execution semantics.

No. The clojure compiler only complains about compilation errors, which doesn't help at all when you're debugging runtime errors.

For clojure to be usable for serious client side development, you would definitely need a browser extension that relates the location of runtime errors in the compiled JavaScript back to the clojure source code. Which is precisely what something like GWT gives you (and more).

Re: ClojureScript

#75

I'm both curious and surprised by the lack of comments/questions about the quality of the generated JS. Can anyone who has played with it speak to the quality? How does the generated code stack up against say Coffeescript's?

To better understand how different ClojureScript is from CoffeeScript, read the last paragraph on the ClojureScript wiki's Rationale page: https://github.com/clojure/clojurescript/wiki/Rationale

It's purpose is not to compile down to vanilla, readable JavaScript, but rather to make it easy to write production-ready JavaScript applications that can easily leverage the "advanced mode" of the Google Closure compiler.

Re: ClojureScript

#76

I am a clojure intermediate-beginner who would like to use it to learn about web technologies, which I know almost nothing about. Would people recommend this as an entry point? If not what would you recommend instead?

I have been tinkering with Clojure off and on for the past year, and I only recently have started with Clojure's web technologies.

Currently the documentation is a mess. I've slowely been learning by looking at very basic examples, and then needing to read source code to fill in the details for the stuff I wanted to do.

While there's a great deal of excitment for ClojureScript, I feel that it as an entry point (at least for me) wouldn't have enough docs for me to learn quick enough so I wouldn't become frustrated. YMMV, of course, but I think you'd be better off looking at Compojure or Moustache, Enlive or Hiccup, and Ring , or even Noir: www.webnoir.com

Re: ClojureScript

#77
post #61

Earlier quoted context omitted.

If 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"?

The 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…

Aha! Great, this is definitely pretty awesome. I don't think anyone's written something like that in Common Lisp yet.

Re: ClojureScript

#78

I'm both curious and surprised by the lack of comments/questions about the quality of the generated JS. Can anyone who has played with it speak to the quality? How does the generated code stack up against say Coffeescript's?

I'd say it's pretty good, http://blog.fogus.me/2011/07/21/compiling-clojure-to-javascr...

Re: ClojureScript

#79
post #70

Earlier quoted context omitted.

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, t…

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. a…

Thanks, 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...

Re: ClojureScript

#80
post #53
post #46

Earlier quoted context omitted.

I 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 righ…

I 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.

This is probably missing the point, but JavaScript is hosted on both the JVM and JavaScript VMs (thanks to Rhino). By extension, everything that compiles to JS is hosted on both.
Post reply on HN