Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/292540.292564acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

Typed memory management in a calculus of capabilities

Published: 01 January 1999 Publication History

Abstract

An increasing number of systems rely on programming language technology to ensure safety and security of low-level code. Unfortunately, these systems typically rely on a complex, trusted garbage collector. Region-based type systems provide an alternative to garbage collection by making memory management explicit but verifiably safe. However, it has not been clear how to use regions in low-level, type-safe code.We present a compiler intermediate language, called the Capability Calculus, that supports region-based memory management, enjoys a provably safe type system, and is straightforward to compile to a typed assembly language. Source languages may be compiled to our language using known region inference algorithms. Furthermore, region lifetimes need not be lexically scoped in our language, yet the language may be checked for safety without complex analyses. Finally, our soundness proof is relatively simple, employing only standard techniques.The central novelty is the use of static capabilities to specify the permissibility of various operations, such as memory access and deallocation. In order to ensure capabilities are relinquished properly, the type system tracks aliasing information using a form of bounded quantification.

References

[1]
Alexander Aiken, Manuel F~.hndrich, and Raph Levien. Better static memory management: Improving regionbased analysis of higher-order languages. In A UM SIG- PLAN Conference on Programming Language Design and Implementation, pages 174-185, La Jolla, California, 1995.
[2]
Brain Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Sirer, Marc Fiuczynski, David Becker, Craig Chambers, and Susan Eggers. Extensibility, safety and performance in the SPIN operating system. In Fifteenth A CM Symposium on Operating Systems Principles, pages 267-284, Copper Mountain, December 1995.
[3]
Lars Birkedal, Nick Rothwell, Mads Torte, and David N. Turner. The ML Kit (version 1). Technical Report 93/14, Department of Computer Science, University of Copenhagen, 1993.
[4]
Lars Birkedal, Mads Torte, and Magnus Vejlstrup. From region inference to von Neumann machines via region representation inference. In Twenty-Third A CM Symposium on Principles of Programming Languages, pages 171-183, St. Petersburg, January 1996.
[5]
Karl Crary, David Walker, and Greg Morrisett. Typed memory management in a calculus of capabilities. Technical report, Cornell University, 1999.
[6]
Karl Crary, Stephanie Weirich, and Greg Morrisett. Intensional polymorphism in type-erasure semantics. In A CM SIGPLAN International Conference on Functional Programming, pages 301-312, Baltimore, September 1998.
[7]
Alain Deutsch. Interprocedural may-alias analysis for pointers: Beyond k-limiting. In A CM SIGPLAN Conference on Programming Language Design and Implementation, pages 230-241, Orlando, June 1994.
[8]
Andrzej Filinski. Controlling Effects. PhD thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania, May 1996.
[9]
David Gay and Alex Aiken. Memory management with explicit regions. In A CM SIGPLAN Conference on Programming Language Design and Implementation, pages 313 - 323, Montreal, June 1998.
[10]
Rakesh Ghiya and Laurie J. Hendren. Is it a tree, a DAG, or a cyclic graph? A shape analysis for heapdirected pointers in C. In Twenty-Third A CM Symposium on Principles of Programming Languages, pages 1-15, St. Petersburg Beach, Florida, January 1996.
[11]
D. K. Gifford and J. M. Lucassen. Integrating functional and imperative programming, in A CM Conference on Lisp and Functional Programming, Cambridge, Massachusetts, August 1986.
[12]
Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1-102, 1987.
[13]
Robert Harper and Greg Morrisett. Compiling polymorphism using intensional type analysis. In Twenty- Second A CM Symposium on Principles of Programming Languages, pages 130-141, San Francisco, January 1995.
[14]
Chris Hawblitzel, Chi-Chao Chang, Grzegorz Czajkowski, Deyu Hu, and Thorsten von Eicken. Implementing multiple protection domains in Java. In 1998 USENIX Annual Technical Conference, New Orleans, June 1998.
[15]
Chris Hawblitzel and Thorsten yon Eicken. Sharing and revocation in a safe language. Unpublished manuscript., 1998.
[16]
Pierre Jouvelot and D. K. Gifford. Algebraic reconstruction of types and effects. In Eighteenth A CM Symposium on Principles of Programming Languages, pages 303-310, January 1991.
[17]
Dexter Kozen. Efficient code certification. Technical Report 98-1661, Cornell University, January 1998.
[18]
John Launchbury and Simon L. Peyton Jones. State in Haskell. LISP and Symbolic Computation, 8(4):293- 341, December 1995.
[19]
Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996.
[20]
john M. Lucassen. Types and Effects--Towards the integration of Functional and Imperative Programming. PhD thesis, MIT Laboratory for Computer Science, 1987.
[21]
Eugenio Moggi. Notions of computation and monads. Information and Computation, 93:55-92, 1991.
[22]
Greg Morrisett, Matthias Felleisen, and Robert Harper. Abstract models of memory management. In A CM Conference on Functional Programming and Computer Architecture, pages 66-77, La Jolla, June 1995.
[23]
Greg Morrisett and Robert Harper. Semantics of memory management for polymorphic languages. In A.D. Gordon and A.M. Pitts, editors, Higher Order Operational Techniques in Semantics, Publications of the Newton Institute. Cambridge University Press, 1997.
[24]
Greg Morrisett, David Walker, Karl Crary, and Neal G1ew. From System F to Typed Assembly Language. In Twenty-Fifth A CM Symposium on Principles of Programming Languages, San Diego, January 1998.
[25]
George Necula. Proof-carrying code. In Twenty-Fourth A CM Symposium on Principles of Programming Languages, pages 106-119, Paris, 1997.
[26]
George Necula and Peter Lee. Safe kernel extensions without run-time checking, in Proceedings of Operating System Design and Implementation, pages 229-243, Seattle, October 1996.
[27]
George Necula and Peter Lee. The design and implementation of a certifying compiler. In A CM SIGPLAN Conference on Programming Language Design and Implementation, pages 333 - 344, Montreal, June 1998.
[28]
Simon L. Peyton jones and Philip Wadler. Imperative functional programming. In Twentieth A GM Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993.
[29]
John C. Reynolds. Definitional interpreters for higherorder programming languages. In Conference Record of the ~Sth National A GM Conference, pages 717-740, Boston, August 1972.
[30]
John C. Reynolds. Syntactic control of interference. In Fifth A GM Symposium on Principles of Programming Languages, pages 39-46, Tucson, Arizona, 1978.
[31]
John C. Reynolds. Syntactic control of interference, part 2. In Sixteenth International Colloquium on Automata, Languages, and Programming, July 1989.
[32]
M. Sagiv, T. Reps, and R. Wilhelm. Solving shapeanalysis problems in languages with destructive updating. A GM Transactions on Programming Languages and Systems, 20(1):1-50, January 1996.
[33]
J.-P. Talpin and P. Jouvelot. Polymorphie type, region, and effect inference, journal of b'~nctional Programming, 2(3):245-271, July 1992.
[34]
Mads Torte and Lars Birkedal. A region inference algorithm. Transactions on Programming Languages and Systems, November 1998. To appear.
[35]
Mads Tofte and Jean-Pierre Talpin. Implementation of the typed call-by-value A-calculus using a stack of regions. In Twenty-First A GM Symposium on Principles of Programming Languages, pages 188-201, Portland, Oregon, January 1994.
[36]
Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109-176, 1997.
[37]
Philip Wadler. Linear types can change the world{ In M. Broy and C. Jones, editors, Programming Concepts and Methods, Sea of Galilee, Israel, April 1990. North Holland. IFIP TC 2 Working Conference.
[38]
Philip Wadler. A taste of linear logic. In Mathemat. ieal Foundations of Computer Science, volume 711 of LNGS, Gdansk, Poland, August 1993. Springer-Verlag.
[39]
Robert Wahbe, Steven Lueeo, Thomas Anderson, and Susan Graham. Efficient softwaxe-based fault isolation. In Fourteenth A GM Symposium on Operating Systems Principles, pages 203-216, Asheville, December 1993.
[40]
Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Inforraation and Computation, 115(1):38-94, 1994.
[41]
W. A. Wulf, R. Levin, and S. P. Haxbison. Hydra/G.mrnp: An Experimental Computer System. McGraw-Hill, New York, NY, 1981.

Cited By

View all
  • (2024)Degrees of Separation: A Flexible Type System for Safe ConcurrencyProceedings of the ACM on Programming Languages10.1145/36498538:OOPSLA1(1181-1207)Online publication date: 29-Apr-2024
  • (2024)Cedar: A New Language for Expressive, Fast, Safe, and Analyzable AuthorizationProceedings of the ACM on Programming Languages10.1145/36498358:OOPSLA1(670-697)Online publication date: 29-Apr-2024
  • (2023)Capturing TypesACM Transactions on Programming Languages and Systems10.1145/361800345:4(1-52)Online publication date: 20-Nov-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '99: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 1999
324 pages
ISBN:1581130953
DOI:10.1145/292540
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 1999

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

POPL99
POPL99: Symposium on Prinicples of Programming Languages 1999
January 20 - 22, 1999
Texas, San Antonio, USA

Acceptance Rates

POPL '99 Paper Acceptance Rate 24 of 136 submissions, 18%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)215
  • Downloads (Last 6 weeks)15
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Degrees of Separation: A Flexible Type System for Safe ConcurrencyProceedings of the ACM on Programming Languages10.1145/36498538:OOPSLA1(1181-1207)Online publication date: 29-Apr-2024
  • (2024)Cedar: A New Language for Expressive, Fast, Safe, and Analyzable AuthorizationProceedings of the ACM on Programming Languages10.1145/36498358:OOPSLA1(670-697)Online publication date: 29-Apr-2024
  • (2023)Capturing TypesACM Transactions on Programming Languages and Systems10.1145/361800345:4(1-52)Online publication date: 20-Nov-2023
  • (2023)Responsive Parallelism with SynchronizationProceedings of the ACM on Programming Languages10.1145/35912497:PLDI(712-735)Online publication date: 6-Jun-2023
  • (2023)Verus: Verifying Rust Programs using Linear Ghost TypesProceedings of the ACM on Programming Languages10.1145/35860377:OOPSLA1(286-315)Online publication date: 6-Apr-2023
  • (2022)Linearly qualified types: generic inference for capabilities and uniquenessProceedings of the ACM on Programming Languages10.1145/35476266:ICFP(137-164)Online publication date: 31-Aug-2022
  • (2022)Effects, capabilities, and boxes: from scope-based reasoning to type-based reasoning and backProceedings of the ACM on Programming Languages10.1145/35273206:OOPSLA1(1-30)Online publication date: 29-Apr-2022
  • (2022)A flexible type system for fearless concurrencyProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523443(458-473)Online publication date: 9-Jun-2022
  • (2022)Region-based Resource Management and Lexical Exception Handlers in Continuation-Passing StyleProgramming Languages and Systems10.1007/978-3-030-99336-8_18(492-519)Online publication date: 29-Mar-2022
  • (2021)Safe mutation with algebraic effectsProceedings of the 14th ACM SIGPLAN International Symposium on Haskell10.1145/3471874.3472988(122-135)Online publication date: 18-Aug-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media