Skip to main content

A Calculus for Multi-language Operational Semantics

Part of the Lecture Notes in Computer Science book series (LNPSE,volume 13124)


We present \(\lambda ^{{\mathrm {\mathcal {L}}}}\), a statically typed lambda-calculus with languages as first-class citizens. In \(\lambda ^{{\mathrm {\mathcal {L}}}}\), languages can be defined and used to execute programs and, furthermore, they also can be bound to variables, passed to functions, and returned by functions, among other operations. Moreover, code of different languages can safely interact thanks to pre- and post-conditions that are checked at run-time.

We provide a type system and an operational semantics for \(\lambda ^{{\mathrm {\mathcal {L}}}}\). We observe that Milner’s type safety is too strong a property in this context, as programmers may intentionally execute unsafe languages. We then identify a type safety theorem that is specific to the domain of multi-language programming, and we prove that \(\lambda ^{{\mathrm {\mathcal {L}}}}\) satisfies this theorem.


  • Multi-language programming
  • Type systems
  • Operational semantics

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD   44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   59.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

Learn about institutional subscriptions


  1. 1.

    Substitution operations such as e[v/x] are used in reduction rules, and not in the plain programs that programmers write.


  1. van Antwerpen, H., Bach Poulsen, C., Rouvoet, A., Visser, E.: Scopes as types. Proc. ACM Program. Lang. (PACMPL) 2(OOPSLA) (2018).

  2. Bach Poulsen, C., Rouvoet, A., Tolmach, A., Krebbers, R., Visser, E.: Intrinsically-typed definitional interpreters for imperative languages. Proc. ACM Program. Lang. (PACMPL) 2(POPL) (2017).

  3. Bousse, E., Degueule, T., Vojtisek, D., Mayerhofer, T., Deantoni, J., Combemale, B.: Execution framework of the GEMOC studio (tool demo). In: Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, SLE 2016, pp. 84–89. Association for Computing Machinery, New York (2016).

  4. Chang, S., Knauth, A., Greenman, B.: Type systems as macros. In: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, pp. 694–705. Association for Computing Machinery, New York (2017).

  5. Cheney, J.: Toward a general theory of names: binding and scope. In: Proceedings of the 3rd ACM SIGPLAN Workshop on Mechanized Reasoning about Languages with Variable Binding, MERLIN 2005, pp. 33–40. Association for Computing Machinery, New York (2005).

  6. Cimini, M.: Languages as first-class citizens (vision paper). In: Proceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2018, pp. 65–69. Association for Computing Machinery, New York (2018).

  7. Cimini, M.: On the effectiveness of higher-order logic programming in language-oriented programming. In: Nakano, K., Sagonas, K. (eds.) FLOPS 2020. LNCS, vol. 12073, pp. 106–123. Springer, Cham (2020).

    CrossRef  MATH  Google Scholar 

  8. Cimini, M.: A calculus for multi-language operational semantics (additional material) (2021).

  9. Cimini, M., Miller, D., Siek, J.G.: Extrinsically typed operational semantics for functional languages. In: Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, Virtual Event, USA, 16–17 November 2020, pp. 108–125. Association for Computing Machinery, New York (2020).

  10. Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: SugarJ: library-based syntactic language extensibility. In: Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2011, pp. 391–406. Association for Computing Machinery, New York (2011).

  11. Erdweg, S., Rieger, F., Rendel, T., Ostermann, K.: Layout-sensitive language extensibility with SugarHaskell. In: Proceedings of the 5th ACM SIGPLAN Symposium on Haskell, Haskell 2012, Copenhagen, Denmark, 13 September 2012, pp. 149–160 (2012).

  12. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex, 1st edn. The MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  13. Flatt, M.: PLT: reference: racket. Technical report PLT-TR-2010-1, PLT Design Inc. (2010).

  14. Fowler, M.: Language workbenches: the killer-app for domain specific languages? (2005).

  15. Grewe, S., Erdweg, S., Wittmann, P., Mezini, M.: Type systems for the masses: deriving soundness proofs and efficient checkers. In: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward!), Onward! 2015, pp. 137–150. ACM, New York (2015).

  16. Klint, P., van der Storm, T., Vinju, J.J.: RASCAL: a domain specific language for source code analysis and manipulation. In: Ninth IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2009, Edmonton, Alberta, Canada, 20–21 September 2009, pp. 168–177 (2009).

  17. Krahn, H., Rumpe, B., Völkel, S.: MontiCore: a framework for compositional development of domain specific languages. Int. J. Softw. Tools Technol. Transf. 12(5), 353–372 (2010).

    CrossRef  Google Scholar 

  18. Matthews, J., Findler, R.B.: Operational semantics for multi-language programs. In: Proceedings of the 34th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2007, pp. 3–10. Association for Computing Machinery, New York (2007).

  19. Miller, D., Nadathur, G.: Programming with Higher-Order Logic, 1st edn. Cambridge University Press, Cambridge (2012)

    CrossRef  Google Scholar 

  20. Patterson, D., Perconti, J., Dimoulas, C., Ahmed, A.: FunTAL: reasonably mixing a functional language with assembly. In: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, 18–23 June 2017, pp. 495–509. ACM (2017).

  21. Rosu, G., Serbanuta, T.: An overview of the K semantic framework. J. Log. Algebraic Methods Program. 79(6), 397–434 (2010).

    CrossRef  MathSciNet  MATH  Google Scholar 

  22. Scherer, G., New, M.S., Rioux, N., Ahmed, A.: Fabulous interoperability for ML and a linear language. In: Proceedings of Foundations of Software Science and Computation Structures - 21st International Conference, FOSSACS 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, 14–20 April 2018, pp. 146–162 (2018).

  23. Schürmann, C.: Automating the meta theory of deductive systems. Ph.D. thesis, Department of Computer Science, Carnegie Mellon University, August 2000. Available as Technical Report CMU-CS-00-146

  24. Wright, A., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994).

    CrossRef  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Matteo Cimini .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cimini, M. (2022). A Calculus for Multi-language Operational Semantics. In: Bloem, R., Dimitrova, R., Fan, C., Sharygina, N. (eds) Software Verification. NSV VSTTE 2021 2021. Lecture Notes in Computer Science(), vol 13124. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-95560-1

  • Online ISBN: 978-3-030-95561-8

  • eBook Packages: Computer ScienceComputer Science (R0)