Skip to main content

Monadic Encapsulation with Stack of Regions

  • Conference paper
  • First Online:
Functional and Logic Programming (FLOPS 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2024))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. Koji Kagawa. Compositional references for stateful functional programming. In Proc. of the International Conference on Functional Programming 1997. ACM Press, June 1997.

    Google Scholar 

  3. 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.

    Article  Google Scholar 

  4. John Launchbury and Simon L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293–341, 1995.

    Article  Google Scholar 

  5. .Miley Semmelroth and Amr Sabry. Monadic encapsulation in ML. In The 1999 International Conference on Functional Programming (ICFP), 1999.

    Google Scholar 

  6. Mads Tofte and Lars Birkedal. A region inference algorithm. ACM Transactions on Programming Languages and Systems, 20(5):724–767, July 1998.

    Article  Google Scholar 

  7. 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.

    Google Scholar 

  8. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics