arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1504.08110cs.PL
收藏

TreatJS:JavaScript的高阶合同

TreatJS: Higher-Order Contracts for JavaScript

Matthias Keil, Peter Thiemann

摘要:

TreatJS是一种语言嵌入式的,高阶的契约系统,用于JavaScript,它通过运行时监控来执行契约。除了为构建高阶契约提供标准抽象之外,(基础,函数和对象契约),TreatJS的新贡献是它保证了不干涉契约执行,它的系统方法来分配责任,它支持联合和交叉类型的契约,以及它的参数化契约范围的概念,它是用于概括依赖函数契约的可组合运行时生成契约的构建块。TreatJS是作为一个库实现的,因此可以使用完整的JavaScript语言指定合约的所有方面。该库依赖于JavaScript代理来保证合约的完全插入。它进一步利用JavaScript的反射特性在沙箱环境中运行合约,这保证了合约代码的执行不会修改应用程序状态。不需要在JavaScript运行时系统中进行源代码转换或更改。合约对执行速度的影响使用Google Octane基准进行评估。

英文摘要:

TreatJS is a language embedded, higher-order contract system for JavaScript which enforces contracts by run-time monitoring. Beyond providing the standard abstractions for building higher-order contracts (base, function, and object contracts), TreatJS's novel contributions are its guarantee of non-interfering contract execution, its systematic approach to blame assignment, its support for contracts in the style of union and intersection types, and its notion of a parameterized contract scope, which is the building block for composable run-time generated contracts that generalize dependent function contracts. TreatJS is implemented as a library so that all aspects of a contract can be specified using the full JavaScript language. The library relies on JavaScript proxies to guarantee full interposition for contracts. It further exploits JavaScript's reflective features to run contracts in a sandbox environment, which guarantees that the execution of contract code does not modify the application state. No source code transformation or change in the JavaScript run-time system is required. The impact of contracts on execution speed is evaluated using the Google Octane benchmark.

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

↑