News for hackers. Stuff that matters.
Re:Why I am excited about Clojure by jhh on Monday May 05, 2014 @10:19AM (#7698679)
I'll try to dispel some of the concerns about Clojure.

1) Stacktraces in JVM may be ugly, but the amount of insight into runtime issues that the JVM offers you is generally way higher than in runtimes like cpython or MRI.

2) Clojure gives you a rather elegant way to work with the different JVM number types as it offers literals for those. I think Java Longs (the integer default) should be long enough as it's a 64 bit value. And on the floating point side the default is a double, which also seems nice to me. See: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/dat...

Above this Clojure offers BigDecimal literals and native ratios.

3) The startup time is gigantic. However, while developing you usually should not have to restart the JVM as you can update the JVM with new bytecode through the REPL. This should also dispel the concern about unit tests (although I'm not sure you can reach the necessary speed, if you talk about < 0.5 second unit tests, because the code needs to be compiled to JVM bytecode 1st. There's definitely still potential there.

Re:Why I am excited about Clojure by wtetzner on Monday May 05, 2014 @11:06AM (#7698941)
One thing I've noticed is that the JVM startup time is actually pretty small. What's slow is waiting for Clojure to bootstrap itself.
Re:Why I am excited about Clojure by rossjudson on Monday May 05, 2014 @12:54PM (#7699585)
Detailed discussion on startup times at http://nicholaskariniemi.github.io/2014/02/11/jvm-slow-start... (and subsequent articles by the same author).
Re:Why I am excited about Clojure by mduerksen on Monday May 05, 2014 @01:03PM (#7699640)
JVM Feature Request: The ability to preserve a complete JVM state (in this case with loaded Clojure stuff) and quickly start from there.

Does anybody know if something like that is possible/already exists?

Re:Why I am excited about Clojure by wink on Monday May 05, 2014 @01:52PM (#7700005)
Re:Why I am excited about Clojure by ivank on Tuesday May 06, 2014 @12:41AM (#7702868)
I have used http://criu.org/ on Ubuntu 14.04 to checkpoint and restore a Java process running a Clojure nREPL server. It took 480 ms to checkpoint a 128MB process and 213 ms to restore on a 2.4ghz E5645.
Re:Why I am excited about Clojure by 616c on Monday May 05, 2014 @01:54PM (#7700017)
Not quite what you asked, but I found people recommending this.

https://github.com/ninjudd/drip

Re:Why I am excited about Clojure by pjmlp on Monday May 05, 2014 @03:07PM (#7700465)
> Does anybody know if something like that is possible/already exists?

The majority of commercial JVMs that tend to be ignored on HN, provide JIT cache between runs and AOT compilation.

Re:Why I am excited about Clojure by jhh on Monday May 05, 2014 @11:43AM (#7699184)
That's true, but it's generally like this with any Java application. The JVM starts in 0.3 seconds, but loading all your classes usually takes seconds. I don't know the arcitecture well enough, but I think it's because it looks for classes in a lot of places and unpacks JAR files etc.
Re:Why I am excited about Clojure by strictfp on Monday May 05, 2014 @12:39PM (#7699506)
That of course depends on the number of deps that you have, but you have to have a _lot_ to reach into the second range.
Re:Why I am excited about Clojure by pron on Monday May 05, 2014 @11:32AM (#7699109)
Yep. A JVM doesn't take more than a about 100ms to start up. But Clojure takes a long time, and Leiningen is slow as hell.