Sharing analysis in the Pawns compiler
- Published
- Accepted
- Subject Areas
- Programming Languages
- Keywords
- functional programming language, algebraic data type, destructive update, mutability, effects, aliasing analysis, sharing analysis
- Copyright
- © 2015 Naish
- Licence
- This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ PrePrints) and either DOI or URL of the article must be cited.
- Cite this article
- 2015. Sharing analysis in the Pawns compiler. PeerJ PrePrints 3:e907v1 https://doi.org/10.7287/peerj.preprints.907v1
Abstract
Pawns is a programming language under development which 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 which 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 postconditions concerning sharing for functions.
Author Comment
This article has been submitted to PeerJ Computer Science, and will be revised soon.