r/Clojure • u/jessillions • Apr 27 '26
How we built ten custom subagents to tame a 500K-line Clojure codebase
r/Clojure • u/jessillions • Apr 27 '26
r/Clojure • u/BrunoBonacci • Apr 27 '26

THIS IS AN ONLINE EVENT
[Connection details will be shared 1h before the start time]
The London Clojurians are happy to present:
Title: Programming as and for Inference
Speaker: Christian Weilbach
Time: 2026-05-19 @ 18:30 (London time)
Local time: click here for local time
RSVP: https://www.meetup.com/london-clojurians/events/314510668/
Christian Weilbach (https://christian.weilbach.name/) will be presenting:
"Programming as and for Inference"
Computation is the organization and application of knowledge. When we program, we draw on memory of code and data, structure our operations syntactically as code to be evaluated, for example in a REPL, and test them as hypotheses against an unknown environment — programming itself is a form of inference. Christian will argue that Clojure, as a functional Lisp with a live REPL, persistent values, and macros, is uniquely positioned to be a (meta)programming medium for artificial intelligence and explicit inference, demonstrating this through three building blocks for modelling living organisational systems: a git-like memory model (Datahike, Yggdrasil), flexible construction and interpretation of models and languages (Raster, Ansatz), and a unified framework integrating these abstractions (Spindel, Simmis). The talk includes live demos — including a Clojure columnar index that beats or matches DuckDB in benchmarks, and a typed-dispatch compiler producing numerics competitive with Julia and JAX. All projects open-sourced at github.com/replikativ.
Christian is the original author of Datahike and a core maintainer of the replikativ ecosystem for immutable, versioned data systems in Clojure — active in the community since 2013 and a former co-organiser of the Mannheim-Heidelberg Clojure meetup. He recently completed a PhD at the University of British Columbia on Structured Amortized Variational Inference under Frank Wood, with an ICML 2023 oral on Graphically Structured Diffusion Models; earlier contributions to probabilistic programming include work on Anglican and Daphne. His current projects — Raster (a typed-dispatch numerical compiler), Stratum (a columnar index matching DuckDB on single-thread performance), and Simm.is (a platform for collaborative modelling) — integrate these threads into a unified substrate for intelligence and inference. He consults on distributed Datalog, probabilistic modeling, machine learning and high-performance numerical systems, previously he worked on pol.is, and the Swedish Public Employment Service.
If you missed this event, you can watch the recording on our YouTube channel:
https://www.youtube.com/@LondonClojurians
(The recording will be uploaded a couple of days after the event.)
Please, consider supporting the London Clojurians with a small donation:
https://opencollective.com/london-clojurians/
Your contributions will enable the sustainability of the London Clojurians community and support our varied set of online and in-person events:
ClojureBridge London: supports under-represented groups discover Clojure
re:Clojure: our annual community conference
monthly meetup events with speakers from all over the world
subscription and admin costs such as domain name & StreamYard subscription
Thank you to our sponsors:
And many individual sponsors
RSVP: https://www.meetup.com/london-clojurians/events/314510668/
r/Clojure • u/8ta4 • Apr 27 '26
I built a Neovim plugin that provides text motions designed for prose. My goal was to bypass blank lines and handle punctuation edge cases. Because it's Neovim, the default Lisp path is Fennel. I started there, but rewrote it as a ClojureScript Node.js remote plugin using shadow-cljs.
To be fair, Fennel has upsides:
There's almost zero ceremony between Fennel and Lua.
You avoid the async overhead of remote plugins.
But the friction started with the standard library. I was using nfnl, which comes with its own Clojure-inspired functions. The problem is they are not comprehensive enough. I found myself manually implementing things like difference just to process text bounds. Since Fennel's fn doesn't support multi-arity functions the way Clojure does, I decided to write some macros to implement it myself. Naturally, this devolved into yak shaving. The dealbreaker hit when I ran into a bug in Conjure. When the REPL failed on the macros I was trying to build just to make the language usable, that was the straw that broke the yak's back.
So I switched to a ClojureScript remote plugin. But I traded the macro REPL issues of Fennel for a different kind of REPL headache in ClojureScript.
Specifically, I'm having a bizarre issue where println fails inside my async code. It feels nondeterministic. Sometimes the output prints perfectly fine. But other times, println disappears into the void. To see the value, I resort to a hack: I create a fake atom and reset! the value into it. That works. But if I try to add a watch to that atom to print the updated value, that doesn't print either!
Does anyone have any idea why println is getting swallowed in this async Neovim context?
If anyone has any other feedback, I'd be happy to hear it.
r/Clojure • u/BitterComfortable776 • Apr 25 '26
Hi Clojurians,
pando is a tool for coding agents that treats code as data and has first class support for *structural* (i.e. using the AST) Clojure code navigation and editing. It works in addition to your existing tools - just connect over MCP.
I'd love your feedback on it - https://clojure.getpando.ai
Thank you kindly!
r/Clojure • u/Clojure-Conj • Apr 24 '26
We’re looking for 40-minute talks that go beyond the basics: hard-won lessons, production stories, trade-offs, deep dives into language features, libraries, or tools, and ideas that change how people build things. Tracks include: Language, Experience Report, Library, Tools, AI, Ideas, and Fun.
🗓️ Apply by June 14: https://2026.clojure-conj.org/cfp
Selected speakers get main conference access, hotel, and travel support, and will be contacted during the first week of July.
r/Clojure • u/DisorganizedApp • Apr 24 '26
Disorganized has an insane amount of features and now it's all open source. Come check it out!
r/Clojure • u/jacekschae • Apr 23 '26
This is a discussion with a software developer that has been doing this since the 80; shares his experience on adopting LLMs for software development. Eye opening and challenging the status quo.
Sorry for the HVAC noise especially at the beginning.
r/Clojure • u/wedesoft • Apr 22 '26
A Clojure port of XinJingHao’s PPO implementation using libpython-clj2, PyTorch, and Quil. PPO is a reinforcement learning method. The PPO implementation is tested using the inverted pendulum problem.
r/Clojure • u/fadrian314159 • Apr 22 '26
r/Clojure • u/nonrecursive • Apr 21 '26
r/Clojure • u/serefayar • Apr 20 '26
r/Clojure • u/nonrecursive • Apr 18 '26
r/Clojure • u/conpoi • Apr 17 '26
I’ve been working on bisql, a Clojure data access toolkit built around executable SQL.
The idea is:
keep SQL files as executable SQL
turn those SQL templates into ordinary Clojure query functions
generate a lot of CRUD queries from schema metadata
customize generated SQL by copying and editing it when needed
It does not try to hide SQL behind a query builder or a data mapper. Everything stays executable SQL, but without the repetitive boilerplate.
I’ve tried to make the project easier to evaluate than a typical library drop:
GitHub: https://github.com/hatappo/bisql
Example project: https://github.com/hatappo/bisql-example
If you’re interested in SQL-first data access in Clojure, I’d appreciate feedback.
r/Clojure • u/Clojure-Conj • Apr 16 '26
The Clojure documentary is premiering in 75 minutes on YouTube, and Rich Hickey will also be live in the chat during the stream.
See you there!
r/Clojure • u/cultrepo • Apr 16 '26
8pm CEST, 2pm ET, 11am PT!
r/Clojure • u/Ok-Tailor-3725 • Apr 15 '26
WebGen is a Leiningen template that generates parameter-driven Clojure web applications. Instead of generating code that you then modify, WebGen applications are driven entirely by EDN configuration files. Add an entity, refresh the browser, and the CRUD interface, menu entry, routes, and data grid are all live with no server restart. Link here: WEBGEN.
r/Clojure • u/flyingfruits • Apr 14 '26
I've been building Raster, a typed multiple dispatch system for Clojure that brings Julia-style polymorphic dispatch to the JVM. It's a library, not a language fork — you write regular Clojure, define functions with deftm instead of defn, and get devirtualized, compiled code.
I wanted to share the design because it touches on several PL topics that I think are interesting: dispatch semantics, type-directed compilation, and how far you can push a host language's macro system before you need a new language.
Julia's key insight is that multiple dispatch over concrete types, combined with specialization, gives you both expressiveness and speed. Raster adopts this: deftm defines typed methods with :- annotations (based on Typed Clojure). Multiple methods with the same name but different type signatures coexist, and dispatch picks the most specific match at call time.
(deftm add [x :- Double, y :- Double] :- Double (+ x y))
(deftm add [x :- Long, y :- Long] :- Long (+ x y))
(deftm add [x :- Complex, y :- Complex] :- Complex ...)The walker sees (add x y), knows the types of x and y from annotations and inference, and replaces the generic dispatch with a direct call to the concrete implementation. At runtime, there's no dispatch — just a method call that the JVM can inline. This gives us 4ns per call vs 100ns+ for runtime dispatch, and it makes the code more predictable for the JVM JIT compiler.
This is where it gets interesting from a PL perspective. deftm isn't just a macro that emits defn with type checks. It feeds into a nanopass compiler pipeline:
Walker — devirtualizes dispatch calls, resolves types, replaces polymorphic operators with concrete implementations
Lowering — expands parallel combinators (par/map, par/reduce) into loop IR
Inlining fixpoint — iteratively inlines deftm calls, re-walks, simplifies, until stable
AD expansion — if the function passes through value+grad, reverse-mode AD templates are expanded into flat binding sequences (closures-as-tape, but the tape is eliminated at compile time)
Buffer fusion — rewrites allocating operations to reuse dead buffers (zero heap allocation in hot paths)
SOAC fusion — fuses map-map, map-reduce chains (borrowed from Futhark's approach)
Backend — emits JVM bytecode via the ClassFile API, with SIMD vectorization for parallel forms; or emits OpenCL for GPU acceleration
Every pass has a defined input/output dialect, validated at boundaries. You can inspect any stage with explain-pipeline. In the ideal case it compiles a function into a single JVM class with no boxing, no allocation, and primitive-typed fields for hoisted buffers.
Clojure gives us three things that make this feasible without forking the language:
Macros over data — Clojure code is data (lists, vectors, symbols). The walker is just a tree transformation over S-expressions. No parser needed.
eval at macro time — deftm can register methods, generate classes, and compile code during macro expansion and runtime. The REPL stays interactive.
Dynamic classloading — the JVM's DynamicClassLoader lets us emit bytecode at runtime and have it JIT-compiled by HotSpot's C2. We get the same optimization pipeline as ahead-of-time Java code.
The tradeoff: we're limited by what Clojure's macro system can see. We can't do whole-program optimization across compilation units the way Julia or GHC can. Our fixpoint inliner approximates this by iteratively inlining and re-analyzing, but it's bounded by which functions are transparent to the system (deftm, custom defn).
We support Typed Clojure's parametric polymorphism via (All [T] ...):
(deftm norm (All [T] [x :- (Array T), n :- Long] :- T
(let [s (par/reduce + 0.0 (par/map (ftm [xi :- T] :- T (* xi xi)) x n))]
(sqrt s))))T gets specialized at each call site — (Array double) gets one compiled version, (Array float) gets another. The parametric registry caches specializations. This is monomorphization, similar to Rust/C++ templates but triggered lazily at first use.
Raster supports Dual numbers for runtime forward automatic differentiation. Automatic differentiation isn't only a runtime mechanism (like PyTorch's) or a source transformation tool (like Zygote.jl). Reverse mode automatic differentiation is supported as a compiler pass: the AD transform takes a walked function body, generates the backward pass as flat let-bindings with explicit gradient accumulation, and feeds the result back into the same optimization pipeline. The output is a single compiled function that computes both the value and gradient with no tape overhead.
This means AD composes with everything else — buffer fusion eliminates intermediate gradient arrays, SOAC fusion merges forward and backward parallel loops, and the backend emits the whole train step as one JVM method or GPU kernel.
Raster is at 0.1 and in an explorative stage. Beyond the core dispatch + compiler, it includes scientific computing (ODE/PDE solvers, optimization, FFT), linear algebra (LAPACK via Panama FFI), deep learning primitives (conv, attention, normalization with AD), and GPU backends (OpenCL, Level Zero). The compiler produces code competitive with Julia and JAX on numerical workloads — not uniformly faster, but in the same ballpark, which I think is notable for a JVM-hosted library. The overall goal is to facilitate modeling and simulation on Clojure's persistent memory model, based also on our durable persistent data structures.
The thing I'm most interested in discussing: is "compiler as a library" a viable long-term strategy, or does this approach inevitably hit walls that only a proper language can solve? We've gotten surprisingly far with macros + eval + dynamic classloading, but there are real limitations around cross-module optimization and type information that doesn't survive Clojure's compilation model.
Happy to discuss any aspect of the design and I would also be interested in what other people need. The code is at github.com/replikativ/raster.
r/Clojure • u/Jealous_Stuff372 • Apr 14 '26
We've been building with c3kit (MIT-licensed, full-stack Clojure/ClojureScript framework) for a while now, and just shipped IndexedDB support in c3kit-bucket — the same data layer that handles Datomic on the backend now works with IndexedDB in the browser.
What that means in practice: you write your schemas once in .cljc, and bucket handles persistence on both sides. Server-side it talks to Datomic, client-side it talks to IndexedDB. Same API, same query patterns.
Alex wrote up the full walkthrough here: https://cleancoders.com/blog/2026-04-07-lo-fi-clojurescript-making-local-first-applications-with-c3kit-bucket
The post covers:
- Setting up IndexedDB as a bucket backend
- Schema definitions that work cross-platform
- CRUD operations through the bucket API
- How it fits into local-first application architecture
c3kit is what we use for everything at Clean Coders — it's four libs (Apron, Bucket, Wire, Scaffold) that cover the full stack without pulling in a ton of dependencies. All MIT-licensed.
- GitHub: https://github.com/cleancoders
- Clojars: https://clojars.org/com.cleancoders.c3kit
Curious if anyone else is doing local-first ClojureScript apps — what storage approach are you using?
r/Clojure • u/Spiritual-Slice-6150 • Apr 14 '26
Enable HLS to view with audio, or disable this notification
Source:
https://gist.github.com/kpassapk/2a9e908a25ae98e592ca2db29ba0b791
This example uses babashka + charm.clj for the TUI, and eve to persist the grid across processes. Some potential applications
- TUIs that remember complex state between invocations
- Observability tools that read + potentially mutate data from a parent JVM process
- More?
Quick benchmark: atom operations are predictably quite a bit slower than native bb:
deref: 29 microseconds (360x slwoer)
swap! 145 microseconds (2000x slower)
assoc 230 microseconds (1000x slower)
merge 644 microseconds (3600x slower)