From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id CA84C7F6D8 for ; Mon, 19 Jan 2015 10:59:03 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of arnaud.spiwack@gmail.com) identity=pra; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="arnaud.spiwack@gmail.com"; x-sender="arnaud.spiwack@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of arnaud.spiwack@gmail.com designates 209.85.212.180 as permitted sender) identity=mailfrom; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="arnaud.spiwack@gmail.com"; x-sender="arnaud.spiwack@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f180.google.com) identity=helo; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="arnaud.spiwack@gmail.com"; x-sender="postmaster@mail-wi0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYAAPnUvFTRVdS0lGdsb2JhbABbg1hcgwKzWY1qgV8BCYVxgRwHQwEBAQEBEQEBAQEHCwsJEjCEDAEBAQMBEhEdAS0LAQMBCwEFAwILDQ0dAgIhARIBBQEKEgYTEhCHdgMJCA2dX5BPPjGLLoRiijQnAwoVhAcBCgEBARgBBQ6NQR2CCYI4OxGBMAWEPgaINoRbS4QMgUSBSopvhCcSI4EVW4M2PTEBAYJBAQEB X-IPAS-Result: AuYAAPnUvFTRVdS0lGdsb2JhbABbg1hcgwKzWY1qgV8BCYVxgRwHQwEBAQEBEQEBAQEHCwsJEjCEDAEBAQMBEhEdAS0LAQMBCwEFAwILDQ0dAgIhARIBBQEKEgYTEhCHdgMJCA2dX5BPPjGLLoRiijQnAwoVhAcBCgEBARgBBQ6NQR2CCYI4OxGBMAWEPgaINoRbS4QMgUSBSopvhCcSI4EVW4M2PTEBAYJBAQEB X-IronPort-AV: E=Sophos;i="5.09,426,1418079600"; d="scan'208";a="117587063" Received: from mail-wi0-f180.google.com ([209.85.212.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Jan 2015 10:59:03 +0100 Received: by mail-wi0-f180.google.com with SMTP id bs8so15082880wib.1 for ; Mon, 19 Jan 2015 01:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jjlnAXhGfBdojV7P24EN4I3enje1GEyeWFpNN4H0QXQ=; b=I933l22WSKPHhyHcnDU639WXQh4glyBEoJbAtxLl+6YsbL9u4VL4jC3TMISzHjvWe7 PVaZf2fGcVkTPKE6LQ9NZwOXKjySbea++k3NeFQMGS5q4F8v7yrRFJlJ9webcKKcipPs /lwa4rO+18vW295UsXrUxHtzuoa8+3yBXTmoM8yDLarwu+k+mksrCObn1R7KQToXE/3O eFiwDN/1+2RFEzejtFdaWv8lLSZZdxLlsmHuzybE3xsbDFwftwzI86qF5qxvFR8EU16+ zI7GxiMzWFrm1DhkLzneppCD7o+cxH53WA3wkXCM8xTS/Ef+TlKTbbENw5wP3CZz6KPn KNEQ== X-Received: by 10.180.108.232 with SMTP id hn8mr33525724wib.39.1421661538076; Mon, 19 Jan 2015 01:58:58 -0800 (PST) MIME-Version: 1.0 Sender: arnaud.spiwack@gmail.com Received: by 10.217.180.9 with HTTP; Mon, 19 Jan 2015 01:58:17 -0800 (PST) In-Reply-To: <171D9BA6-40AA-4B44-BA06-24AE4A156715@gmail.com> References: <20150108133111.GA3745@pl-59055.rocqadm.inria.fr> <54AE8A9C.5090304@glondu.net> <20150108153342.GB4890@frosties> <171D9BA6-40AA-4B44-BA06-24AE4A156715@gmail.com> From: Arnaud Spiwack Date: Mon, 19 Jan 2015 10:58:17 +0100 X-Google-Sender-Auth: RhF3RBRvftEwzYrvi8A5gY-rjWY Message-ID: To: yoann padioleau Cc: Ashish Agarwal , Goswin von Brederlow , caml users Content-Type: multipart/alternative; boundary=e89a8f3b9c4df7e098050cfe5e73 X-Validation-by: arnaud@spiwack.net Subject: Re: [Caml-list] Detecting dead code, discovering a project's structure... --e89a8f3b9c4df7e098050cfe5e73 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear Yoann, Could you give the relevant commands to be used in an ocaml project (in particular, it seems that `scheck -lang ml` fails with "unsuported language") ? On 15 January 2015 at 19:16, yoann padioleau wrote: > Indeed the codegraph tool, part of Pfff, does some > global analysis of an ocaml project using the .Mt (generated by ocamlc > -bin_annot) and generates > an index of a codebase (a graph_code.marshall file). > Not all features of Ocaml are supported though (e.g. functors). > > Once the graph_code.marshall file has been generated, > you can use check, also part of pfff, to detect dead code > or other errors. > > > https://github.com/facebook/pfff/wiki/CodeGraph > https://github.com/facebook/pfff/wiki/Scheck > > > On Jan 8, 2015, at 7:50 AM, Ashish Agarwal wrote: > > Maybe Pfff: > https://github.com/facebook/pfff > > On Thu, Jan 8, 2015 at 10:33 AM, Goswin von Brederlow > wrote: > >> On Thu, Jan 08, 2015 at 02:48:12PM +0100, St=C3=A9phane Glondu wrote: >> > Le 08/01/2015 14:31, S=C3=A9bastien Hinderer a =C3=A9crit : >> > > Are there tools / techniques one could use to make it easier to >> > > discover / explore the source code of a big OCaml project? >> > > >> > > In particular, are there any tools available to help finding dead >> code >> > > or coe that may need some refactoring? >> > > >> > > Many thanks for any suggestion. >> > >> > One suggestion: http://home.gna.org/oug/index.fr.html >> > >> > >> > Cheers, >> >> That looks cool. But that still needs a lot of manual filtering to get >> results, e.g. to find an unused type or function specified in the >> input signature for a functor. >> >> It could be nice for ocaml to have warnings for this directly. E.g.: >> >> module type M =3D ssig type t type s val x : int end >> moduel F(M : M) =3D struct type t =3D M.t end >> >> Warning: unused value x in signature M for functor F >> Warning: unused type s in signature M for functor F >> >> Similar for types / values defined but not used in .ml files that do >> not appear in the .mli file. >> >> MfG >> Goswin >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >> > > > --e89a8f3b9c4df7e098050cfe5e73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear Yoann,

