ALL INTELLIGENCE
Hacker News AIT2·Open Source

zipc Compiles Prolog Clauses to a ZIP Virtual Machine in C

Original title: A ZIP-style Prolog VM for trilog
42AI Score

zipc is a Prolog-written compiler running on Scryer Prolog that emits a binary image executed by a C-implemented ZIP virtual machine. ZIP derives from Clocksin's 1984 sequential Prolog abstract machine, and the goal is fewer instructions and less memory for the same programs, potentially becoming trilog's backend if the MVP succeeds.

Full Report

zipc (working title)

The goal of the project is to scaffold the VM to a degree where I can compare it with the current trilog runtime.

A compiler from Prolog to the ZIP virtual machine, and the VM itself, in C. ZIP is the abstract machine from Clocksin's Design and Simulation of a Sequential Prolog Machine (1984); the papers are in doc/.

zipc is meant to become the backend of trilog if the MVP succeeds, or just stay as a faster separate Prolog compilable runtime, I am not really sure yet. Either way, trilog interprets clauses as terms with the ABC algorithm, and compiling them to ZIP should make the same programs run in fewer instructions and less memory, which should help with trilog's main target.

The compiler is written in Prolog and runs on Scryer Prolog. It writes a binary image, which the VM in src/ loads and runs.