ClojureScript is the only compile to JS language that I'm aware that lets you fully leverage the power of modifying JavaScript prototypes w/o fear of gross incompatibilities:
Note that they've extended (safely because of namespaces) browser natives including Element, Array, String, as well as the custom ClojureScript data types to respond to the color function.
Thanks for putting that together, especially the documentation! I think that I would save a lot of time, eventually, using a uniform Clojure development environment for server side and client side, but I am hesitant to spend the learning curve time right now. (Clojure, Noir, and Javascript are working out really well for me.)
Your good job on documentation will get me to spend the learning curve time sooner than later.
I also do work using GWT and SmartGWT and the uniform development environment (even if it is Java :-) really helps work flow.
You guys are doing excellent work. I also find what you are doing with predicate dispatch very interesting. I think that class of methods are/will be really powerful - especially for big complicated programs. Have you been able to get it to work efficiently for most cases in clojurescript and in general?
We're not quite there yet with predicate dispatch. However if the pattern matching benchmarks are any indicator, it will be plenty efficient. Definitely excited about it, but it might be some time since it will require some well considered synergy between core.logic and core.match.
I assume this is just-launched, but being able to do examples online would be amazing. I believe ClojureScript does not include (eval) so you'd have to route to the server and back; perhaps this is feasible?
ClojureScript is a subset of Clojure, so you do need to more or less know Clojure. The main benefit to ClojureScript is that you can use essentially the same language on the front- and back-ends.
Yes, but it doesn't really mention that in the documentation. It would be good to something along the lines of "You will need to know Clojure to use ClojureScript One, go here to learn it".
This looks excellent though - I'll give it a go once I think of a toy project to try it with.
Here is a good example of ClojureScript <-> Clojure communication https://github.com/neotyk/ws-cljs It uses the Aleph Clojure library on the server side.
The short answer is yes, ClojureScript has similar interop features for vanilla JS as Clojure for the JVM has for Java.
However, given that ClojureScript uses the Google Closure compiler to optimize production code, there are a few gotchas to be aware of. This article does a great job at explaining the details:
Strange for me it was he other way around. I had to replace https:// with git:// , perhaps it depends on the git version? mine was probably pretty old.
You have to start by comparing apples to apples. ClojureScript is a programming language which compiles to JavaScript, Node.js is a runtime platform which executes JavaScript.
This is definitely a question worth asking. I think the audience ClojureScript is most appealing to is those who are already writing server-side stuff in Clojure and want to have a consistent front end or "old-school Lisp hackers" who are now writing web applications.
Personally, I'm attracted to Lisp/Clojure because of its AI history but haven't put the time in to build anything real with it yet. Are there people who have switched away from (Node || Python || Ruby) && JS who could discuss their experience?
I've done Ruby for years and I've written one large commercial project in clojure. Clojure was great, and I would love to use it more, but I haven't been able to convince people to use a lisp.
It's very strange actually, I tried really hard to do a small project in clojure at my current job and got resistance from everyone. These same people were happy to try coffee script, scala, golang, etc, etc. There seems to be a true bias against lisps.
Personally, all I can say is: Other people can choose to accept or reject parentheses. As people who know and understand the power and inherent elegance of the language we need to skip the step where we yearn for recognition and go straight to the "doing really fantastic stuff and making you jealous" portion of the narrative.
We dote too much on the history of Lisp w/r/t Clojure IMO. Clojure is not CL. Clojure is not Scheme. Clojure is not Haskell. Clojure is Clojure. It has its own state, identity, and time. Make great stuff with it and other people will follow. My feeling is that was need to quit waiting for approval and simply draw the line in the sand. I would be happy to forfeit future programming job opportunities if it meant committing to a language that solves the problems I care about. Will everyone do that? Unlikely. Will the people who know better than to settle for second best do it? I have a feeling the answer there is closer to yes.
This is well known and has allready been done for clojure (cant remember where I saw it).
There are problems with this syntax when you combine it with macros. There is some work done to solve this but not much. For a (theoretical) lisp that works this way, see here: http://users.rcn.com/david-moon/PLOT/
Oddly, the thing that triggers ire seems to be the presence of a left paren at the start of a line. (Many constructs in Clojure involve fewer parens than the same construct in Java, so the mere number of parens is therefore not a reason to avoid Clojure.)
People see parens and freak out. I once interviewed a guy who said his least favorite language was Lisp. I didn't know it was at the bottom of anybody's list!
The contexts are all different. A VP told me that he had a bunch of mediocre programs and it would be hard from them to use it, and hard to hire new programmers. A friend of mine who tries new languages all the time simply doesn't like it cause it's a lisp. A Director at a different company didn't say clearly, but it seemed to boil down to it being a lisp. H was fine with us trying Scala or even golang, but no clojure.
Pros and cons. Switching away from a mainstream language is hard; you lose the community and all the work going to it. But you gain a lot of technical power, and possibly find a small community of really smart people.
Sometimes you can get the best of both worlds by doing something like ClojureScript, which is to compile to a mainstream language. That is compelling.
In the end, Lisp is really powerful, it's better than other languages, and it's worth learning. If you can deal with the lack of a huge community, you'll be fine. Clojure is gaining quite a large following, actually, so it's one of the best environments to learn Lisp.
What I meant to say is "based on ecosystem, performance, scalability and learning curve, is there a compelling argument that would convince me to change from my current language/framework/platform to this one?"
For the server side, Clojure, by most metrics, would beat node.js by virtue of running on the JVM and its stellar concurrency capabilities. This includes ecosystem, performance and scalability.
Using ClojureScript in the browser gives you a language to use that's consistent with what you're using on the server, and easy interop (you can just send data back and forth directly, without having to do any extra serialization). It's also (in my opinion) a much better language than JavaScript.
Learning curve is the one likely stickler - depends how inclined you are to learn a Lisp. Personally, I love it.
http://clojurescriptone.com/documentation.html#one.color
Note that they've extended (safely because of namespaces) browser natives including Element, Array, String, as well as the custom ClojureScript data types to respond to the color function.