Language Showcase: jank
jank is a Clojure dialect on LLVM with gradual typing, a native runtime, and C++ interop.
jank is an upcoming Clojure dialect, made by Jeaye Wilkerson, aimed at merging the worlds of native programming and interactive, REPL-based functional programming. It features a gradual, structured type system, along the lines of malli. Its JIT is built on LLVM, via C++, and jank’s interop provides access to native C++ libraries.
Thanks for reading Compiler Spotlight! Subscribe for free to receive new language showcases in your inbox weekly.
How would you describe jank to the average programmer?
First try: Clojure meets TypeScript meets C++.
The average programmer may not know Clojure, so a second try might be: A functional-first lisp with a standard library built around immutable data structures which allows your code to begin dynamically typed and then become statically typed as you add type annotations. jank is compiled to native code and can interop with C++ directly.
Which problems is jank trying to solve?
Clojure is superb at transforming data in a purely functional way, but its dynamic type system can make some forms of development challenging (type-rich APIs, fearless refactors, excellent in-editor tooling). Furthermore, Clojure is generally hosted in a very dynamic environment, such as the JVM, CLR, or a JS engine, which is prohibitive when it comes to accessing native libraries, minimizing start time, and working on software like games. jank tries to bridge each of these gaps.
What are some of the toughest challenges with building jank?
Firstly, it turns out trying to make a fully dynamic language, including REPL support, work in native code is not easy. LLVM’s JIT support and, in particular, Cling, make this at least possible.
Secondly, jank is trying to be an excellent dynamic language and an excellent static language. Generally building one is hard enough.
Where can people learn more?
The website is here: https://jank-lang.org
You can sponsor development here: https://github.com/sponsors/jeaye
Implement a program which takes in a single string from stdin containing a basic arithmetic expression, such as “1 + 2 - 5”, evaluate it, and print the result.