Abstract
Many modern programming languages use garbage collection for the sake of reliability and productivity. On the other hand, garbage collection causes several difficulties in some situations, for example, in real-time systems.
Tofte and Talpin’s region and effect system for ML infers lifetime of objects at compile time and makes it possible to reclaim memory safely without using garbage collectors at run time. Programmers do not have to provide any explicit directives about lifetime of objects. However, it is sometimes necessary for programmers to transform programs specially in order to make the system infer as they intend. As a result, programmers have to know, to some extent, how the system infers about regions.
In this paper, we introduce a type system for an ML-like language which also aims for compile-time lifetime inference. It, however, lets programmers delimit lifetime of objects explicitly and makes the system check the correctness of programmers’ directives.
Acknowledgement
I would like to thank the anonymous reviewers for their valuable comments. This research is partially supported by Japan Society for the Promotion of Science, Grant-in-Aid for Encouragement of Young Scientists, 10780196.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Lars Birkedal, Mads Tofte, and Magnus Vejlstrup. From region inference to von Neumann machines via region representation inference. In 23rd ACM Symposium on Principles of Programming Languages, January 1996.
Koji Kagawa. Compositional references for stateful functional programming. In Proc. of the International Conference on Functional Programming 1997. ACM Press, June 1997.
Konstantin Läufer and Martin Odersky. Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems (TOPLAS), 16(5):1411–1430, September 1994.
John Launchbury and Simon L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293–341, 1995.
.Miley Semmelroth and Amr Sabry. Monadic encapsulation in ML. In The 1999 International Conference on Functional Programming (ICFP), 1999.
Mads Tofte and Lars Birkedal. A region inference algorithm. ACM Transactions on Programming Languages and Systems, 20(5):724–767, July 1998.
Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy HØjfeld Olesen, Peter Sestoft, and Peter Bertelsen. Programming with regions in the ML kit. Technical Report 97/12, Department of Computer Science, University of Copenhagen, April 1997.
Mads Tofte and Jean-Pierre Talpin. Implementation of typed call-by-value λ-calculus using a stack of regions. In Annual ACM Symp. on Principles of Prog. Languages, pages 188–201, January 1994.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kagawa, K. (2001). Monadic Encapsulation with Stack of Regions. In: Kuchen, H., Ueda, K. (eds) Functional and Logic Programming. FLOPS 2001. Lecture Notes in Computer Science, vol 2024. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44716-4_17
Download citation
DOI: https://doi.org/10.1007/3-540-44716-4_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41739-2
Online ISBN: 978-3-540-44716-0
eBook Packages: Springer Book Archive