C interfaces to non-imperative languages

Peter Ross petdr at cs.mu.OZ.AU
Tue Oct 27 15:13:43 AEDT 1998


Matt,

I have forwarded this message to the mercury-developers mailing list.
The messages are archived at http://www.cs.mu.oz.au/  if you don't get
cc'd a reply.

DJ can you answer this question?

Pete.

On 26-Oct-1998, Matthias.Lang at ericsson.com <Matthias.Lang at ericsson.com> wrote:
> Hi,
> 
> Just to put the .ericsson.com thing in context, I work on the 5th
> floor of SEECS, and I'm writing to you because you posted to
> comp.lang.functional about something related.
> 
> 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).
> 



More information about the developers mailing list