Pyrolog 二十年
来源:pypy.org — 2026-11
📋 概述
2006 年 11 月 12 日,作者把用 RPython 写的 Prolog 实现 Pyrolog 第一次提交进 PyPy 仓库。它源起于欧盟项目里承诺的约束编程工作,作者为此读了 Clocksin & Mellish 和《The Art of Prolog》,并在 Louvain-la-Neuve 的 sprint 上受到 Gecode 团队影响。二十年后他写这篇回顾:Pyrolog 从未有过真正的用户,却催生了一些有意思的研究,并影响了好几个 RPython 项目。
🔑 核心要点
- 第一版用面向对象的 RPython 实现合一,逻辑变量存索引,绑定放在全局数组里。
- 选择点靠解释器层异常实现,回溯靠抛异常,成功续延放在堆上——思路取自 BinProlog。
- 深层递归依靠 RPython 的 stackless 变换把宿主栈搬到堆上。
- 项目虽无用户,但为后续 RPython 研究与其他实现提供了基础。
💡 金句
Pyrolog never had any real users, but it still led to some interesting research and influenced a number of other RPython projects.
👍 0
👎 0
← 返回 Hacker News 首页