Hacker News new | ask | show | jobs
by shadowmint 3317 days ago
I hear this a lot from the clojure community... but I think it's a missed attempt to pivot off the JVM and have clojure be useful for more people on a more popular platform.

Missed?

Yes.

Pick a thing.

Be excellent at it.

What is clojurescript excellent at?

Its a nice language, with not very nice tooling, that is hard to maintain and significantly different from the existing javascript code base you already have, with poor interop to the existing js ecosystem (it is poor, compared to some other compile to js languages).

On the JVM, java sucks, but your choices are limited; what, maybe groovy, kotlin, scale, clojure?

Clojure has pride of place as the best dynamic language in that space.

For javascript, that crowd of alternatives is so much larger, clojurescript needs to actually be good to stand out amongst all the others.

...and I don't think it really does.

The people who use it seem to just like it as a language; and I get that, that's a thing.

...but aesthetics are personal preference and its difficult to ague they make a compelling use case.

4 comments

> with not very nice tooling

The tooling is the best. Figwheel is hot reload that never goes down, devcards is revolutionary, and a browser repl for live in editor evaluation...

> significantly different from the existing javascript code base you already have

It actually isn't. Clojurescript is basically javascript that's immutable first, has underscore in it's core library, and then a bunch of other awesome language constructs. The libraries use the same patterns, re-frame is a nicer, more succinct abstraction over react-redux.

> poor interop to the existing js ecosystem

The interop might be the best out there. Seriously you can write javascript in clojurescript. you can straight up import es6 jsx javascript into your clojurescript code. (thanks Google Closure)

> For javascript, that crowd of alternatives is so much larger

I mean, what are the options? Clojurescript's benefits are so much more than the language. The real pluses for clojurescript are the Google Closure compiler, hot reload, browser repl, devcards, front end libraries. The language is the cherry on top. There are no alternatives that have a comparable platform not completely alien to JS developers.

I am beginner to Clojuresript/Clojure. I am not that impressed by JVM Clojure (it is bloated, slow and laggy) and frankly there are better choices on the JVM - Ex: Kotlin offers more possibilities.

But I do like Clojurescript. However, it needs to wean itself away from the all the Java tooling and not require a JDK. We need a lein/figwheel written in node CLJS. An extension that supports REPL like Lumo and step through debugging within visual studio code. A good Clojurescript book. A good React-based UI component library written in CLJS.

> The tooling is the best.

No, it's really not.

Have you tried other ecosystems? You should. If clojure is the best tooling you've ever used, look around, there's a wide world out there.

Heck, even the article linked above from lambdaisland lists tooling as one of the issues clojure suffers with.

> I mean, what are the options?

Haxe. Dart. Typescript. Elm. Scala. LivesSript. ES6. CoffeeScript. Flow. PureScript. ...

There must be what, 50 odd listed on https://github.com/jashkenas/coffeescript/wiki/List-of-langu...

...but I mean, even if we accept that the things you say about clojurescript are true (and I don't agree that they are, but even if I did), the point I'm making is that it doesnt stand out from the crowd in terms of features.

Nothing you've described is something that would be missed particularly using say, typescript, webpack and npm.

> What is clojurescript excellent at?

ClojureScript excels when writing frontend UIs, in my opinion. There are so many good ideas in Reagent and Re-Frame. JS tries to be like Re-Frame, with Immutable.js, react-redux, etc.

> Clojure has pride of place as the best dynamic language in that space.

Yes. The only other JVM dynamic language in your list is Apache Groovy. Last month it released version "2.5-alpha-1" with Groovy's very first macro facility, something Clojure's been doing since its inception. And I can't imagine how long a version tagged "alpha-1" will take to be suitable for actual use!

How much experience do you have with ClojureScript and other compiled to JS languages?
A lot. We use clojurescript and ES6 in production.

(the clojurescript is now considered 'legacy')