Next Previous Contents

2. Overview

The basic way in which almost any foreign language interface works is this. The signature of each foreign-language procedure is expressed in some formal notation. From this signature, stub code is generated that marshals the parameters ``across the border'' between the two languages, calls the procedure using the foreign language's calling convention, and then unmarshals the results back across the border. Dealing with the different calling convetions of the two languages is usually the easy bit. The complications come in the marshaling of parameters, where data valuesed built by one language is transformed into a form that is comprehensible to the other.

A major design decision is the choice of notation in which to describe the signatures of the procedures that are to be called across the interface. There are three main possibilities:

For H/Direct, we opt for the use of IDL as the notation to describe foreign-language interfaces (see the H/Direct ICFP paper for the motivations behind this choice.) Specifically, H/Direct uses IDL to help the programmer solve the following four tasks:

This document presents the programmer view of how H/Direct supports these four different uses of IDL, followed by a section that presents the design and implementation of the layers of stub code that H/Direct generates when given an IDL specification.


Next Previous Contents