News for hackers. Stuff that matters.
Re:Clojure 1.10 release by kbd on Monday December 17, 2018 @06:25PM (#18703237)
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?
Re:Clojure 1.10 release by preordained on Monday December 17, 2018 @06:32PM (#18703275)
I 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

Re:Clojure 1.10 release by kbd on Monday December 17, 2018 @07:21PM (#18703537)
> 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.

Re:Clojure 1.10 release by lenkite on Monday December 17, 2018 @10:36PM (#18704348)
You can use Graal native image to compile Clojure apps to single binaries. https://www.astrecipes.net/blog/2018/07/20/cmd-line-apps-wit...

There is also a lein (clojure build tool) plugin for this at https://github.com/taylorwood/lein-native-image

Re:Clojure 1.10 release by zmmmmm on Monday December 17, 2018 @08:35PM (#18703874)
> * Bias against Oracle and Java

It's always fascinating when I encounter people with opposite biases to my own. While I'm no fan of Oracle, I seek out technologies that are based on the JVM and try to avoid things based on many other technologies because I intrinsically trust certain behaviors and features of the JVM that other ecosystems lack.

Re:Clojure 1.10 release by kbd on Monday December 17, 2018 @10:01PM (#18704226)
After suffering through Java early in my career I've completely avoided it since then. What parts of Java/JVM do you find indispensable vs the rest of tech?
Re:Clojure 1.10 release by zmmmmm on Monday December 17, 2018 @10:56PM (#18704408)
Definitely more the language ecosystem than Java itself - coding in Java itself is painful to me as well. I actually write most of my code in Groovy, some in Kotlin and Scala. But these things keep me liking the JVM -

- maturity of the infrastructure (monitoring, debugging, IDEs, build tooling). I love that I can fire up my debugger and remote attach to a process running on some other host and set a breakpoint for a specific condition to catch a bug. Or that I can do the same to profile memory etc., all with very mature tools.

- very good performance - smack bang inbetween C/C++ and higher level languages (acknowledging that startup time is a big hole in that - but not an important one for me)

- truly cross platform - none of this python style, cross platform except half your packages are really written in C and won't compile unless an entire ecosystem of dependencies is there to support them, and even then some of the flat out don't work on some platforms. This extends deeper than most other languages ie: you can get closer to low level OS features while maintaining 100% cross platform capability.

- strong / static typing under the hood which you can access optionally (eg: languages like Groovy / Kotlin let you write high level code without being burdened too much by the overhead of static typing), but all the Java APIs, ecosystem of libraries are all statically typed so you have good guarantees and excellent documentation.

- deployment behavior - I can run the JVM, give it specified memory footprint and know it's going to stay within that

Re:Clojure 1.10 release by lsh on Monday December 17, 2018 @07:28PM (#18703571)
> 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/

> Bias against Oracle and Java

yeah, well ... we're all biased. It helps us make decisions quickly ;)

Re:Clojure 1.10 release by kbd on Monday December 17, 2018 @07:55PM (#18703689)
> 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

Re:Clojure 1.10 release by ghufran_syed on Monday December 17, 2018 @08:26PM (#18703839)
Yeah, 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
Re:Clojure 1.10 release by lsh on Monday December 17, 2018 @09:12PM (#18704022)
absolutely, 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.

Re:Clojure 1.10 release by aidenn0 on Monday December 17, 2018 @09:13PM (#18704025)
And python tends to have fairly high startup time (compared to compiled languages) for any non-trivial script.
Re:Clojure 1.10 release by ken on Tuesday December 18, 2018 @02:14AM (#18705036)
> The JVM just seems so "heavy" to me.

Wouldn't any replacement need just as much "weight"? The GraalVM example (linked elsewhere) turns a 300KB Java program into a 25MB standalone binary. The JVM provides a lot of features, and they don't come free. That's why he chose it.

Re:Clojure 1.10 release by dragandj on Monday December 17, 2018 @06:50PM (#18703372)
You can use GraalVM, I guess? But keep in mind that the code typically runs faster on the JVM.

https://www.graalvm.org/

Re:Clojure 1.10 release by lsh on Monday December 17, 2018 @07:30PM (#18703579)
> the code typically runs faster on the JVM.

no, it typically doesn't. in certain edge cases the JVM does out perform Graal though.

Re:Clojure 1.10 release by phyrex on Tuesday December 18, 2018 @07:43AM (#18706059)
“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.
Re:Clojure 1.10 release by reilly3000 on Tuesday December 18, 2018 @05:42AM (#18705665)
Its 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.
Re:Clojure 1.10 release by bpicolo on Monday December 17, 2018 @07:22PM (#18703539)
There’s a CLR port if you really just hate the JVM ;)

Can do NodeJS with Clojure a’la Clojurescript as well

Re:Clojure 1.10 release by int_19h on Monday December 17, 2018 @10:38PM (#18704354)
Is that actively maintained? Last commit on the GitHub repo has been two months ago, and the wiki page was last edited in 2014.
Re:Clojure 1.10 release by bpicolo on Tuesday December 18, 2018 @09:10AM (#18706461)
It'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.

Re:Clojure 1.10 release by xapata on Tuesday December 18, 2018 @01:51AM (#18704967)
https://github.com/clojure/clojurescript

Looks like last update 3 days ago.

Re:Clojure 1.10 release by grzm on Tuesday December 18, 2018 @01:53AM (#18704978)
While it's admittedly ambiguous, I think they're likely referring to ClojureCLR, not ClojureScript.

https://github.com/clojure/clojure-clr

Re:Clojure 1.10 release by dan-f on Monday December 17, 2018 @06:34PM (#18703285)
In what context are you trying to avoid the JVM?
Re:Clojure 1.10 release by kbd on Monday December 17, 2018 @07:37PM (#18703617)