From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D2AC4BC69 for ; Wed, 7 Mar 2007 22:48:18 +0100 (CET) Received: from smtp.microsoft.com (smtp.microsoft.com [131.107.115.214]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l27LmG4C001279 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 7 Mar 2007 22:48:18 +0100 Received: from tk5-exhub-c104.redmond.corp.microsoft.com (157.54.70.185) by TK5-EXGWY-E803.partners.extranet.microsoft.com (10.251.56.169) with Microsoft SMTP Server (TLS) id 8.0.685.24; Wed, 7 Mar 2007 13:48:14 -0800 Received: from win-imc-02.wingroup.windeploy.ntdev.microsoft.com (157.54.69.169) by tk5-exhub-c104.redmond.corp.microsoft.com (157.54.70.185) with Microsoft SMTP Server id 8.0.685.25; Wed, 7 Mar 2007 13:48:14 -0800 Received: from WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com ([157.54.62.25]) by win-imc-02.wingroup.windeploy.ntdev.microsoft.com with Microsoft SMTPSVC(6.0.3790.3953); Wed, 7 Mar 2007 13:48:13 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] Dependencies and rebuilding Date: Wed, 7 Mar 2007 13:47:20 -0800 Message-ID: <43CD2D195487A448934920501C6EDB2303E34383@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com> In-Reply-To: <95513600703071324j3602604bw4d87a5dee3797c7f@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Caml-list] Dependencies and rebuilding thread-index: Acdg/xHTjoP4HI75RjmxeGe/59U1fQAAhrvg References: <43CD2D195487A448934920501C6EDB2303E342C2@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com> <95513600703071324j3602604bw4d87a5dee3797c7f@mail.gmail.com> From: Jakob Lichtenberg To: Olivier Andrieu Cc: , Donn Terry X-OriginalArrivalTime: 07 Mar 2007 21:48:13.0191 (UTC) FILETIME=[4E203170:01C76102] X-Miltered: at concorde with ID 45EF3320.005 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; dependencies:01 rebuilding:01 ocamlopt:01 ocamlopt:01 cmx:01 cmxa:01 cmx:01 printf:01 printf:01 cmxa:01 notepad:01 inlining:01 inlining:01 oandrieu:01 oandrieu:01 Olivier, First of all: Your statement is correct. The following works great: =3D=3D=3D >type base.ml let base () =3D 2+8;; >ocamlopt -c base.ml >ocamlopt -a base.cmx -o base.cmxa >del base.cmx base.obj >type consumer.ml let _ =3D Printf.printf "Base.base: %d" (Base.base());; >ocamlopt -c consumer.ml >ocamlopt base.cmxa consumer.cmx -o app.exe >app.exe Base.base: 10 >notepad base.ml >ocamlopt -c base.ml >ocamlopt -a base.cmx -o base.cmxa >del base.cmx base.obj >ocamlopt base.cmxa consumer.cmx -o app.exe >app.exe Base.base: 11 =3D=3D=3D Now, wrt. to cross-module inlining of code: Ohh, that's a very good reason, I was not aware of this language feature. Is there a higher level of inlining going on if I leave the .cmx files next to the .cmxa file? Maybe I should not use .cmxa files at all, for maximum inlining? If .cmx files is present then what is the .cmxa file used for? Thanks, - Jakob -----Original Message----- From: oandrieu@gmail.com [mailto:oandrieu@gmail.com] On Behalf Of Olivier Andrieu Sent: Wednesday, March 07, 2007 1:25 PM To: Jakob Lichtenberg Cc: caml-list@inria.fr; Donn Terry Subject: Re: [Caml-list] Dependencies and rebuilding On 3/7/07, Jakob Lichtenberg wrote: > If I change the body of functions in a base library, but not the > externally visible signature, I still have to recompile the consumers of > the base library prior to linking the main application. While this is > not a problem in the trivial case I'll show beneath, it may be a concern > from a componentization and scalability point of view. Regular C code > does not have this limitation. This e-mail to request why the design is > as it is? I'd say cross-module inlining of code ? This happens because ocamlopt finds the base.cmx file during the compilation of consumer. If you put your base module in a library and remove the .cmx file, consumer won't depend on the implementation of base, only on its interface. --=20 Olivier