November 29th, 2024

jank is now running on LLVM IR

Jank has transitioned to LLVM IR, improving performance and reducing clojure.core compilation time from 12 seconds to 150 milliseconds, though initial runtime may decline due to manual optimizations needed.

Read original articleLink Icon
jank is now running on LLVM IR

Jank, a programming language project, has recently transitioned to using LLVM IR for code generation, significantly enhancing its performance and functionality. Over the past few months, the focus has been on developing LLVM IR generation, improving semantic analysis, and refining the module loading system. As of January 2025, the project's lead developer, Jeaye Wilkerson, will be working on Jank full-time, supported by sponsors. The transition to LLVM IR has resolved previous issues with slow startup times, reducing the compilation time for clojure.core from 12 seconds to just 2 seconds, and further down to 150 milliseconds when using object files. However, initial runtime performance may be negatively impacted as the new IR generation requires manual optimization that was previously handled by the C++ compiler. Additionally, the build system has been improved by removing vcpkg, addressing various dependency issues, and eliminating pre-compiled headers to streamline the compilation process. Community contributions have also advanced Jank's capabilities, including Unicode support and improved interoperability with C and C++ libraries. Looking ahead, the next steps involve finalizing LLVM IR generation for try nodes and enhancing error reporting to provide clearer feedback to developers.

- Jank has transitioned to LLVM IR for improved performance and functionality.

- Startup time for compiling clojure.core has been reduced from 12 seconds to 150 milliseconds.

- Initial runtime performance may decline due to the need for manual optimizations.

- The build system has been streamlined by removing vcpkg and pre-compiled headers.

- Community contributions have enhanced Jank's Unicode support and interoperability with C/C++ libraries.

Link Icon 5 comments
By @gorjusborg - 4 months
Congratulations on the achievement!

Ever since I got into Clojure I have wanted what you are building. I love the language, I love the collections, but I don't love waiting for program startup.

I can't wait until Jank is complete!

In fact, how can we help at the moment?

By @jarjoura - 4 months
Clojure is a quirky language, and I really enjoyed writing a proof-of-concept microservice with it back in 2015-era when everyone was shouting "Scala is the way!" I was able to prototype with it and stand it up in a weekend. With the tiniest bit of code, I had the exact service I needed. It ended up in production after only spending a couple weeks, most of which was spent wrapping my head around Docker and Mesos that we used to run the .jar.

However, it's a quirky language. So, my quick take, as a glue layer on top of the JVM, it was quite powerful, but jank has me scratching my head. LISP doesn't really read well the bigger the codebase, and as something to write software in standalone environment, it makes me a bit hesitant.

I sometimes would hit walls, because in real world software, you need persistent state. Functional software, for obvious reasons, fights against that, and so modeling state is actually quite difficult. This is where I think, as a small layer on top, it's fast and effective. I would just not want to write more than a few files with it though. Happy to follow along this project though and see where it goes.

By @bobnamob - 4 months
Hi Jeaye, love what you and the other contributors are doing with jank. The further proliferation of clojure dialects can't happen quickly enough imo.

Do you have any "killer app" style use cases in mind for jank? Babashka is great in CLI/FaaS settings, native Clojure is great for "situated" programs that can afford a JVM startup and some memory overhead

Which settings are you particularly excited to use jank in?

By @chr15m - 4 months
Didn't get to meet you at HoC but I wanted to say thank you for working on jank. It's going to bring Clojure into so many new places typically reserved for compile-to-binary languages. Awesome work!
By @nathants - 4 months
awesome stuff. keep it up!