Re: ML extension language

From: Stefan Monnier (monnier+/news@TEQUILA.SYSTEMSZ.CS.YALE.EDU)
Date: Fri Feb 28 1997 - 21:46:21 MET


To: caml-list@inria.fr
Subject: Re: ML extension language
From: Stefan Monnier <monnier+/news@TEQUILA.SYSTEMSZ.CS.YALE.EDU>
Date: 28 Feb 1997 15:46:21 -0500

Lyn A Headley <laheadle@midway.uchicago.edu> writes:
> Do people see this as worthwhile project, and one that is fairly
> different from existing facilities? It is interesting that *all*
> existing extension languages are weakly typed, and it would be neat to
> see what a polymorphically typed one could offer. Thus far, I plan
> to use almost the entire caml-light runtime system, and write a different
> compiler (in C) for a simpler, but (hopefully!) still powerful language.

I recently considered adding an extension language to the ctwm window-manager
in order to replace its clunky and limited .ctwmrc configuration facility. I
gave up because the only convincing (implementation) language available was
O'Caml, but it would have required to start by rewriting the event loop in
O'Caml so as to have O'Caml call C rather than the opposite.

I'd love to see an "embedded O'Caml". Rather than write a new language, it
seems that it would be easier/better to hack O'Caml directly so as to keep the
whole language and even hopefully get the changes folded in the official
distribution. From the little I know of the working of the run-time system, it
looks like the main problem with calling O'Caml from C has to do with GC, but
it seems doable. The easiest path might be to have "main" call O'Caml (just as
it already is) and then have O'Caml's main function do just the basic
initialization and then immedialtely call the main C function (so that the C
code actually runs within O'Caml).

        Stefan



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET