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 UAA31960; Tue, 22 Jun 2004 20:38:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 UAA31957 for ; Tue, 22 Jun 2004 20:38:08 +0200 (MET DST) Received: from moby.atcorp.com (moby.atcorp.com [204.72.172.2]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5MIc6EV025820 for ; Tue, 22 Jun 2004 20:38:07 +0200 Received: from [192.168.172.137] (conger.atcorp.com [204.72.172.102]) by moby.atcorp.com (8.11.6/8.11.2) with ESMTP id i5MIgiP03771; Tue, 22 Jun 2004 13:42:44 -0500 In-Reply-To: <008201c45882$b3532560$19b0e152@warp> References: <1087924126.3755.151.camel@pelican.wigram> <874qp3mrdg.fsf@linux-france.org> <008201c45882$b3532560$19b0e152@warp> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <525AEC07-C47B-11D8-A9FD-000393914EAA@atcorp.com> Content-Transfer-Encoding: 7bit Cc: Nicolas Cannasse , "" , David MENTRE From: Eric Dahlman Subject: Re: [Caml-list] unused function detection Date: Tue, 22 Jun 2004 13:38:14 -0500 To: caml-list X-Mailer: Apple Mail (2.618) X-Miltered: at nez-perce with ID 40D87C8E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 heuristics:01 cannasse:01 sourceforge:01 cannasse:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 bin:01 caml-bugs:01 ocaml:01 ocaml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Some old lisp systems had this ability they would identify that bit of your program needed to support a given set of functions and allow you to purge the rest. There were some constraints on what the program could do (no applying random symbols for example) and possibly some heuristics as well. The name for this process was "tree shaking" if anyone is interested in looking into what was involved. A quick google search on my part surprised me with the size of both the christmas tree and pecan industries on the net, but little of real interest. -Eric On Jun 22, 2004, at 12:59 PM, Nicolas Cannasse wrote: >> skaller writes: >> >>> Can Ocaml find unused functions, or does someone happen >>> to have a tool lying around that does so? >> >> Use ocaml profiling tools to find function called zero times? >> >> Yours, >> d. > > That's not complete enough, since the behavior - then the code > executed - of > the application might depend of different kind of inputs : network, > user, > command line, ... > Since there is no guarantee that after removing the functions called > zero > time, you program will even compile , what he needs is actually a > statical > analysis tool using a code coverage algorithm, given one or more entry > points. This analysis can find without even executing the program the > most > small subset of functions needed in order to compile the applications. > That's actually quite an interesting piece of code to write in a > functional > language, and it would be nice if it can detects also unused *types*. > > Regards, > 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 > ------------------- 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