ABSTRACT
Alms is a general-purpose programming language that supports practical affine types. To offer the expressiveness of Girard's linear logic while keeping the type system light and convenient, Alms uses expressive kinds that minimize notation while maximizing polymorphism between affine and unlimited types.
A key feature of Alms is the ability to introduce abstract affine types via ML-style signature ascription. In Alms, an interface can impose stiffer resource usage restrictions than the principal usage restrictions of its implementation. This form of sealing allows the type system to naturally and directly express a variety of resource management protocols from special-purpose type systems.
We present two pieces of evidence to demonstrate the validity of our design goals. First, we introduce a prototype implementation of Alms and discuss our experience programming in the language. Second, we establish the soundness of the core language. We also use the core model to prove a principal kinding theorem.
Supplemental Material
- A. Ahmed, M. Fluet, and G. Morrisett. A step-indexed model of substructural state. In phICFP’05, pages 78--91. ACM, 2005. Google ScholarDigital Library
- A. Barber. Dual intuitionistic linear logic. Technical Report ECS-LFCS-960347, U. of Edinburgh, 1996.Google Scholar
- P. S. Barth, R. S. Nikhil, and Arvind. M-structures: Extending a parallel, non-strict, functional language with state. In phProc. FPCA’91, volume 523 of phLNCS. Springer, 1991. Google ScholarDigital Library
- G. M. Bierman. phOn Intuitionistic Linear Logic. PhD thesis, U. of Cambridge, 1993.Google Scholar
- J. Boyland. Checking interference with fractional permissions. In phSAS’03, volume 2694 of phLNCS. Springer, 2003. Google ScholarDigital Library
- K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type-erasure semantics. phJFP, 12 (06): 567--600, 2002. Google ScholarDigital Library
- L. Damas and R. Milner. Principal type-schemes for functional programs. In phPOPL’82, pages 207--212. ACM, 1982. Google ScholarDigital Library
- drich(2001)}r:deline01R. DeLine and M. F\"ahndrich. Enforcing high-level protocols in low-level software. In phPLDI’01. ACM, 2001. Google ScholarDigital Library
- drich and DeLine(2002)}r:fahndrich02M. F\"ahndrich and R. DeLine. Adoption and focus: Practical linear types for imperative programming. In phPLDI’02. ACM, 2002. Google ScholarDigital Library
- drich et al.(2006)F\"ahndrich, Aiken, Hawblitzel, Hodson, Hunt, Larus, and Levi}Fahndrich06M. F\"ahndrich, M. Aiken, C. Hawblitzel, O. Hodson, G. Hunt, J. R. Larus, and S. Levi. Language support for fast and reliable message-based communication in Singularity OS. In phEuroSys’06, pages 177--190. ACM, 2006. Google ScholarDigital Library
- S. J. Gay, V. T. Vasconcelos, and A. Ravara. Session types for inter-process communication. Technical Report TR-2003--133, U. of Glasgow, 2003.Google Scholar
- J.-Y. Girard. Linear logic. phTheoretical Computer Science, 50: 1--102, 1987. Google ScholarDigital Library
- D. Leijen. Flexible types: Robust type inference for first-class polymorphism. In phPOPL’09, pages 66--77. ACM, 2009. Google ScholarDigital Library
- , and Vouillon}r:ocaml08X. Leroy, D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. phThe Objective Caml system. INRIA, 3.11 edition, 2008.Google Scholar
- K. Mazurak, J. Zhao, and S. Zdancewic. Lightweight linear types in System F$^\circ$. In phTLDI’10, pages 77--88. ACM, 2010. Google ScholarDigital Library
- R. Milner, M. Tofte, R. Harper, and D. MacQueen. phThe Definition of Standard ML. MIT, revised edition, 1997. Google ScholarDigital Library
- B. C. Pierce. phTypes and Programming Languages. MIT, 2002. Google ScholarDigital Library
- R. Plasmeijer and M. van Eekelen. phClean Language Report, Version 2.1. Dept. of Software Technology, U. of Nijmegen, 2002.Google Scholar
- A. Rossberg, C. V. Russo, and D. Dreyer. F-ing modules. In phTLDI’10, pages 89--102. ACM, 2010. Google ScholarDigital Library
- M. Steffen. phPolarized Higher Order Subtyping. PhD thesis, Universit\"at Erlangen-Nürnberg, 1997.Google Scholar
- I. E. Sutherland and G. W. Hodgman. Reentrant polygon clipping. phCACM, 17 (1): 32--42, 1974. Google ScholarDigital Library
- J. A. Tov and R. Pucella. Stateful contracts for affine types. In phESOP’10, volume 6012 of phLNCS, pages 550--569. Springer, 2010. Google ScholarDigital Library
- E. de Vries, R. Plasmeijer, and D. M. Abrahamson. Uniqueness typing simplified. In phIFL’07, pages 201--218. Springer, 2008. Google ScholarDigital Library
- P. Wadler. Is there a use for linear logic? In phPEPM’91, pages 255--273. ACM, 1991. Google ScholarDigital Library
- P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In phPOPL’89, pages 60--76. ACM, 1989. Google ScholarDigital Library
Index Terms
- Practical affine types
Recommendations
Practical affine types
POPL '11Alms is a general-purpose programming language that supports practical affine types. To offer the expressiveness of Girard's linear logic while keeping the type system light and convenient, Alms uses expressive kinds that minimize notation while ...
CPS transformation with affine types for call-by-value implicit polymorphism
Transformation of programs into continuation-passing style (CPS) reveals the notion of continuations, enabling many applications such as control operators and intermediate representations in compilers. Although type preservation makes CPS transformation ...
Modeling abstract types in modules with open existential types
POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesWe propose F-zip, a calculus of open existential types that is an extension of System F obtained by decomposing the introduction and elimination of existential types into more atomic constructs. Open existential types model modular type abstraction as ...
Comments