From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA20638; Sat, 23 Feb 2002 19:35:20 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA20957 for caml-list@pauillac.inria.fr; Sat, 23 Feb 2002 19:35:19 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA05846 for ; Wed, 20 Feb 2002 13:07:00 +0100 (MET) Received: from mail.gruposbd.com ([195.76.154.102]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g1KC6v512270 for ; Wed, 20 Feb 2002 13:06:58 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by mail.gruposbd.com (Postfix) with ESMTP id 9F12713C013 for ; Wed, 20 Feb 2002 13:05:43 +0100 (CET) Received: from node89.sbdintra.com (node89.sbdintra.com [192.168.1.89]) by mail.gruposbd.com (Postfix) with ESMTP id 1291313C011 for ; Wed, 20 Feb 2002 13:05:42 +0100 (CET) Subject: [Caml-list] Bytecode size-RFC (Embedded ocaml) From: Christian Gillot To: caml-list@inria.fr Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0 (Preview Release) Date: 20 Feb 2002 13:02:11 +0100 Message-Id: <1014206535.618.0.camel@node89> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS perl-11 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Because of its inherent safety I think Ocaml is a good candidate for embedded Linux (ie 32bit processor and good memory size, not hard embedded applications, by example the iPAQ). I've setup a cross-compiler and apart some problems on floats (hopefully resolved thanks to Xavier) it works great. There's a problem though : the code size. It's not a big deal, because run time consume 150k and standards dlls (dllunix.so, etc.) another 150k. If you compile a hello world program you get a 10k program (that's OK) If you compile a hello world program that use a Unix module function you get a 50k program (not so OK) And if you compile a lablgtk hello world program you get a 250k (that's not OK). Note that if you use a function or more of a module it does not really increase the code size of the program. So AFAIK there's two solution : 1. at the compilation time get off all the functions of a module that aren't used. (I'm not really sure that Ocaml links all the functions of .cma in a program but it seems so.) 2. Dynamically load ocaml-side of modules. It seems to be the right solution but far more difficult to implement than the first one. At the run time the program would load all the required functions of a module from the .cma. At compilation time one must sign in a way all the dynamic module functions. This could be done by using as a signature the whole qualified name of the function, by example Unix.getenv. (but would put UnixLabels if the programmer would have put a module Unix = UnixLabels. What matters is the whole qualified name for the runtime). To insure safety a module could include a version number, so that bytecode doesn't need to include type information. I'm not asking Ocaml implementors to do it but rather : - is there somebody working on such issue ? - how could it be done in theory ? (Request For Comments ,o) I'm willing to do it and would appreciate any hint. Note that embedded linux would definitely be a nice playground for ocaml IMHO. Best regards, -- Christian Gillot GNU/Linux programmer ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners