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
adding a scripting language to an ocaml program
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-07-06 (10:38)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] adding a scripting language to an ocaml program
On Sun, Jul 04, 2010 at 12:04:32AM +0530, Martin DeMello wrote:
> Has much work been done on adding a scripting language to an OCaml
> program? I googled about a bit, but no one seems to be even talking
> about this - for example, if I wanted to do something emacslike with a
> core in OCaml and (ideally) some sort of scheme as a scripting engine
> in place of elisp, would that be easily doable?

You can embed a Perl interpreter and call out to Perl code using
perl4caml's Perl.eval function.  The API is even "type safe" in as
much as you can construct and examine the values going between the
Perl and the OCaml code, and detect errors at runtime (at compile time
too in some circumstances).;a=blob;f=perl.mli;h=64d7904eb633bcc410f796d19e289bca49931bb5;hb=HEAD#l258

Your users might not thank you for this ...


Richard Jones
Red Hat