Skip to main content

VM: A Virtual Machine for Strict Evaluation of (Co)Recursive Functions

  • Conference paper
Implementation and Application of Functional Languages (IFL 2004)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3474))

Included in the following conference series:

  • 288 Accesses

Abstract

Corecursive definitions are usually only meaningful in functional languages with lazy evaluation semantics, because their domain and range may contain cyclic data graphs. By inspection of the call stack, it is possible in a strict evaluation environment to detect cycles in a computation, and thus transform finite input graphs infinite time. This paper presents a virtual machine with suitable cycle handling primitives and operational semantics to implement strict evaluation of corecursive functions. We discuss the impact on calling conventions and definition constructs, and demonstrate the relevance of the introduced features by application to the domain of infinite precision decimal arithmetics.

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. Abiteboul, S., van den Bussche, J.: Deep equality revisited. Deductive and Object-Oriented Databases (1995)

    Google Scholar 

  2. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)

    Google Scholar 

  3. Brownbridge, D.R.: Cyclic reference counting for combinator machines. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201. Springer, Heidelberg (1985)

    Google Scholar 

  4. Common language infrastructure. Standard 23271, ISO/IEC (2003)

    Google Scholar 

  5. Cockett, R., Fukushima, T.: About Charity. Technical Report 92/480/18, University of Calgary (1992)

    Google Scholar 

  6. Fournet, C., Gordon, A.D.: Stack inspection: Theory and variants. ACM Trans. Program. Lang. Syst. 25(3), 360–399 (2003)

    Article  Google Scholar 

  7. Jones, R., Lins, R.: Garbage Collection. Wiley, Chichester (1996)

    MATH  Google Scholar 

  8. Karczmarczuk, J.: The most unreliable technique in the world to compute π (1998), http://users.info.unicaen.fr/~karczma/arpap/lazypi.ps.gz

  9. Lindholm, T., Yellin, F.: The Java Virtual Machine Specification, 2nd edn. (1999)

    Google Scholar 

  10. Pavlovic, D., Pratt, V.: On coalgebra of real numbers. In: Jacobs, B., Rutten, J.J.M.M. (eds.) Coalgebraic Methods in Computer Science. Electronic Notes in Computer Science, vol. 19. Elsevier, Amsterdam (2000)

    Google Scholar 

  11. Pepels, E.J.H., van Eekelen, M.C.J.D., Plasmeijer, M.J.: A cyclic reference counting algorithm and its proof. Technical Report 88–10, Computing Science Department, University of Nijmegen (1988)

    Google Scholar 

  12. Peyton Jones, S.L.: Implementing lazy functional languages on stock hardware: The spineless tagless g-machine. Journal of Functional Programming 2(2), 127–202 (1992)

    Article  MATH  Google Scholar 

  13. Salkild, J.D.: Implementation and analysis of two reference counting algorithms. Master’s thesis, University College, London (1987)

    Google Scholar 

  14. Telford, A., Turner, D.: Ensuring streams flow. In: Johnson, M. (ed.) AMAST 1997. LNCS, vol. 1349, pp. 509–523. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  15. Trancón y Widemann, B.: Stacking cycles: Functional transformation of circular data. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670. Springer, Heidelberg (2003)

    Google Scholar 

  16. Trancón y Widemann, B.: Advanced strict corecursion. In: Draft Proceedings of the IFL 2003. Department of Computer Science, Heriot-Watt University, Edinburgh (2003)

    Google Scholar 

  17. Van Den Brand, M.G.J., Heering, J., Klint, P., Olivier, P.A.: Compiling language definitions: the asf+sdf compiler. ACM Trans. Program. Lang. Syst. 24(4), 334–368 (2002)

    Article  Google Scholar 

  18. Wikipedia: Recursion (2005), http://en.wikipedia.org/wiki/Recursion

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Widemann, B.T.y. (2005). VM: A Virtual Machine for Strict Evaluation of (Co)Recursive Functions. In: Grelck, C., Huch, F., Michaelson, G.J., Trinder, P. (eds) Implementation and Application of Functional Languages. IFL 2004. Lecture Notes in Computer Science, vol 3474. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11431664_6

Download citation

  • DOI: https://doi.org/10.1007/11431664_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-26094-3

  • Online ISBN: 978-3-540-32038-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics