卒子编程语言简介

Lee Naish
{"title":"卒子编程语言简介","authors":"Lee Naish","doi":"arxiv-2409.03152","DOIUrl":null,"url":null,"abstract":"Pawns is a programming language under development which supports pure\nfunctional programming (including algebraic data types, higher order\nprogramming and parametric polymorphism) and imperative programming (including\npointers, destructive update of shared data structures and global variables),\nintegrated so each can call the other and with purity checked by the compiler.\nFor pure functional code the programmer need not understand the representation\nof the data structures. For imperative code the representation must be\nunderstood and all effects and dependencies must be documented in the code. For\nexample, if a function may update one of its arguments, this must be declared\nin the function type signature and noted where the function is called. A single\nupdate operation may affect several variables due to sharing of representations\n(pointer aliasing). Pawns code requires all affected variables to be annotated\nwherever they may be updated and information about sharing to be declared.\nAnnotations are also required where IO or other global variables are used and\nthis must be declared in type signatures as well. Sharing analysis, performed\nby the compiler, is the key to many aspects of Pawns. It enables us to check\nthat all effects are made obvious in the source code, effects can be\nencapsulated inside a pure interface and effects can be used safely in the\npresence of polymorphism.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"A Brief Overview of the Pawns Programming Language\",\"authors\":\"Lee Naish\",\"doi\":\"arxiv-2409.03152\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Pawns is a programming language under development which supports pure\\nfunctional programming (including algebraic data types, higher order\\nprogramming and parametric polymorphism) and imperative programming (including\\npointers, destructive update of shared data structures and global variables),\\nintegrated so each can call the other and with purity checked by the compiler.\\nFor pure functional code the programmer need not understand the representation\\nof the data structures. For imperative code the representation must be\\nunderstood and all effects and dependencies must be documented in the code. For\\nexample, if a function may update one of its arguments, this must be declared\\nin the function type signature and noted where the function is called. A single\\nupdate operation may affect several variables due to sharing of representations\\n(pointer aliasing). Pawns code requires all affected variables to be annotated\\nwherever they may be updated and information about sharing to be declared.\\nAnnotations are also required where IO or other global variables are used and\\nthis must be declared in type signatures as well. Sharing analysis, performed\\nby the compiler, is the key to many aspects of Pawns. It enables us to check\\nthat all effects are made obvious in the source code, effects can be\\nencapsulated inside a pure interface and effects can be used safely in the\\npresence of polymorphism.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-05\",\"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.03152\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.03152","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

Pawns 是一种正在开发中的编程语言,它支持纯函数式编程(包括代数数据类型、高阶编程和参数多态性)和命令式编程(包括指针、共享数据结构和全局变量的破坏性更新)。对于命令式代码,必须理解数据结构的表示法,并在代码中记录所有影响和依赖关系。例如,如果函数可能会更新其一个参数,则必须在函数类型签名中声明,并在函数调用时注明。由于共享表示(指针别名),一次更新操作可能会影响多个变量。当使用 IO 或其他全局变量时,也需要使用注释,而且必须在类型签名中声明。编译器进行的共享分析是 Pawns 许多方面的关键。它使我们能够检查源代码中的所有效果是否明显,效果是否可以封装在纯接口中,以及效果是否可以在多态的情况下安全使用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
A Brief Overview of the Pawns Programming Language
Pawns is a programming language under development which supports pure functional programming (including algebraic data types, higher order programming and parametric polymorphism) and imperative programming (including pointers, destructive update of shared data structures and global variables), integrated so each can call the other and with purity checked by the compiler. For pure functional code the programmer need not understand the representation of the data structures. For imperative code the representation must be understood and all effects and dependencies must be documented in the code. For example, if a function may update one of its arguments, this must be declared in the function type signature and noted where the function is called. A single update operation may affect several variables due to sharing of representations (pointer aliasing). Pawns code requires all affected variables to be annotated wherever they may be updated and information about sharing to be declared. Annotations are also required where IO or other global variables are used and this must be declared in type signatures as well. Sharing analysis, performed by the compiler, is the key to many aspects of Pawns. It enables us to check that all effects are made obvious in the source code, effects can be encapsulated inside a pure interface and effects can be used safely in the presence of polymorphism.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Repr Types: One Abstraction to Rule Them All $μλεδ$-Calculus: A Self Optimizing Language that Seems to Exhibit Paradoxical Transfinite Cognitive Capabilities Expressing and Analyzing Quantum Algorithms with Qualtran Conversational Concurrency The MLIR Transform Dialect. Your compiler is more powerful than you think
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1