一个用于 trilog 的 ZIP 风格 Prolog 虚拟机
A ZIP-style Prolog VM for trilog

原始链接: https://github.com/no382001/zipc

这个项目的目标是将虚拟机搭建到可以与当前 trilog 运行时进行比较的程度。它包含一个从 Prolog 到 ZIP 虚拟机的编译器,以及用 C 编写的 VM 本身。ZIP 是 Clocksin《Design and Simulation of a Sequential Prolog Machine》(1984)中的抽象机;相关论文在 doc/ 目录中。zipc 的目的是如果 MVP 成功就成为 trilog 的后端,或者仅作为更快的独立可编译 Prolog 运行时,我还不太确定。无论如何,trilog 使用 ABC 算法将子句解释为项,将它们编译为 ZIP 应该使相同程序以更少的指令和更少的内存运行,这应该有助于 trilog 的主要目标。编译器用 Prolog 编写,运行在 Scryer Prolog 上。它写入一个二进制镜像,由 src/ 中的 VM 加载并运行。

Hacker News 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 trilog 的 ZIP 风格 Prolog 虚拟机 ( github.com/no382001 ) 3 分 by triska 1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

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.

联系我们 contact @ memedata.com