5 ms·
Are there any plans for a native version of Clojure? I'd rather avoid the JVM if possible, but I suppose the whole ecosystem is dependent on it so that's unlike
by kbd 8y ago
Are there any plans for a native version of Clojure? I'd rather avoid the JVM if possible, but I suppose the whole ecosystem is dependent on it so that's unlikely?
- reilly3000 8y agoIts often referred to as a guest language. The syntax is largely the same across JVM, CLR, and JS V8. The aim was to utilize the richness and reach of the most popular ecosystems, so all of Maven and npm are available to Clojure devs. The language should be able to be consistent across future runtimes with largely the same semantics.
- preordained 8y agoI guess I might ask what this stance is founded on? The JVM is just a binary that runs byte code. It's stable and runs well pretty much everywhere. If you insist the JVM has cooties, you could use Docker and abstract it away, it might be an ideal way to use it anyways depending on your work. The JVM /= Oracle JVM by the way. There is OpenJDK EDIT: Also I think recent Java releases have gotten into making self contained binaries (which just means they package the JVM...it's in there, it might jump out and bite you!). But, as long as you are careful what you are shipping, packing up a JVM has always been an option
- kbd 8y ago> I guess I might ask what this stance is founded on? Kotlin has Kotlin/Native, so I was hoping there might be a similar initiative for Clojure. But, a few reasons: * Startup time * Ability to deploy/share a binary * The JVM just seems so "heavy" to me. It's certainly the only language runtime I know of that runs a persistent helper app, or asks to install an Ask toolbar upon installation. * Bias against Oracle and Java > Also I think recent Java releases have gotten into making self contained binaries TIL, thanks. Edit: edited.
- lsh 8y ago> Startup time Java is not as bad as you think. Clojure does takes a little longer though > Ability to deploy/share a binary there are jar files, but I know what you mean. Interesting work happening in GraalVM land: https://www.innoq.com/en/blog/native-clojure-and-graalvm/ https://www.innoq.com/en/blog/native-clojure-and-graalvm/ > Bias against Oracle and Java yeah, well ... we're all biased. It helps us make decisions quickly ;)
- kbd 8y ago> Java is not as bad as you think. Clojure does takes a little longer though For example, I have a Python script[1] that runs on each command prompt to print status about my current git repository. Just timed it, it runs in .08-.12 seconds within a repo and about .02s outside of a repo. I still want to rewrite it in C using libgit2 someday, but something like that would be unusable if it was written in Clojure. [1] https://github.com/kbd/setup/blob/master/HOME/bin/repo.py https://github.com/kbd/setup/blob/master/HOME/bin/repo.py
- ghufran_syed 8y agoYeah, for scripting you should use something like Planck: it uses clojurescript which is virtually the same language as clojure, but starts up super fast so is great for scripts: https://github.com/planck-repl/planck https://github.com/planck-repl/planck
- lsh 8y agoabsolutely, Clojure is not a scripting language and Planck is amazing. There are issues with a Graal-compiled Clojure repl due to reflection (apparently), but I think it's only a matter of time before those geniuses come up with something.
- aidenn0 8y agoAnd python tends to have fairly high startup time (compared to compiled languages) for any non-trivial script.
- dan-f 8y agoIn what context are you trying to avoid the JVM?
- kbd 8y agoPosted response here: https://news.ycombinator.com/item?id=18703537 https://news.ycombinator.com/item?id=18703537
- dragandj 8y agoYou can use GraalVM, I guess? But keep in mind that the code typically runs faster on the JVM. https://www.graalvm.org/ https://www.graalvm.org/
- lsh 8y ago> the code typically runs faster on the JVM. no, it typically doesn't. in certain edge cases the JVM does out perform Graal though.
- phyrex 8y ago“Certain edge cases” being everything that doesn’t include startup time? It makes sense to me that a kit would be able to optimize better than an aot compiler. If you claim otherwise I’d like to see some sources.
- bpicolo 8y agoThere’s a CLR port if you really just hate the JVM ;) Can do NodeJS with Clojure a’la Clojurescript as well
- int_19h 8y agoIs that actively maintained? Last commit on the GitHub repo has been two months ago, and the wiki page was last edited in 2014.
- xapata 8y agohttps://github.com/clojure/clojurescript https://github.com/clojure/clojurescript Looks like last update 3 days ago.
- grzm 8y agoWhile it's admittedly ambiguous, I think they're likely referring to ClojureCLR, not ClojureScript. https://github.com/clojure/clojure-clr https://github.com/clojure/clojure-clr
- bpicolo 8y agoIt's a one-man job more or less, so it comes in bursts, but it's up to date with 1.9.0. That said, if you're looking to get into the Clojure ecosystem in general, almost certainly not the place to start. You miss out on the multitude of good OSS libraries that have Java deps.