From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 76961BC57 for ; Tue, 6 Jul 2010 12:38:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAKOkMkxQRFuw/2dsb2JhbACgBHG/AYUlBA X-IronPort-AV: E=Sophos;i="4.53,545,1272837600"; d="scan'208";a="53692243" Received: from furbychan.cocan.org ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 06 Jul 2010 12:38:53 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1OW5YC-0005Of-3G; Tue, 06 Jul 2010 11:38:52 +0100 Date: Tue, 6 Jul 2010 11:38:52 +0100 To: Martin DeMello Cc: OCaml List Subject: Re: [Caml-list] adding a scripting language to an ocaml program Message-ID: <20100706103852.GA20439@annexia.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; ocaml:01 ocaml:01 doable:01 caml's:01 runtime:01 mli:01 git:98 git:98 wrote:01 ideally:01 compile:01 caml-list:01 caml:02 api:02 construct:02 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). http://git.annexia.org/?p=perl4caml.git;a=blob;f=perl.mli;h=64d7904eb633bcc410f796d19e289bca49931bb5;hb=HEAD#l258 Your users might not thank you for this ... Rich. -- Richard Jones Red Hat