[m-dev.] Re: C interfaces to non-imperative languages

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 27 23:28:45 AEDT 1998


On 26-Oct-1998, Matthias.Lang at ericsson.com <Matthias.Lang at ericsson.com> wrote:
> Question (quick version): can you give me a short clue on how the C
> interface for Mercury works.
> 
> Question (long version): we use Erlang up here, which is a functional
> language, rather more at the 'loosely functional' end of the
> spectrum. Erlang has two models for interfacing to C. The "preferred"
> one is basically a pipe to a different process in which you run
> the C program. 
> 
> 	Advantages: well-defined interface, you can't crash the	Erlang VM. 
> 	Disadvantage: every 'call' costs you an OS-level context switch.
> 
> The other model is to link the C code into the Erlang
> VM. Advantages/disadvantages are reversed. I'm wondering how those
> approaches compare with Mercury's tradeoff(s).

For the normal Mercury <-> C interface, we link the C code together
with the Mercury code; they run together in a single process.

However, we have recently been developing a CORBA interface for Mercury,
called MCORBA.  With MCORBA, the foreign language code can be
in the same process, in a different process, or even running on
a different machine.  See <http://www.cs.mu.oz.au/mercury/mcorba.html>
for more details.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list