Pawns 编译器中的共享分析
Sharing Analysis in the Pawns Compiler
AI总结:
本文提出 Pawns 编译器中的共享分析技术,通过处理显式指针、破坏性更新、高阶函数与闭包及共享前后置条件,使不纯效果可被安全封装在纯函数中。
摘要:
Pawns 是一种正在开发中的编程语言,支持代数数据类型、多态、高阶函数以及“纯”声明式编程。它还支持不纯的命令式特性,包括通过指针对共享数据结构进行破坏性更新,从而在某些操作上显著提高效率。Pawns 的一个新颖之处在于,所有不纯的“效果”必须在源代码中明确可见,并且它们可以以一种由编译器检查的方式安全地封装在纯函数中。纯函数的执行可以对函数局部持有或最终从函数返回的数据结构执行破坏性更新,而不会冒险修改传递给函数的数据结构。本文描述了允许封装不纯性的共享分析。该分析的某些方面与其他已发表的工作相似,但此外它还处理显式指针和破坏性更新、包括闭包在内的高阶函数,以及关于函数共享的前置条件和后置条件。
英文摘要:
Pawns is a programming language under development that supports algebraic data types, polymorphism, higher order functions and "pure" declarative programming. It also supports impure imperative features including destructive update of shared data structures via pointers, allowing significantly increased efficiency for some operations. A novelty of Pawns is that all impure "effects" must be made obvious in the source code and they can be safely encapsulated in pure functions in a way that is checked by the compiler. Execution of a pure function can perform destructive updates on data structures that are local to or eventually returned from the function without risking modification of the data structures passed to the function. This paper describes the sharing analysis which allows impurity to be encapsulated. Aspects of the analysis are similar to other published work, but in addition it handles explicit pointers and destructive update, higher order functions including closures and pre- and post-conditions concerning sharing for functions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。