John Reppy's Publications

Language Interoperability

Calling Variadic Functions from a Strongly-typed Language.
Matthias Blume, Mike Rainey, and John Reppy. In Proceedings of the 2008 ACM SIGPLAN Workshop on ML, pages 47--58, September 2008.
bib | .pdf ]

The importance of providing a mechanism to call C functions from high-level languages has been understood for many years and, these days, almost all statically-typed high-level-language implementations provide such a mechanism. One glaring omission, however, has been support for calling variadic C functions, such as printf. Variadic functions have been ignored because it is not obvious how to give static types to them and because it is not clear how to generate calling sequence when the arguments to the function may not be known until runtime. In this paper, we address this longstanding omission with an extension to the NLFFI foreign-interface framework used by Standard ML of New Jersey (SML/NJ) and the MLton SML compiler. We describe two different ways of typing variadic functions in NLFFI and an implementation technique based on the idea of using state machines to describe calling conventions. Our implementation is easily retargeted to new architectures and ABIs, and can also be easily added to any HOT language implementation that supports calling C functions.

Application-specific foreign-interface generation.
John Reppy and Chunyan Song. In Proceedings of the Fifth International Conference on Generative Programming and Component Engineering, pages 49--58, October 2006.
bib | .pdf ]

A foreign interface (FI) mechanism to support interoperability with libraries written in other languages (especially C) is an important feature in most high-level language implementations. Such FI mechanisms provide a Foreign Function Interface (FFI) for the high-level language to call C functions and marshaling and unmarshaling mechanisms to support conversion between the high-level and C data representations. Often, systems provide tools to automate the generation of FIs, but these tools typically lock the user into a specific model of interoperability. It is our belief that the policy used to craft the mapping between the high-level language and C should be distinct from the underlying mechanism used to implement the mapping.

In this paper, we describe a FI generation tool, called FIG (for Foreign Interface Generator) that embodies a new approach to the problem of generating foreign interfaces for high-level languages. FIG takes as input raw C header files plus a declarative script that specifies the generation of the foreign interface from the header file. The script sets the policy for the translation, which allows the user to tailor the resulting FI to his or her application. We call this approach application-specific foreign-interface generation. The scripting language uses rewriting strategies as its execution model. The other major feature of the scripting language is a novel notion of composable typemaps that describe the mapping between high-level and low-level types.

A framework for interoperability.
Kathleen Fisher, Riccardo Pucella, and John Reppy. In Nick Benton and Andrew Kennedy, editors, Proceedings of the First International Workshop on Multi-Language Infrastructure and Interoperability (BABEL'01), Volume 59 of Electronic Notes in Theoretical Computer Science, New York, NY, September 2001. Elsevier Science Publishers.
bib | .pdf ]

Practical implementations of high-level languages must provide access to libraries and system services that have APIs specified in a low-level language (usually C). An important characteristic of such mechanisms is the foreign-interface policy that defines how to bridge the semantic gap between the high-level language and C. For example, IDL-based tools generate code to marshal data into and out of the high-level representation according to user annotations. The design space of foreign-interface policies is large and there are pros and cons to each approach. Rather than commit to a particular policy, we choose to focus on the problem of supporting a gamut of interoperability policies. In this paper, we describe a framework for language interoperability that is expressive enough to support very efficient implementations of a wide range of different foreign-interface policies. We describe two tools that implement substantially different policies on top of our framework and present benchmarks that demonstrate their efficiency.

Data-level interoperability.
Kathleen Fisher, Riccardo Pucella, and John Reppy. Technical Memorandum, Bell Labs, Lucent Technologies, April 2000.
bib ]

This file was generated by bibtex2html 1.98.

Last updated on August 31, 2018
Comments to John Reppy.