ACM Home Page
Please provide us with feedback. Feedback
Operational semantics for multi-language programs
Full text PdfPdf (945 KB)
Source
ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 31 ,  Issue 3  (April 2009) table of contents
Article No. 12  
Year of Publication: 2009
ISSN:0164-0925
Authors
Jacob Matthews  University of Chicago
Robert Bruce Findler  University of Chicago
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 25,   Downloads (12 Months): 200,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1498926.1498930
What is a DOI?

ABSTRACT

Interoperability is big business, a fact to which .NET, the JVM, and COM can attest. Language designers are well aware of this, and they are designing programming languages that reflect it—for instance, SML.NET, F#, Mondrian, and Scala all treat interoperability as a central design feature. Still, current multi-language research tends not to focus on the semantics of these features, but only on how to implement them efficiently. In this article, we attempt to rectify that by giving a technique for specifying the operational semantics of a multi-language system as a composition of the models of its constituent languages. 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, equivalence, and termination behavior. In doing so it allows us to adapt standard theoretical techniques such as subject-reduction, logical relations, and operational equivalence for use on multi-language systems. Generally speaking, our proofs of properties in a multi-language context are mutually referential versions of their single language counterparts.

We demonstrate our technique with a series of strategies for embedding a Scheme-like language into an ML-like language. We start by connecting very simple languages with a very simple strategy, and work our way up to languages that interact in sophisticated ways and have sophisticated features such as polymorphism and effects. Along the way, we prove relevant results such as type-soundness and termination for each system we present using adaptations of standard techniques.

Beyond giving simple expressive models, our studies have uncovered several interesting facts about interoperability. For example, higher-order function contracts naturally emerge as the glue to ensure that interoperating languages respect each other's type systems. Our models also predict that the embedding strategy where foreign values are opaque is as expressive as the embedding strategy where foreign values are translated to corresponding values in the other language, and we were able to experimentally verify this behavior using PLT Scheme's foreign function interface.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
2
 
3
Barzilay, E. and Orlovsky, D. 2004. Foreign interface for PLT Scheme. In Proceedings of the Workshop on Scheme and Functional Programming.
 
4
 
5
Beazley, D. 1997. Pointers, constraints, and typemaps. In SWIG 1.1 Users Manual.
 
6
7
8
 
9
Blume, M. 2001. No-longer-foreign: Teaching an ML compiler to speak C “natively”. In Proceedings of the Workshop on Multi-Language Infrastructure and Interoperability (BABEL).
 
10
 
11
Chakravarty, M. M. T. 2002. The Haskell 98 foreign function interface 1.0.
 
12
Chambers, C. and The Cecil Group. 2004. The Cecil language: Specification and rationale, version 3.2. Tech. rep., Department of Computer Science and Engineering, University of Washington. February.
 
13
 
14
 
15
Felleisen, M. and Hieb, R. 1992. The revised report on the syntactic theories of sequential control and state. Theoret. Comput. Sci. 102, 235--271. Original version in: Technical Report 89-100, Rice University, June 1989.
 
16
Findler, R. B. and Blume, M. 2006. Contracts as pairs of projections. In Proceedings of the International Symposium on Functional and Logic Programming (FLOPS).
17
18
 
19
Fisher, K., Pucella, R., and Reppy, J. 2001. A framework for interoperability. In Proceedings of the Workshop on Multi-Language Infrastructure and Interoperability (BABEL).
20
21
22
 
23
24
25
26
 
27
28
 
29
 
30
 
31
Kornstaedt, L. 2001. Alice in the land of Oz - an interoperability-based implementation of a functional language on top of a relational language. In Proceedings of the Workshop on Multi-Language Infrastructure and Interoperability (BABEL).
 
32
Mason, I. and Talcott, C. 1991. Equivalence in functional languages with effects. J. Funct. Program. 1, 287--327.
 
33
Matthews, J. 2008. Equation-preserving multi-language systems. Tech. Rep. TR-2008-06, University of Chicago.
 
34
Matthews, J. and Ahmed, A. 2008. Parametric polymorphism through run-time sealing, or, theorems for low, low prices! In Proceedings of the European Symposium on Programming (ESOP).
35
 
36
Matthews, J., Findler, R. B., Flatt, M., and Felleisen, M. 2004. A visual environment for developing context-sensitive term rewriting systems. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA).
 
37
 
38
Meunier, P. and Silva, D. 2003. From Python to PLT Scheme. In Proceedings of the 4th Workshop on Scheme and Functional Programming. 24--29.
 
39
Odersky, M., Altherr, P., Cremet, V., Emir, B., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E., and Zenger, M. 2005. An Introduction to Scala. http://scala.epfl.ch/docu/files/ScalaIntro.pdf.
40
 
41
Pierce, B. and Sumii, E. 2000. Relating cryptography and polymorphism. Unpublished manuscript.
 
42
 
43
Pinto, P. 2003. Dot-Scheme: A PLT Scheme FFI for the .NET framework. In Proceedings of the Workshop on Scheme and Functional Programming.
 
44
Plotkin, G. D. 1977. LCF considered as a programming language. Theor. Comput. Sci. 223--255.
45
46
 
47
Reynolds, J. C. 1983. Types, abstraction and parametric polymorphism. In Proceedings of the IFIP Congress. 513--523.
 
48
 
49
 
50
51
 
52
Tait, W. 1967. Intensional interpretations of functionals of finite type I. J. Symb. Log. 32, 2, 198--212.
 
53
 
54
55

Collaborative Colleagues:
Jacob Matthews: colleagues
Robert Bruce Findler: colleagues