Technomancy released Clojure Fennel persistent data structures for Fennel on April 11, 2026. The GitHub repository at github.com/technomancy/fennel-persistent provides immutable vectors, maps, and lists with structural sharing for Lua applications.
Persistent Data Structures Defined
Persistent data structures retain prior versions after updates. Unchanged nodes share structure between versions, per Fennel documentation at fennel.org.
Clojure implements vectors as 32-ary branching tries. The Fennel port uses Lua tables and copies only the root-to-leaf path on updates, repository source code states.
Repository documentation states a 1,000-element vector uses under 10 KB after 100 updates. Mutable Lua arrays require more memory.
Implementation in Fennel
Fennel compiles to Lua bytecode. The library uses Lua userdata for persistent-vector. Developers call (persistent-vector 1 2 3]) to create vectors.
Functions conj and assoc return new versions. The repository includes 50 test cases verifying immutability.
Fennel 1.2.0 includes the library. Users install via luarocks install fennel-persistent. LuaJIT benchmarks appear in the repository.
Roots in Clojure
Rich Hickey created Clojure's persistent structures in 2007. The Fennel version suits Lua VMs. Immutability supports concurrency without locks, Clojure documentation states.
Usage Examples
Vector example in Fennel:
```fennel (local pvec (require :persistent-vector)) (local v1 (pvec.new 1 2 3])) (local v2 (pvec.conj v1 4)) (print v1) ; 1 2 3] (print v2) ; 1 2 3 4] ```
Lua profiler in repository shows v1 and v2 share 90% of nodes.
Map example:
```fennel (local pmap (require :persistent-map)) (local m1 (pmap.new {:btc 73014 :eth 2248})) ; USD, April 11, 2026 (local m2 (pmap.assoc m1 :xrp 1.36)) (print m1) ; unchanged (print m2) ; adds :xrp ```
Source comments state updates take O(log n) time, n as structure size.
Benchmarks
Repository tests on Apple M1 Mac, LuaJIT 2.1, measured 1 million updates. Persistent vectors averaged 2.1 microseconds per operation. Mutable Lua tables averaged 1.8 microseconds.
Node.js persistent libraries averaged 4.5 microseconds. Tests ran on macOS 14.4; details at github.com/technomancy/fennel-persistent/perf.
Perf README states persistent structures use 15% less memory than mutable options after 10,000 updates.
Applications in Finance
Fintech order books use persistent maps. New trade versions share 99% structure with priors, repository examples state.
Blockchain nodes with Lua use persistent queues for transactions. Redis Lua scripts maintain immutable states for audits.
Risk management Monte Carlo simulations build iterations on prior data without full copies, GitHub issue #8 notes.
Lua's footprint fits AWS Lambda microservices for Fennel state management.
Ecosystem Integration
Fennel integrates with LÖVE for game states and Neovim plugins for edit histories. Vim.org lists three extensions as of April 11, 2026.
Lua in Redis supports persistent queues.
Outlook
GitHub issues #12 and #15 outline persistent sets and queues. Repository reached 200 stars on April 11, 2026.
LuaDist.org reports Lua distributions grew 15% yearly through 2025. Clojure Fennel persistent data structures target finance and technology.
