News for hackers. Stuff that matters.
Re:Clojure is cool by yogthos on Sunday September 09, 2018 @11:57AM (#17946451)
The claims regarding JVM bloat are largely exaggerated, especially now that the JVM introduced modules. However, if it's not your thing it's worth noting that ClojureScript happily runs on Node. Here's an example of how easy it is to get up and running with https://github.com/yogthos/mastodon-bot
Re:Clojure is cool by fnordsensei on Sunday September 09, 2018 @12:55PM (#17946713)
And it seems to be working on Graal, though people are trying to find a way around limitations related to reflection, so I understand.
Re:Clojure is cool by dancek on Sunday September 09, 2018 @12:47PM (#17946666)
I'm working on my first Clojure project and find JVM to be painful (it starts very slowly and eats lots of RAM). I'd appreciate any tips on making JVM non-bloated.
Re:Clojure is cool by fnordsensei on Sunday September 09, 2018 @01:01PM (#17946745)
If start time and memory usage is important to you, go with ClojureScript on Node instead.

If you do stick with the JVM, it tends to trade memory for speed, unless you tune it otherwise. For startup speed, start it once, connect a REPL, and keep it running. A started REPL on a JVM instance can be flushed very quickly when you need a blank slate.

Re:Clojure is cool by markc on Sunday September 09, 2018 @09:27PM (#17948782)
Don't know about bloat fixes, but what does your workflow look like that JVM starts are annoying? My Emacs CIDER REPL comes up in 4 seconds (MB Pro 16G) and it's often many hours (even days sometimes) between restarts.

But yes, slow starts are annoying if you're starting a JVM frequently. Can you change your workflow so that's not needed? Check out Component, Mount or Integrant.

Re:Clojure is cool by dancek on Tuesday September 11, 2018 @08:55AM (#17959267)
This is a relevant answer. Thank you.

We're using Integrant already so yes, I can mostly work in a REPL without restarting. But the restarts are more like 15 seconds. I'll have to measure and see what's so slow. My rdev platform is Cursive on a 16G MBP.

And while I'm commenting, yes, we have a reason to run on JVM (a lot of legacy Java code we probably want to interface with later on). So thanks to other commenters for suggesting Node.js and Common Lisp, but not possible. :)

Re:Clojure is cool by jtr_47 on Sunday September 09, 2018 @12:53PM (#17946700)
Logically, don't use Clojure & the JVM if you want to avoid bloat. Try LFE, Lisp Flavored Erlang: http://lfe.io/ or SBCL: http://sbcl.org/

Just a recommendation if you want to avoid the JVM bloat issues, which are real and have existed since the JVM was developed

peace

Re:Clojure is cool by cutler on Sunday September 09, 2018 @08:40PM (#17948611)
Don't underestimate Erlang's capacity for eating-up all the RAM on a machine in very quick time. Those lightweight processes start to add up if left unchecked. At least the JVM establishes an upper limit on memory use from the outset.
Re:Clojure is cool by vindarel on Monday September 10, 2018 @08:38PM (#17956294)
Hey go with Common Lisp :D