From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id BD330BC2F for ; Fri, 3 Dec 2004 08:25:32 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iB37PW6A013063 for ; Fri, 3 Dec 2004 08:25:32 +0100 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 IAA11615 for ; Fri, 3 Dec 2004 08:25:31 +0100 (MET) Received: from smtp.unc.edu (smtpsrv12.isis.unc.edu [152.2.1.243]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB37PUMZ023371 (version=TLSv1/SSLv3 cipher=IDEA-CBC-SHA bits=128 verify=FAIL) for ; Fri, 3 Dec 2004 08:25:31 +0100 Received: from [192.168.0.103] (adsl-068-209-207-132.sip.rdu.bellsouth.net [68.209.207.132]) (authenticated bits=0) by smtp.unc.edu (8.12.9/8.12.9) with ESMTP id iB37OTBo008160 for ; Fri, 3 Dec 2004 02:24:29 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <281F644B-43EF-11D9-BA22-000D9345235C@inria.fr> References: <9E571848-430E-11D9-AF66-000A95CDFBE4@cs.unc.edu> <281F644B-43EF-11D9-BA22-000D9345235C@inria.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6FBBD2B0-44FC-11D9-AF66-000A95CDFBE4@cs.unc.edu> Content-Transfer-Encoding: 7bit From: Ritesh Kumar Subject: Re: [Caml-list] Strange observation on polymorphic '<' Date: Fri, 3 Dec 2004 02:24:58 -0500 To: caml-list@inria.fr X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 41B014EC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41B014EA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; kumar:01 caml-list:01 compilation:01 toplevel:01 invocation:01 invocation:01 compilation:01 ocaml:01 damien:01 damien:01 wrote:01 kumar:01 wrote:01 integers:01 compiler:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Oh sure... but I was of the mind that if you had a polymorphic function which on certain types have extremely small (one instruction) size (as is the case with the '>' operator) then it makes sense to inline that function at a point where it is invoked with that type. For eg. given the code ============ let max a b = if a>b then a else b;; print_int (max 2 3);; ============ Separate compilation means that the function max should use the C call (for the toplevel module). However, the invocation of max 2 3 shouldn't use a direct call to the function in the same module as the invocation is in the same module (i.e. there is opportunity to optimize it based on the known invocation types). Secondly, does separate compilation make that strong a sense in case of native compilation for OcaML ... most probably not because it anyways generates a standalone executable? Ritesh P.S. Sorry Damien for the duplicate... -- What you see is an illusion... well protected, well cherished only by you. On Dec 1, 2004, at 6:17 PM, Damien Doligez wrote: > On 30 Nov 2004, at 21:30, Ritesh Kumar wrote: > >> Am I missing something here? Let us assume that the function which >> internally uses the '<' operator is used only in the context of >> integers >> inside the program. > > You are missing this: because of separate compilation the compiler has > no > way to know whether the function will only be used on integers in your > program. When it compiles the function, it doesn't know what it will > be used for. > > -- Damien > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs