Sharing Analysis in the Pawns Compiler

Lee Naish
{"title":"Sharing Analysis in the Pawns Compiler","authors":"Lee Naish","doi":"arxiv-2409.02398","DOIUrl":null,"url":null,"abstract":"Pawns is a programming language under development that supports algebraic\ndata types, polymorphism, higher order functions and \"pure\" declarative\nprogramming. It also supports impure imperative features including destructive\nupdate of shared data structures via pointers, allowing significantly increased\nefficiency for some operations. A novelty of Pawns is that all impure \"effects\"\nmust be made obvious in the source code and they can be safely encapsulated in\npure functions in a way that is checked by the compiler. Execution of a pure\nfunction can perform destructive updates on data structures that are local to\nor eventually returned from the function without risking modification of the\ndata structures passed to the function. This paper describes the sharing\nanalysis which allows impurity to be encapsulated. Aspects of the analysis are\nsimilar to other published work, but in addition it handles explicit pointers\nand destructive update, higher order functions including closures and pre- and\npost-conditions concerning sharing for functions.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.02398","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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.
卒子编译器中的分析共享
Pawns 是一种正在开发中的编程语言,它支持代数数据类型、多态性、高阶函数和 "纯 "声明式编程。它还支持不纯命令式特性,包括通过指针对共享数据结构进行破坏性更新,从而大大提高了某些操作的效率。Pawns 的新颖之处在于,所有不纯 "效果 "必须在源代码中一目了然,并且可以通过编译器检查的方式安全地封装在纯函数中。纯函数的执行可以对函数的本地数据结构或最终返回的数据结构执行破坏性更新,而不必冒着修改传递给函数的数据结构的风险。本文介绍了允许封装杂质的共享分析。该分析的某些方面与其他已发表的工作相似,但它还处理了显式指针和破坏性更新、包括闭包在内的高阶函数以及有关函数共享的前置和后置条件。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信