20 Years of Pyrolog
CF Bolz reflects on the 20-year history of Pyrolog, an RPython-based Prolog implementation that drove key architectural advancements in the PyPy meta-JIT and inspired subsequent language runtimes.
read it VM and compiler engineers will appreciate this deep technical post-mortem on how building a niche logic language pushed the boundaries of RPython's tracing JIT.
summary
Carl Friedrich Bolz-Tereick provides a 20-year retrospective on Pyrolog, an experimental Prolog interpreter written in RPython. Initially created for constraint programming, the project evolved through multiple architectures, shifting from exception-based backtracking to a flat, heap-allocated continuation model. Although Pyrolog lacked real-world users, its unique execution requirements forced the RPython meta-JIT to support non-imperative control flows. These architectural breakthroughs directly shaped downstream language runtimes like Pycket and Effekt.
key points
- Pyrolog's final architecture used reified success and failure continuations on the heap, eliminating host stack usage to make loops traceable by the RPython JIT.
- Unpredictable backtracking caused severe performance cliffs due to excessive heap allocations, illustrating limits of trace-based JITs for logic languages.
- Architectural insights from Pyrolog directly influenced other RPython projects, including the PyPy meta-JIT, the Pycket Racket runtime, and an Effekt JIT implementation.
who should read it
Compiler engineers, language implementers, and developers interested in VM design and the history of the PyPy ecosystem.
discussion warm
consensus
Commenters express appreciation for the retrospective and note that seemingly niche research projects often yield foundational architectural benefits for core tools like RPython.
Thank you everyone who contributed for all your work on Pyrolog, and I hope that, as hinted in the article, progress resumes at one point!
There is one more recent Python-based Prolog implementation called Clausal Prolog:
https://clausal.pl
It could be very interesting to discuss different Python-based implementation approaches with the author, and I hope this may be an interesting area for future work benefiting all involved systems.
The commenter thanks the contributors and points to a newer Python-based Prolog implementation for potential cross-pollination.
Generated by an LLM from the article and thread. Check the sources before relying on it.