← Wed, Nov 11 digest

A ZIP-style Prolog VM for trilog

read article ↗ hn thread ↗

zipc is a new C-based virtual machine and Prolog compiler implementing Clocksin's 1984 ZIP architecture to improve performance over the trilog runtime.

summary is enough The short project description introduces a niche VM implementation, while the comment thread provides a broader discussion on Prolog and Datalog's modern relevance.

summary

The author introduces zipc, a C-based virtual machine and Prolog compiler modeled after Clocksin's 1984 ZIP abstract machine. Built using Scryer Prolog, the project aims to serve as a faster backend or replacement for the trilog runtime, which currently uses an ABC algorithm interpreter. By compiling Prolog clauses into binary images for a low-level VM, the project seeks to reduce instruction counts and memory overhead. The comment section naturally shifts into a broader discussion about the modern utility of logic programming and Datalog.

key points

  1. zipc implements the ZIP abstract machine from Clocksin's 1984 book in C to explore performance improvements over trilog.
  2. The compiler is written in Prolog and runs on Scryer Prolog, outputting binary images for the C-based VM.
  3. The project aims to replace trilog's ABC algorithm interpreter to achieve lower memory usage and fewer instruction cycles.

who should read it

Prolog developers and language implementers interested in virtual machine design and logic programming.

discussion positive

consensus

Commenters discuss the modern utility of logic programming, noting that while full Prolog is largely academic, its subset Datalog has prominent practical applications like Rust's borrow checker.

pushback

A couple of commenters debate the precise semantic and execution boundaries separating Datalog from full Prolog.

best comment by AlotOfReading ↗

Datalog (i.e. prolog without function symbols) still has a lot of practical applications for as a relational language and for logic programming. The polonius borrowchecker for rust originated as a datalog program, for example.

It highlights concrete real-world adoption of logic programming via Datalog in Rust's Polonius borrow checker.

Generated by an LLM from the article and thread. Check the sources before relying on it.