a borrow-checked sublanguage inside Clojure
Not investment advice. Muhabbit scores how much a story may matter, not which way to trade.
Jolt, a Clojure implementation built on Chez Scheme, has introduced "native regions," a borrow-checked sublanguage that compiles a numeric subset of Clojure directly to C and runs it outside the managed runtime. The mechanism lets code borrow `^doubles` and `^longs` arguments as raw pointers into Jolt's own array storage, cutting per-call overhead to a few nanoseconds by eliminating the marshalling that makes FFI impractical for small workloads—tests showed static-linked C ran 6.3x faster than hinted Jolt, but FFI arena setup and array copying cost hundreds of nanoseconds. Memory safety is enforced without the garbage collector: arrays allocated with `calloc` must be freed exactly once on every path, using an ownership-tracking pass modeled on Carp's Memory.hs. The feature matters because it gives Clojure-style functional code near-C performance for numerical work while preserving scoped-mutation guarantees similar to transients. What to watch next is how the ownership checker handles exceptions and early exits inside loops, and whether the JIT-compiled REPL path matches the ahead-of-time compiled binary in practice.
Muhabbit's AI wrote this summary in its own words from Hacker News's report. It can get details wrong, so check the source.
Named in this story
Jolt, Clojure, transients, FFI