Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: mixed customizable external data types in Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-12-07 (15:46)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: mixed customizable external data types in Caml
>From: Basile STARYNKEVITCH <>
>When using caml as an embedding langage (concretly, caml used as a
>scripting langage to existing numerical applications coded in Fortran
>or C) it would be very nice to be able to have a Caml value containing 
>both Caml values (ie pointers or tagged integers) and other stuff,
>such (as a Fortran matrix or whatever).
>Of course it is already possible to use an arbitrary pointer to
>whatever C or Fortran data.
>But it would be nice to be able to have all of Caml memory management
>stuff (in particular garbage collection and marshalling) in mixed data 

You can have garbage collection easily: put your foreign data in one
object, and your caml values in another object, along with a pointer
to the first object.

I'd say the real interest would be in marshalling, equality, and
ordering.  And I see a big problem with unmarshaling.  How does the
system find the unmarshaling function ?  There is no pointer to the
descriptor in the object, because the object does not exist yet.

-- Damien