Live data from Hacker News

The Jank Language: LLVM Hosted Clojure

jank-lang.org

31–40 of 83 posts

Re: The Jank Language: LLVM Hosted Clojure

#32
post #2

I've been dreaming of something like this for a long time. While you can also make native executables with Clojure, using GraalVM, they tend to weigh at minimum around 10MB, and setting up the whole build system is also something I never want to deal with, so this is very awesome.

Is 10mb really a hurdle these days? Remember that since that 10mb includes loads of support infra (such as GC) the user code will be smaller too.

Yes, when the same functionality could be achieved in like 200KiB, 10 MiB is too much. It adds up and suddenly you may have to bundle a whole browser with your ap...oh

Re: The Jank Language: LLVM Hosted Clojure

#33
post #22

Earlier quoted context omitted.

Right? Clojure has so many good things going for it already that a step towards CL (native, image-based) would be the dream.

Why not use something like https://github.com/ruricolist/cloture (a Clojure "adapter" that runs on Common Lisp) if you want that?

That seems very abandoned.

Re: The Jank Language: LLVM Hosted Clojure

#34

See also babashka, a native Clojure implementation for scripting. https://github.com/babashka/babashka

An important difference is that afaik Babashka is an interpreter, so will be fairly slow. It's fast at starting.

While this is LLVM JIT, so will compile the Clojure code to native code just-in-time, and then run the native code.

Re: The Jank Language: LLVM Hosted Clojure

#35

Earlier quoted context omitted.

Is 10mb really a hurdle these days? Remember that since that 10mb includes loads of support infra (such as GC) the user code will be smaller too.

Yes, when the same functionality could be achieved in like 200KiB, 10 MiB is too much. It adds up and suddenly you may have to bundle a whole browser with your ap...oh

Bear in mind that this 10mb is not a fixed multiplication factor. Like, doubling you code size doesn't double your binary size with native-image because that base contains a lot of stuff that's generic. Not just GC but stuff like support for timezones.

It also contains a cached heap (in fact most of it is cached heap) which is one reason these binaries start as fast as C programs do. Especially important for Clojure where the runtime and libraries are written in such a way as to do lots of unnecessary work at startup. Native images can cache all that so you get rid of the startup overhead of Clojure itself.

Re: The Jank Language: LLVM Hosted Clojure

#36
post #27
post #25

Love this. As a Lisper I’m always intrigued by Clojure but as someone with no knowLedge of or desire to learn to JVM I stayed away since I figured eventually I’d hit JVM questions/issues I frankly didn’t feel like dealing with. Is it really 100 percent compatible with Clojure or is that just aspirational. Also, is it the case that lots of libraries/workflows outside the core language in Clojure assume Java integratio…

The official Clojure (JVM) project has an official sister project: ClojureScript, which is designed to be compiled to JavaScript (and maybe Webassembly in the future?). There is a lot of code that runs with both languages and therefore I don't think you should worry too much about using Jank with existing Clojure/ClojureScript libraries.

Clojure is a language without a platform so all the Clojure dialects have the different semantics of the underlying platform, be it the JVM or JavaScript.

For example ClojureScript has all the “wat” semantics from JavaScript primitive types.

You can build libraries that try to hide the differences but the leaky abstraction is inherently still there.

Re: The Jank Language: LLVM Hosted Clojure

#37

See also babashka, a native Clojure implementation for scripting. https://github.com/babashka/babashka

An important difference is that afaik Babashka is an interpreter, so will be fairly slow. It's fast at starting . While this is LLVM JIT, so will compile the Clojure code to native code just-in-time, and then run the native code.

It also is not the entire Clojure language as far as I understand, some features are not supported because it's using the "Small Clojure Interpreter"

Re: The Jank Language: LLVM Hosted Clojure

#40
post #7

It's extremely interesting, but it has a to be noted that, even though the main page claims 100% compatibility with Clojure, the status page lowers the claim down to 42%, while the GitHub page states you can't even build it.

Everything on the landing page talks about jank's goals and aspirations. 100% Clojure compatibility is a big one. The progress page starts with this disclaimer:

> jank is under heavy development. It's safest to assume that any feature advertised is partially developed or in the planning stages. There is no sales pitch here; just a lot of work and some big plans. All development happens on Github, so watch the repo there!

Post reply on HN