酒窖里的Lisp:楼上住着的依赖类型 [pdf]
The Lisp in the Cellar: Dependent types that live upstairs [pdf]

原始链接: https://zenodo.org/records/15424968

依赖类型提供了一种让程序员编写计算类型代码的方式。类型级别的计算反过来可能依赖于值,从而允许各种强大的编程模式。此外,即使类型表现出丰富的动态语义,类型检查仍然是一个纯粹的编译时操作。本文提出的Deputy系统是一个Clojure托管的依赖类型编程语言,具有归纳数据类型。它作为一个实验工具,用于探索基于Lisp的REPL驱动的交互式开发工作流的影响,不仅在编程过程中,而且在类型检查过程中。因此,该系统被开发为一个Clojure库,这意味着在类型级别“编程”时,宿主语言仍然可用。

Hacker News 正在讨论一篇论文《地窖里的Lisp:楼上住着的依赖类型》(The Lisp in the Cellar: Dependent types that live upstairs),这篇论文关注的是使用“Deputy”在 Clojure 中实现依赖类型。依赖类型允许类型依赖于值,这对像 Lisp 这样的语言来说是一个挑战,因为在 Lisp 中重新定义顶层值是很常见的。 讨论围绕着重新定义如何影响类型检查展开,尤其是在随后的定义依赖于较早的值时。可能的解决方案包括变量遮蔽或在重新定义时重新检查所有相关的项。一位评论者建议采用一种基于事务的方法,类似于 Smalltalk,其中更改被捆绑在一起并在应用之前进行类型检查。 讨论还涉及到 Lisp 与 AI 的历史渊源,强调了它在 DSL 开发、模式匹配和数学符号方面的优势。文中提到了欧洲 Lisp 研讨会以及过去使用 Lisp 的 AI 编程范式。

原文

Dependent types provide a way for programmers to write code that computes types. Type-level computations in turn may depend on values, allowing various powerful programming patterns. Moreover, even though types exhibit a rich dynamic semantics, type-checking remains a  purely compile-time operation.

The Deputy system presented in this paper is a Clojure-hosted dependently-typed programming language, featuring inductive datatypes. It serves as an experimental vehicle to explore the implications of the Lisp-based REPL-driven interactive development workflow, not only while programming but also during type checking. The system is thus developed as a Clojure library, which means that the host language is still available while "programming" at the type-level.

联系我们 contact @ memedata.com