Wren: A Fast Logic Programming eDSL With Host Language Garbage Collection
summary
Wren is a Scala LP eDSL that reworks term representation and execution to piggyback on host language garbage collection, using typed terms/goals so unification is opt‑in and allowing nondeterministic construction of native objects. Implementation uses a weak‑reference trail for backtracking and replaces allocation-heavy streams with iterators over streams to cut temporary allocations. Evaluation across the largest miniKanren-style benchmark suite shows up to three orders of magnitude speedups versus the fastest LP eDSL and occasional wins over SWI‑Prolog, plus much lower heap usage.
AI-written summary · about
chapters (12)
- 0:00Wren introduction
- 1:05Embedding logic programming
- 3:54MiniKanren challenges
- 4:14Typed terms interface
- 9:51Memory retention in unification
- 11:56Backtracking with weak refs
- 14:25GC for unused variables
- 16:11Optimizing with iterators
- 17:55Term interconversion
- 19:01Benchmarking Wren
- 25:28Future directions
- 26:14Q&A
