Skip to main content

Call-by-Value Semantics for Mutually Recursive First-Class Modules

  • Conference paper
Trends in Functional Programming (TFP 2012)

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

Included in the following conference series:

  • 819 Accesses

Abstract

We present a transformation based denotational semantics for a call-by-value language with first-class, hierarchical and recursive modules. We use the notion of modules as proposed in [1]. They merge dynamic data structures with aspects of modularisation and name binding in functional programming languages. Modules are first-class values which capture recursive definitions, lexical scoping, hierarchical structuring of programs and dynamically typed data structures in a single construction. We define a call-by-value language ModLang and explain what problems occur in combining nested, recursive and first-class modules. We then show how to solve these problems by defining a dependency analysis to determine the evaluation order, enabling a transformation into an intermediate representation. Finally, we present a denotational call-by-value semantics.

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. Pepper, P., Hofstedt, P.: Funktionale Programmierung – Sprachdesign und Programmiertechnik. Springer (2006)

    Google Scholar 

  2. Peyton Jones, S.L., Shields, M.B.: First class modules for Haskell. In: 9th International Conference on Foundations of Object-Oriented Languages (FOOL 9), Portland, Oregon, pp. 28–40 (January 2002)

    Google Scholar 

  3. Russo, C.V.: First-class structures for standard ml. Nordic J. of Computing 7, 348–374 (2000)

    MATH  Google Scholar 

  4. Reinke, C.: Functions, Frames, and Interactions – completing a lambda-calculus-based purely functional language with respect to programming-in-the-large and interactions with runtime environments. PhD thesis, Universität Kiel (1997)

    Google Scholar 

  5. Blume, M.: Hierarchical Modularity and Intermodule Optimization. PhD thesis, Princeton University (November 1997)

    Google Scholar 

  6. Crary, K., Harper, R., Puri, S.: What is a recursive module? SIGPLAN Not. 34(5), 50–63 (1999)

    Article  Google Scholar 

  7. Nakata, K., Garrigue, J.: Recursive modules for programming. SIGPLAN Not. 41, 74–86 (2006)

    Article  Google Scholar 

  8. Russo, C.V.: Recursive structures for standard ml. SIGPLAN Not. 36(10), 50–61 (2001)

    Article  Google Scholar 

  9. Nakata, K., Garrigue, J.: Path resolution for nested recursive modules. Higher-Order and Symbolic Computation, 1–31 (May 2012)

    Google Scholar 

  10. Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A nominal theory of objects with dependent types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 201–224. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  11. Cardelli, L., Donahue, J., Glassman, L., Jordan, M., Kalsow, B., Nelson, G.: Modula-3 report (revised). ACM SIGPLAN Notices 27(8), 15–42 (1992)

    Article  Google Scholar 

  12. Abelson, H., Sussman, G.J., Sussman, J.: Structure and Interpretation of Computer Programs, 2nd edn. MIT Press (1996)

    Google Scholar 

  13. Lorenzen, F., Rohloff, J.: Gruppen: Ein Ansatz zur Vereinheitlichung von Namensbindung und Modularisierung in strikten funktionalen Programmiersprachen (Langfassung). Technical Report 2011-12, TU Berlin (2011)

    Google Scholar 

  14. Sharir, M.: A strong-connectivity algorithm and its applications in data flow analysis. Computers & Mathematics with Applications 7(1), 67–72 (1981)

    Article  MathSciNet  MATH  Google Scholar 

  15. Tennent, R.D.: The denotational semantics of programming languages. Commun. ACM 19(8), 437–453 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  16. Gordon, M.J.C.: The Denotational Description of Programming Languages. Springer (1979)

    Google Scholar 

  17. Stoy, J.E.: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. Computer Science Series. MIT Press (1981)

    Google Scholar 

  18. Hirschowitz, T., Leroy, X.: Mixin modules in a call-by-value setting. ACM Trans. Program. Lang. Syst. 27, 857–881 (2005)

    Article  Google Scholar 

  19. Owens, S., Flatt, M.: From structures and functors to modules and units. SIGPLAN Not. 41(9), 87–98 (2006)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Rohloff, J., Lorenzen, F. (2013). Call-by-Value Semantics for Mutually Recursive First-Class Modules. In: Loidl, HW., Peña, R. (eds) Trends in Functional Programming. TFP 2012. Lecture Notes in Computer Science, vol 7829. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40447-4_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40447-4_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40446-7

  • Online ISBN: 978-3-642-40447-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics