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 UAA31386; Tue, 22 Jun 2004 20:34:00 +0200 (MET DST) 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 UAA31477 for ; Tue, 22 Jun 2004 20:33:59 +0200 (MET DST) Received: from junkmail.cs.umd.edu (junkmail.cs.umd.edu [128.8.128.69]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5MIXwSH014218 for ; Tue, 22 Jun 2004 20:33:58 +0200 Received: from ramen.cs.umd.edu (ramen.cs.umd.edu [128.8.129.77]) by junkmail.cs.umd.edu (8.12.10/8.12.5) with ESMTP id i5MIXv6p011532 for ; Tue, 22 Jun 2004 14:33:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by ramen.cs.umd.edu (8.12.10/8.12.5) with ESMTP id i5MIXv7c002428 for ; Tue, 22 Jun 2004 14:33:57 -0400 (EDT) Date: Tue, 22 Jun 2004 14:33:57 -0400 (EDT) From: Michael Furr To: Subject: Re: [Caml-list] unused function detection In-Reply-To: <008201c45882$b3532560$19b0e152@warp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 40D87B96.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 cannasse:01 opaque:01 re-implement:01 -mike:01 nicolas:01 compile:02 compile:02 module:03 module:03 wrote:03 algorithm:03 subset:03 types:03 types:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 22 Jun 2004, Nicolas Cannasse wrote: > 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*. I just finished(well almost) writing a tool which does something very similar. The motivation was if I have some module M and a program P, what is the most general(opaque) signature for M which still lets P compile. This information can be extremely useful since you know exactly which types are used opaquely and thus you can safely re-implement those data structures. Also, if you have some internal function in a module and it is not used anywhere in the program, it won't show up in the resulting signature. -mike ------------------- 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