From: <syl...@po...> - 2004-04-09 19:30:00
|
Hello, On Fri, Apr 09, 2004 at 08:59:51PM +0200, Nicolas Cannasse wrote: > > The point about EmuC is : > - do we write and maintain C stubs for each of the external librairies we > might need > or > - do we use EmuC only and write stubs in OCaml using EmuC > If we choose the EmuC way, then we have only one - quite small - C file to > maintain. That's might still be quite big, so maybe we don't have to put > EmuC in the default install at the beginning, but after we have stubs for > let's say 5 or more librairies, it will be worth it. > > Other choice is to keep away from C, but there is some times (zlib, > cryptography, ipv6 support, and many others... ) that we can't or that the > effort to write it again in ocaml is simply to big compare to writing stubs > and maintaining EmuC. I don't want also to put C code into ExtLib, but maybe > one day we'll have to :-) > Well, i have nothing against emuc... I think it can come along extlib, but i don't think it is good to have it in extlib ( just my point of view ). However, have you considered some tools like camlidl ? I use it to wrap some C stuff, and it is very simple and powerful ( but it is not very flexible... ). It allows you to cp zlib.h camlzlib.idl vim camlzlib.idl -> explain that this structure, should this one in ocaml, this function returns, if the return is this, then it is an error etc camlidl camlzlib.idl -> camlzlib.c camlzlib.ml camlzlib.mli compile It is very easy to write stubs with it... I think it is a good tool to write easily C stub in Ocaml ( moreover it is written by a guy you should know : X. Leroy ) http://caml.inria.fr/camlidl/ I don't say the solution is perfect, but i have so many problem using C on different architecture comparing to ocaml portability ( which is sometime partial -- essentially when it depends on C code ). Kind regard Sylvain Le Gall |