Could you give the relevant commands to= be used in an ocaml project (in particular, it seems that `scheck -lang ml= ` fails with "unsuported language") ?

On 15 January 2015 at 19:16, yoann = padioleau <aryx.padator@gmail.com> wrote:
Indeed the codegra= ph tool, part of Pfff, does some
global analysis of an ocaml project us= ing the .Mt (generated by ocamlc -bin_annot) and generates
an ind= ex of a codebase (a graph_code.marshall file).
Not all features o= f Ocaml are supported though (e.g. functors).

Once= the graph_code.marshall file has been generated,
you can use che= ck, also part of pfff, to detect dead code
or other errors.
=


https://github.com/facebook/pfff/wiki/Scheck


On Jan 8, 2015, at 7= :50 AM, Ashish Agarwal <agarwal1975@gmail.com> wrote:

Maybe Pfff:

On Thu, J= an 8, 2015 at 10:33 AM, Goswin von Brederlow <goswin-v-b@web.de> wrote:
On Thu, Jan 08, 2015 a= t 02:48:12PM +0100, St=C3=A9phane Glondu wrote:
> Le 08/01/2015 14:31, S=C3=A9bastien Hinderer a =C3=A9crit :
> > Are there tools / techniques one could use to make it easier to > > discover / explore the source code of a big OCaml project?
> >
> > In particular,=C2=A0 are there any tools available to help findin= g dead code
> > or coe that may need some refactoring?
> >
> > Many thanks for any suggestion.
>
> One suggestion: http://home.gna.org/oug/index.fr.html
>
>
> Cheers,

That looks cool. But that still needs a lot of manual filtering to g= et
results, e.g. to find an unused type or function specified in the
input signature for a functor.

It could be nice for ocaml to have warnings for this directly. E.g.:

module type M =3D ssig type t type s val x : int end
moduel F(M : M) =3D struct type t =3D M.t end

Warning: unused value x in signature M for functor F
Warning: unused type s in signature M for functor F

Similar for types / values defined but not used in .ml files that do
not appear in the .mli file.

MfG
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Goswin

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--e89a8f3b9c4df7e098050cfe5e73--