A ZIP-style Prolog VM for trilog
A new project, zipc, is building a Prolog virtual machine (VM) in C based on a classic 1984 design. This deep dive into VM architecture aims to significantly boost the performance of the trilog Prolog interpreter. It's a fascinating look at how foundational computer science principles can be resurrected for modern optimization challenges.
The Lowdown
The zipc project is an ambitious work-in-progress to create a Prolog virtual machine, implemented in C, that adheres to the specifications of the "ZIP" abstract machine. This ZIP design, originating from Clocksin's 1984 seminal work, is being revived to potentially serve as a high-performance backend for the trilog Prolog interpreter.
zipcis designed as a standalone, faster Prolog compilable runtime, with the primary objective of outperformingtrilog's current runtime.- The expectation is that compiling Prolog clauses to the ZIP VM will result in fewer instructions and reduced memory consumption, directly addressing
trilog's performance goals. - The system comprises two main components: a compiler, written in Prolog and running on Scryer Prolog, that generates a binary image; and a C-based VM that loads and executes this binary.
Ultimately, zipc represents an effort to leverage established, efficient VM architectures to enhance the speed and memory footprint of modern Prolog execution environments, specifically targeting the trilog project.