Native Clojure

Hand-crafted compiler

Unprecedented C++ interop

jank is Clojure on top of C++. It has C++ interop unlike any other language. Templates, virtual functions, exceptions, overload resolution, and RAII all just work in jank. No boilerplate necessary. Just include your headers and go!

jank is a robust Clojure dialect. It offers interactive REPL-driven development powered by a Clang-based C++ JIT compiler.

(ns my.app.filesystem
  (:include "boost/filesystem.hpp")
  (:refer-global :rename {boost.filesystem.file_size file-size}))

(defn file-info [file-path]
  (try
    (let [bytes (file-size (cpp/cast std.string file-path))]
      {:path file-path
       :size bytes})
    (catch boost.filesystem.filesystem_error e
      {:path file-path
       :error (.what e)})))

(file-info "/etc/passwd")
; {:path "/etc/passwd", :size 4025}

(file-info "/root/.bash_history")
; {:path "/root/.bash_history"
;  :error "boost::filesystem::file_size: Permission denied [system:13]: \"/root/.bash_history\""}

jank builds upon Clojure

Keep your existing code; unlock the native world.

jank is Clojure

jank is a full-on Clojure dialect, with C++ interop instead of Java interop. There's a :jank reader conditional for when you need it.

jank is C++

jank can include any C++ source, link to any C or C++ library, and it uses the C++ type system. jank even compiles to C++!

Cargo-inspired tooling

jank uses Leiningen-based project management and has a rich native build system. It's easy to add C and C++ dependencies to your project.

REPL and native JIT compiler

Use your favorite nREPL editor plugin. jank contains an LLVM-based JIT runtime to compile C++ code on the fly.

jank's error messages are beautiful

Find your mistakes more easily and look good while doing it.

Trace your code through macros

jank's compiler will provide macro usage context and can re-trace source information to ensure you always get the best error possible.

Reimagined C++ errors

jank improves upon traditional Clang/GCC error messages for C++ interop, so writing C++ from jank feels even better than just writing normal C++.

jank's sponsors

These organizations are investing in jank's future. You can help out, too! See here.

Try jank today!

You've made it this far. Why not dive in?