An Exceptionally Janky Tale
summary
Jank is a Clojure dialect compiled to LLVM with C++ interop that implements throw/try/catch/finally by adding new AST expression types, doing semantic analysis into expression structs, and generating C++ as strings for JIT or file compilation. Eval uses an interpreted path; codegen emits C++ try/catch and uses a scope-exit destructor pattern to emulate finally. Exception throwing is on the cold path with near-zero overhead when not thrown. Current status: 90–95% syntax parity with Clojure JVM, runs about 40% of clojure.core but lacks packaging and polish.
AI-written summary · about
chapters (17)
- 0:00Introduction to Jank
- 2:10Metaphorical story about exceptions
- 3:17Compilation phases overview
- 5:04Implementing throw in semantic analysis
- 7:57Evaluating and code generating throw
- 10:47Demo of throw in generated code
- 11:11Introducing try with metaphor
- 12:15Implementing try expression
- 15:43Code generation for try
- 17:29Demo of try in generated code
- 18:13Introducing catch with metaphor
- 19:16Exception handling insights
- 22:03Performance of exceptions in C++
- 26:59Exception-based vs error-based code
- 27:41Metaphorical resolution
- 28:01Jank status and future plans
- 30:31Announcement of full-time work on Jank
related talks
31m"How to build a Clojure dialect"
19mReusing Just-in-Time Compiled Code
30mAn Incremental Approach to JIT Construction
52mImplementing a Simple JVM in Rust
01h 04mClojure Compilation, Backwards
37mTCO
30mHow Clojure Works: Understanding the Clojure Runtime
29mExceptions all Over the Shop: Modular, Customizable, Language-independent Exceptio...
