{"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}
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.