From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105])
by yquem.inria.fr (Postfix) with ESMTP id A9574BC57
for ; Wed, 7 Jul 2010 23:11:37 +0200 (CEST)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0CAEOKNExKfVO0gWdsb2JhbACDHpxzCBUBAQkLCgcTAx+vGjuCDIVpLohTAQEDBYEkgwlyBIg9
X-IronPort-AV: E=Sophos;i="4.53,554,1272837600";
d="scan'208";a="65991302"
Received: from mail-pv0-f180.google.com ([74.125.83.180])
by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Jul 2010 23:11:37 +0200
Received: by pvg12 with SMTP id 12so44438pvg.39
for ; Wed, 07 Jul 2010 14:11:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:mime-version:received:in-reply-to
:references:from:date:message-id:subject:to:cc:content-type
:content-transfer-encoding;
bh=n4Cpv3Mjy+vnH5VVRob6/tncfZPIzhoeTM/EqvCkASQ=;
b=ksozVzMqCLPuuEwqCjISpD2R6FZxIZpM66B6lImm/MUOrkrH+e8PInul07yG5dWdG2
GhlO7vEDXPrg9HgbflUeoHO7YSSNjmq34XSS/N7WXkxKDTEXYVjNuaBACffk7p7BVPeE
uWSMtmlkIQoWgs1AUluAkRP59XFE5RGdmGXKU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:cc:content-type:content-transfer-encoding;
b=fXalVcqNHJyDN8MuwGrKgJ6ahcN42i9kM48rDfNDSrj6zwJjqvf6e8oxtGmlhsF+Gq
YVbLMQXDT0Haxea8pbYZ/KnSCc3KBieR3IoAqJwNSKelwwmmpdGShEm1kEccxjNsHSm5
bl027H+lOXPXHG5Lh4iRqof2ldgo8jVNUAKQY=
Received: by 10.114.108.15 with SMTP id g15mr8358867wac.35.1278537095239; Wed,
07 Jul 2010 14:11:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.170.210 with HTTP; Wed, 7 Jul 2010 14:11:15 -0700 (PDT)
In-Reply-To: <20100707234806.17b77e82@debian>
References:
<4C339FE3.6000402@citycable.ch>
<20100707234806.17b77e82@debian>
From: Paolo Donadeo
Date: Wed, 7 Jul 2010 23:11:15 +0200
Message-ID:
Subject: Re: [Caml-list] Binding the Lua library [was: adding a scripting
language to an ocaml program]
To: =?UTF-8?B?VMO2csO2ayBFZHdpbg==?=
Cc: OCaml List
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam: no; 0.00; ocaml:01 translating:01 bytecode:01 ocaml:01 statically:01 translated:01 runtime:01 trivial:01 sandbox:01 W6:98 caml-list:01 data:02 interaction:02 binding:02 library:03
> How about translating a program in lua (or lua bytecode) to OCaml
> sourcecode automatically? Would that be possible?
I see two problems with an approach like this:
1) it's complicated: consider that Lua was designed in the first place
to be extremely simple to be embedded in a C program, and also simple
to exchange data to and from the host program. The *only* problem I
found was the interaction with the OCaml GC which of course is not a
problem in C;
2) can the Lua program, statically translated into OCaml, be loaded
and reloaded at run time? I need a scripting language to give a user a
configuration/simple plugin language to be loaded and executed at
runtime, and Lua is ideal because it's trivial to sandbox it.
--=20
Paolo =E2=A0=A0=E2=A0=B5