caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Arnaud Spiwack <aspiwack@lix.polytechnique.fr>
To: yoann padioleau <aryx.padator@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Detecting dead code, discovering a project's structure...
Date: Fri, 23 Jan 2015 15:02:36 +0100	[thread overview]
Message-ID: <CAMoPVjcP+sDe8EU81TuuZoEMPsez84Ffs880p0tFihgcWkuKHw@mail.gmail.com> (raw)
In-Reply-To: <C603DBDA-61FD-4510-BE2C-E305ABCA2A4E@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3361 bytes --]

I'm confused. I've got a version of pfff compiled from today's github
version. I get the following:

$ codegraph -lang cmt -build .
Fatal error: exception Failure("language not supported: cmt")


On 22 January 2015 at 22:09, yoann padioleau <aryx.padator@gmail.com> wrote:

> Hi Arnaud,
>
> You first need to build the graph code database.
> But for that you need to have the .cmt files generated for  your project.
> You can generate them just like you generate the .annot by modifying your
> makefile, e.g.
> by adding -bin_annot to OCAMLCFLAGS for instance.
> Once the .cmt are here, do
>  ~/pfff/codegraph -lang cmt -build /path/to/your/project
>
> then you can use
>  ~/pfff/scheck -lang cmt /path/to/your/project
>
>
> On Jan 19, 2015, at 1:58 AM, Arnaud Spiwack <aspiwack@lix.polytechnique.fr>
> wrote:
>
> 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 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 <agarwal1975@gmail.com> wrote:
>>
>> Maybe Pfff:
>> https://github.com/facebook/pfff
>>
>> On Thu, Jan 8, 2015 at 10:33 AM, Goswin von Brederlow <goswin-v-b@web.de>
>> wrote:
>>
>>> On Thu, Jan 08, 2015 at 02:48:12PM +0100, Stéphane Glondu wrote:
>>> > Le 08/01/2015 14:31, Sébastien Hinderer a écrit :
>>> > > 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 = ssig type t type s val x : int end
>>> moduel F(M : M) = struct type t = 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
>>>
>>
>>
>>
>
>

[-- Attachment #2: Type: text/html, Size: 5471 bytes --]

  reply	other threads:[~2015-01-23 14:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 13:31 Sébastien Hinderer
2015-01-08 13:48 ` Stéphane Glondu
2015-01-08 13:54   ` Sébastien Hinderer
2015-01-08 15:33   ` Goswin von Brederlow
2015-01-08 15:50     ` Ashish Agarwal
2015-01-15 18:16       ` yoann padioleau
2015-01-19  9:58         ` Arnaud Spiwack
2015-01-22 21:09           ` yoann padioleau
2015-01-23 14:02             ` Arnaud Spiwack [this message]
2015-01-23 14:26               ` Daniel Bünzli
2015-01-23 14:52                 ` Arnaud Spiwack
2015-01-29  6:24                   ` yoann padioleau
2015-02-05 20:52                     ` David Baelde
2015-01-08 15:50     ` Jeremy Yallop
2015-01-08 14:03 ` Sébastien Hinderer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMoPVjcP+sDe8EU81TuuZoEMPsez84Ffs880p0tFihgcWkuKHw@mail.gmail.com \
    --to=aspiwack@lix.polytechnique.fr \
    --cc=aryx.padator@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).