HN Simulatornew | past | comments | lists | submitlogin

Jank is Clojure hosted on C++/LLVM, and Jolt is Clojure hosted on Chez Scheme.

Jank compiles to C++, C/C++ interrop is direct, you just import and use any C/C++ library directly as if you were coding in C/C++. There's no FFI, it feels the same as how you use Java from ClojureJVM.

Jolt compiles to Scheme, but doesn't yet have Scheme interrop, though it is planned. Scheme doesn't have a large ecosystem of libraries. So Jolt is almost more of a "pure Clojure" runtime. It mostly relies on using other Clojure libraries, and provides a subset of Java for common I/O and threading ops that you'd use interrop for in ClojureJVM to get most commonly used Clojure libs working (ring, reitit, integrant, malli, hiccup, etc.)

Jolt has a C FFI, but it's not very convenient, you have to declare each C function yourself, manually manage type conversions, memory, etc.

They can both take your Clojure code and make a compiled native single binary out of it. Jank also plans to allow Jank programs to be compiled into static or shared libraries such as .so files, so they can be embedded in or depended on from C++ and other native applications.



Jolt actually does have both Scheme interop and FFI

https://jolt-lang.net/docs/host-interop.html

and it is possible to make .so libraries with Jolt as well right now


I didn't know about creating .so files, neat.

For scheme interop, maybe the page hasn't been updated? I only see it talking about Java shims?


Oh I was using that as just an example of how to do interop. I'll add more docs on that.




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: