[附注] Rust 也是元语言

用 Rust 实现 [定义] 项的集合 的项和 [定义] 一步归约 的运行规则时,Rust 充当 [定义] 对象语言与元语言 中的元语言:Rust 的 enum Term enum Term 描述对象语言的项,Rust 的函数描述对象语言的运行。不要把 Rust 自己的类型( bool bool 、 Option Option )和 [定义] 类型与类型判断 中的对象语言类型(Bool、Nat)混为一谈,它们分属两层。实现示例见 Rust 求值器 与 Rust 类型检查器 。

References

[定义] 类型与类型判断 [types-and-typing-judgments]

[定义] 一步归约 [one-step-reduction]

[定义] 对象语言与元语言 [object-language-and-metalanguage]

[定义] 项的集合 [set-of-terms]

[] 确定性:从推导归纳到求值器 [determinism]

[] 规则与算法:可靠性与完备性 [rules-and-algorithms]

Backlinks

Based on Typsite