Abstract
Inter-language interoperability is big business, as the success of Microsoft's .NET and COM and Sun's JVM show. Programming language designers are designing programming languages that reflect that fact --- SML#, Mondrian, and Scala, to name just a few examples, all treat interoperability with other languages as a central design feature. Still, current multi-language research tends not to focus on the semantics of interoperation features, but only on how to implement them efficiently. In this paper, we take first steps toward higher-level models of interoperating systems. Our technique abstracts away the low-level details of interoperability like garbage collection and representation coherence, and lets us focus on semantic properties like type-safety and observable equivalence.Beyond giving simple expressive models that are natural compositions of single-language models, our studies have uncovered several interesting facts about interoperability. For example, higher-order contracts naturally emerge as the glue to ensure that interoperating languages respect each other's type systems. While we present our results in an abstract setting, they shed light on real multi-language systems and tools such as the JNI, SWIG, and Haskell's stable pointers.
References
- M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic typing in a statically typed language. ACM Transactions on Programming Languages and Systems, 13(2):237--268, April 1991.]] Google Scholar
Digital Library
- E. Barzilay and J. Clements. Laziness without all the hard work. In Workshop on Functional and Declarative Programming in Education (FDPE), 2005.]] Google Scholar
Digital Library
- E. Barzilay and D. Orlovsky. Foreign interface for PLT Scheme. In Workshop on Scheme and Functional Programming, 2004.]]Google Scholar
- D. Beazley. Pointers, constraints, and typemaps. In SWIG 1.1 Users Manual. Available online: http://www.swig.org/Doc1.1/HTML/Typemaps.html.]]Google Scholar
- D. Beazley. SWIG: An easy to use tool for integrating scripting languages with C and C++. In 4th Tcl/Tk Workshop, pages 129--139, 1996. Available online: http://www.swig.org/papers/Tcl96/tcl96.html.]]Google Scholar
- N. Benton. Embedded interpreters. Journal of Functional Programming, 15:503--542, July 2005.]] Google Scholar
Digital Library
- N. Benton and A. Kennedy. Interlanguage working without tears: Blending SML with Java. In ACM SIGPLAN International Conference on Functional Programming (ICFP), pages 126--137, 1999.]] Google Scholar
Digital Library
- N. Benton, A. Kennedy, and C. V. Russo. Adventures in interoperability: the SML.NET experience. In Proceedings of the 6th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP), pages 215--226, 2004.]] Google Scholar
Digital Library
- M. Blume. No-longer-foreign: Teaching an ML compiler to speak C "natively". In Workshop on Multi-Language Infrastructure and Interoperability (BABEL), 2001.]]Google Scholar
- L. Cardelli. Amber. In G. Cousineau, P.-L. Curien, and B. Robinet, editors, Combinators and functional programming languages, volume 242. Springer-Verlag, 1986.]] Google Scholar
Digital Library
- M. M. T. Chakravarty. C → HASKELL, or yet another interfacing tool. In International Workshop on Implementation of Functional Languages (IFL), 1999.]] Google Scholar
Digital Library
- M. M. T. Chakravarty. The Haskell 98 foreign function interface 1.0, 2002. Available online: http://www.cse.unsw.edu.au/~chak/haskell/ffi/.]]Google Scholar
- C. Chambers and The Cecil Group. The Cecil language: Specification and rationale, version 3.2. Technical report, Department of Computer Science and Engineering, University of Washington, February 2004. Available online: http://www.cs.washington.edu/research/projects/cecil/pubs/cecil-spec.html.]]Google Scholar
- M. Felleisen. On the expressive power of programming languages. Science of Computer Programming, 17:35--75, 1991.]] Google Scholar
Digital Library
- M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science, 102:235--271, 1992. Original version in: Technical Report 89--100, Rice University, June 1989.]]Google Scholar
- R. B. Findler and M. Blume. Contracts as pairs of projections. In International Symposium on Functional and Logic Programming (FLOPS), 2006.]] Google Scholar
Digital Library
- R. B. Findler and M. Felleisen. Contracts for higher-order functions. In ACM SIGPLAN International Conference on Functional Programming (ICFP), 2002.]] Google Scholar
Digital Library
- S. Finne, D. Leijen, E. Meijer, and S. Peyton Jones. Calling Hell from Heaven and Heaven from Hell. In ACM SIGPLAN International Conference on Functional Programming (ICFP), pages 114--125, 1999.]] Google Scholar
Digital Library
- K. Fisher, R. Pucella, and J. Reppy. A framework for interoperability. In Workshop on Multi-Language Infrastructure and Interoperability (BABEL), 2001.]]Google Scholar
Cross Ref
- C. Flanagan. Hybrid type checking. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), 2006.]] Google Scholar
Digital Library
- M. Furr and J. S. Foster. Checking type safety of foreign function calls. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 62--72, 2005.]] Google Scholar
Digital Library
- A. D. Gordon and D. Syme. Typing a multi-language intermediate code. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 248--260, 2001.]] Google Scholar
Digital Library
- K. E. Gray, R. B. Findler, and M. Flatt. Fine grained interoperability through mirrors and contracts. In Conference on Object-Oriented Programming: Systems, Languages, and Applications (OOPSLA), 2005.]] Google Scholar
Digital Library
- F. Henglein. Dynamic typing: Syntax and proof theory. Science of Computer Programming, 22(3):197--230, 1994.]] Google Scholar
Digital Library
- F. Henglein and J. Rehof. Safe polymorphic type inference for a dynamically typed language: translating Scheme to ML. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA), 1995.]] Google Scholar
Digital Library
- R. Ibrahim and C. Szyperski. The COMEL language. Technical Report FIT-TR-97-06, Faculty of Information Technology, Queensland University of Technology, Brisbane, Australia, 1997.]] Google Scholar
Digital Library
- Jython. http://www.jython.org/.]]Google Scholar
- A. Kennedy. Securing the .NET programming model. Theoretical Computer Science, To appear. http://research.microsoft.com/~akenn/sec/.]] Google Scholar
Digital Library
- L. Kornstaedt. Alice in the land of Oz - an interoperability-based implementation of a functional language on top of a relational language. In Workshop on Multi-Language Infrastructure and Interoperability (BABEL), 2001.]]Google Scholar
Cross Ref
- J. Matthews and R. B. Findler. An operational semantics for R5RS Scheme. In Workshop on Scheme and Functional Programming, 2005.]]Google Scholar
- J. Matthews, R. B. Findler, M. Flatt, and M. Felleisen. A visual en-vironment for developing context-sensitive term rewriting systems. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA), 2004.]]Google Scholar
Cross Ref
- E. Meijer, N. Perry, and A. van Yzendoorn. Scripting .NET using Mondrian. In European Conference on Object-Oriented Programming (ECOOP), pages 150--164, London, UK, 2001. Springer-Verlag.]] Google Scholar
Digital Library
- P. Meunier and D. Silva. From Python to PLT Scheme. In Proceedings of the Fourth Workshop on Scheme and Functional Programming, pages 24--29, 2003.]]Google Scholar
- M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An Introduction to Scala. http://scala.epfl.ch/docu/files/ScalaIntro.pdf, 2005.]]Google Scholar
- A. Ohori and K. Kato. Semantics for communication primitives in an polymorphic language. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 99--112, 1993.]] Google Scholar
Digital Library
- P. Pinto. Dot-Scheme: A PLT Scheme FFI for the .NET framework. In Workshop on Scheme and Functional Programming, November 2003.]]Google Scholar
- G. D. Plotkin. LCF considered as a programming language. Theoretical Computer Science, pages 223--255, 1977.]]Google Scholar
- R. Pucella. Towards a formalization for COM, part I: The primitive calculus. In Conference on Object-Oriented Programming: Systems, Languages, and Applications (OOPSLA), 2002.]] Google Scholar
Digital Library
- N. Ramsey. Embedding an interpreted language using higher-order functions and types. In Interpreters, Virtual Machines and Emulators (IVME '03), pages 6--14, 2003.]] Google Scholar
Digital Library
- J. Reppy and C. Song. Application-specific foreign-interface generation. In International Conference on Generative Programming and Component Engineering (GPCE), 2006.]] Google Scholar
Digital Library
- P. Steckler. MysterX: A Scheme toolkit for building interactive applications with COM. In Technology of Object-Oriented Languages and Systems (TOOL), pages 364--373, 1999. Available online: citeseer.ist.psu.edu/steckler99mysterx.html.]] Google Scholar
Digital Library
- V. Trifonov and Z. Shao. Safe and principled language interoperation. In European Symposium on Programming (ESOP), pages 128--146, 1999.]] Google Scholar
Digital Library
- A. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, pages 38--94, 1994. First appeared as Technical Report TR160, Rice University, 1991.]] Google Scholar
Digital Library
- S. Zdancewic, D. Grossman, and G. Morrisett. Principals in programming languages. In ACM SIGPLAN International Conference on Functional Programming (ICFP), 1999.]] Google Scholar
Digital Library
Index Terms
Operational semantics for multi-language programs





Comments