arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1112.4106cs.PL
收藏

JavaScript的从属类型

Dependent Types for JavaScript

Ravi Chugh, David Herman, Ranjit Jhala

摘要:

我们提出依赖JavaScript(DJS),一个静态类型的方言的命令式,面向对象,动态语言。DJS支持特别具有挑战性的功能,例如运行时类型测试,高阶函数,可扩展对象,原型继承,以及通过嵌套细化类型,堆的强更新和堆展开的组合来精确跟踪原型层次结构的数组。通过我们的DJS实现,我们证明了类型系统具有足够的表达能力,可以从几个来源的小示例中找到各种棘手的习惯用法,包括流行的书籍JavaScript:The Good Parts和SunSpider基准套件。

英文摘要:

We present Dependent JavaScript (DJS), a statically-typed dialect of the imperative, object-oriented, dynamic language. DJS supports the particularly challenging features such as run-time type-tests, higher-order functions, extensible objects, prototype inheritance, and arrays through a combination of nested refinement types, strong updates to the heap, and heap unrolling to precisely track prototype hierarchies. With our implementation of DJS, we demonstrate that the type system is expressive enough to reason about a variety of tricky idioms found in small examples drawn from several sources, including the popular book JavaScript: The Good Parts and the SunSpider benchmark suite.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