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 CAA21324; Thu, 13 Nov 2003 02:24:47 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA21166 for ; Thu, 13 Nov 2003 02:24:46 +0100 (MET) Received: from smtp.siren.ocn.ne.jp (siren.ocn.ne.jp [211.129.13.170]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAD1O0121254 for ; Thu, 13 Nov 2003 02:24:02 +0100 (MET) Received: from PWARP (p3184-ipad02kyoto.kyoto.ocn.ne.jp [61.207.212.184]) by smtp.siren.ocn.ne.jp (Postfix) with SMTP id 098691D41; Thu, 13 Nov 2003 10:23:53 +0900 (JST) Message-ID: <00b001c3a984$ccf56f80$0274a8c0@PWARP> From: "Nicolas Cannasse" To: "John J Lee" , References: Subject: Re: [Caml-list] Executable size? Date: Thu, 13 Nov 2003 10:23:48 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 haskell:01 runtime:01 non-obvious:01 python:01 runtime:01 motion-twin:01 ocamole:01 motion-twin:01 api:01 hchomsky:01 ocaml-win:01 3.07:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > How does O'Caml compare with languages like Haskell (ghc), C and C++ for > executable size? Does compiled code depend on a runtime library (and how > big is that, if so)? > > Are there any easily-identifiable, non-obvious, factors that affect > executable size (I'm talking about end-use factors, rather those resulting > from the design decisions taken by the language designers and > implementors)? > > I currently use Python by preference, but I'm interested in a language > (other than C/C++!) that doesn't depend on a big runtime library and > generates "reasonably" small executables -- modems are here to stay for a > while yet. If you need COM support , look at OCaml'OLE : http://tech.motion-twin.com/ocamole If you need to make Windows DLL , look at ODLL : http://tech.motion-twin.com/odll If you need access to the win32 API, look at the ocaml port here : http://www.speakeasy.org/~hchomsky/ocaml-win32.html About the size of the executables (in native mode) : The main problem for a Window developper is that usually when you link a library staticly, the inclusion is made on a function basis, and not on a module basis as ocaml do. Then if you have big Ocaml libraries, you should split them into several indepent modules if feasible to avoid linking all. I also found recently (is it a 3.07 "feature" - i didn't compare with 3.06 ?) that classes compiled natively are taking an huge amount of space : a ~2000 lines library defining ~25 classes with actually not so much code is compiling into a 100 Ko library in bytecode and into 440 Ko in native... Using dynamic linking of C stubs will help here , but there is actually no way of dynlinking Ocaml librairies ( the Dynlink module is not actually doing any linking.... only loading ). >>From my own experience, executables size are growing faster in OCaml than in C/C++, with a big leap every time you're linking with an additional library.... but their size worth it ! Nicolas Cannasse ------------------- 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