skip to main content
10.1145/1926385.1926436acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Practical affine types

Published: 26 January 2011 Publication History

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.

Supplementary Material

MP4 File (40-mpeg-4.mp4)

References

[1]
A. Ahmed, M. Fluet, and G. Morrisett. A step-indexed model of substructural state. In phICFP’05, pages 78--91. ACM, 2005.
[2]
A. Barber. Dual intuitionistic linear logic. Technical Report ECS-LFCS-960347, U. of Edinburgh, 1996.
[3]
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.
[4]
G. M. Bierman. phOn Intuitionistic Linear Logic. PhD thesis, U. of Cambridge, 1993.
[5]
J. Boyland. Checking interference with fractional permissions. In phSAS’03, volume 2694 of phLNCS. Springer, 2003.
[6]
K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type-erasure semantics. phJFP, 12 (06): 567--600, 2002.
[7]
L. Damas and R. Milner. Principal type-schemes for functional programs. In phPOPL’82, pages 207--212. ACM, 1982.
[8]
drich(2001)}r:deline01R. DeLine and M. F\"ahndrich. Enforcing high-level protocols in low-level software. In phPLDI’01. ACM, 2001.
[9]
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.
[10]
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.
[11]
S. J. Gay, V. T. Vasconcelos, and A. Ravara. Session types for inter-process communication. Technical Report TR-2003--133, U. of Glasgow, 2003.
[12]
J.-Y. Girard. Linear logic. phTheoretical Computer Science, 50: 1--102, 1987.
[13]
D. Leijen. Flexible types: Robust type inference for first-class polymorphism. In phPOPL’09, pages 66--77. ACM, 2009.
[14]
, and Vouillon}r:ocaml08X. Leroy, D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. phThe Objective Caml system. INRIA, 3.11 edition, 2008.
[15]
K. Mazurak, J. Zhao, and S. Zdancewic. Lightweight linear types in System F$^\circ$. In phTLDI’10, pages 77--88. ACM, 2010.
[16]
R. Milner, M. Tofte, R. Harper, and D. MacQueen. phThe Definition of Standard ML. MIT, revised edition, 1997.
[17]
B. C. Pierce. phTypes and Programming Languages. MIT, 2002.
[18]
R. Plasmeijer and M. van Eekelen. phClean Language Report, Version 2.1. Dept. of Software Technology, U. of Nijmegen, 2002.
[19]
A. Rossberg, C. V. Russo, and D. Dreyer. F-ing modules. In phTLDI’10, pages 89--102. ACM, 2010.
[20]
M. Steffen. phPolarized Higher Order Subtyping. PhD thesis, Universit\"at Erlangen-Nürnberg, 1997.
[21]
I. E. Sutherland and G. W. Hodgman. Reentrant polygon clipping. phCACM, 17 (1): 32--42, 1974.
[22]
J. A. Tov and R. Pucella. Stateful contracts for affine types. In phESOP’10, volume 6012 of phLNCS, pages 550--569. Springer, 2010.
[23]
E. de Vries, R. Plasmeijer, and D. M. Abrahamson. Uniqueness typing simplified. In phIFL’07, pages 201--218. Springer, 2008.
[24]
P. Wadler. Is there a use for linear logic? In phPEPM’91, pages 255--273. ACM, 1991.
[25]
P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In phPOPL’89, pages 60--76. ACM, 1989.

Cited By

View all
  • (2025)Affect: An Affine Type and Effect SystemProceedings of the ACM on Programming Languages10.1145/37048419:POPL(126-154)Online publication date: 9-Jan-2025
  • (2024)Law and Order for Typestate with BorrowingProceedings of the ACM on Programming Languages10.1145/36897638:OOPSLA2(1475-1503)Online publication date: 8-Oct-2024
  • (2024)Soundly Handling LinearityProceedings of the ACM on Programming Languages10.1145/36328968:POPL(1600-1628)Online publication date: 5-Jan-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '11: Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2011
652 pages
ISBN:9781450304900
DOI:10.1145/1926385
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 46, Issue 1
    POPL '11
    January 2011
    624 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1925844
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 26 January 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. affine types
  2. linear logic
  3. modules
  4. polymorphism
  5. type systems

Qualifiers

  • Research-article

Conference

POPL '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 860 of 4,328 submissions, 20%

Upcoming Conference

POPL '26

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)42
  • Downloads (Last 6 weeks)6
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Affect: An Affine Type and Effect SystemProceedings of the ACM on Programming Languages10.1145/37048419:POPL(126-154)Online publication date: 9-Jan-2025
  • (2024)Law and Order for Typestate with BorrowingProceedings of the ACM on Programming Languages10.1145/36897638:OOPSLA2(1475-1503)Online publication date: 8-Oct-2024
  • (2024)Soundly Handling LinearityProceedings of the ACM on Programming Languages10.1145/36328968:POPL(1600-1628)Online publication date: 5-Jan-2024
  • (2024) Sparcl : A language for partially invertible computation Journal of Functional Programming10.1017/S095679682300012634Online publication date: 26-Jan-2024
  • (2024)Formally understanding Rust’s ownership and borrowing system at the memory levelFormal Methods in System Design10.1007/s10703-024-00460-364:1(200-236)Online publication date: 1-Dec-2024
  • (2023)Kind Inference for the FreeST Programming LanguageElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.378.1378(1-13)Online publication date: 13-Apr-2023
  • (2023)Intrinsically Typed Sessions with Callbacks (Functional Pearl)Proceedings of the ACM on Programming Languages10.1145/36078547:ICFP(711-739)Online publication date: 31-Aug-2023
  • (2023)A Survey on Parallelism and DeterminismACM Computing Surveys10.1145/356452955:10(1-28)Online publication date: 2-Feb-2023
  • (2022)Linearity and Uniqueness: An Entente CordialeProgramming Languages and Systems10.1007/978-3-030-99336-8_13(346-375)Online publication date: 5-Apr-2022
  • (2021)Graded Modal Dependent Type TheoryProgramming Languages and Systems10.1007/978-3-030-72019-3_17(462-490)Online publication date: 23-Mar-2021
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media