Hacker News new | ask | show | jobs
by lilactown 3317 days ago
As someone who writes JavaScript for a living (among bits of Java and Swift), I'm loving ClojureScript. I'm currently building a side project with it. But I am still a bit skittish of Clojure (JVM). The JVM just feels slow and cumbersome compared to what I'm used to (Node.js, Erlang/Elixir, Python). The lack of good error messages is manageable when combined with figwheel on the CLJS side, but there doesn't seem to be something comparable on the server side.

I feel like Clojure needs a really good use case or story to have it become more popular. It feels really nice to program in, it's just that for specific needs - native UI programming, CLI apps, concurrent programming, data processing, web programming - other languages are better in those areas, and are good enough in other areas, that Clojure just doesn't seem compelling.

I think that Elixir's (which is really the same story as Ruby's) success is worth looking at. Elixir is really cool, but it's main hype train really doesn't have anything to do with it's technical strengths (concurrent programming) - it just has a really compelling web development story through Phoenix.

2 comments

> The JVM just feels slow and cumbersome compared to what I'm used to (Node.js, Erlang/Elixir, Python)

In what regard? Because the JVM is faster than all of the above.

It's the startup and REPL time, typically. The JVM is super-powerful when it comes to compute tasks, but define a function on the REPL and Clojure will compile it, which is necessarily slower than what Python does.

So yeah, Clojure's faster, but perception matters. Erlang's a different case because it optimises for responsiveness for small tasks. It's very hard to write Clojure or even raw Java code as good at that as an easy Erlang program.

But yeah, a Mandelbrot set will be faster in Clojure.

JVM startup time is typically sub-second. Anything above that is not the JVM, it's something else.
I agree with you, it's the startup time. It is felt when running unit test too.

That's why JRuby is still a niche and most developers keep using MRI despite JRuby being eventually faster. It's a different example of developer happiness.

In fact, I would say that if ClojureScript's interop with React Native could be made to be much smoother, that would be a real killer app.