caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois BERENGER <francois.berenger.fun@gmail.com>
To: Reuben Rowe <R.N.S.Rowe@kent.ac.uk>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] how to automatically extract a subset of some ocaml code base?
Date: Sun, 8 Apr 2018 00:27:13 +0900	[thread overview]
Message-ID: <CAAZXAebdr4LvxQ0XKGjFcqnjHXi=MYf++hF4SsA+Lm04J-chBA@mail.gmail.com> (raw)
In-Reply-To: <bc1c93cc-45f8-8a35-e4d1-a5cf355e44d0@kent.ac.uk>

2018-04-06 19:52 GMT+09:00 Reuben Rowe <R.N.S.Rowe@kent.ac.uk>:
>
> Hi Francois,
>
> I am currently working on a refactoring tool for OCaml.
>
>     https://gitlab.com/trustworthy-refactoring/refactorer
>
> It contains functionality to compute the file dependency graph of a codebase, so perhaps this would potentially work for you? If you have the dependency graph, you can extract only the source files that the entry point (transitively) depends on.

Interesting tool. So yes, indeed I am asking for a refactoring tool for ocaml.
If anyone has a good knowledge about such tools for ocaml, a mini
review would be welcome.

The file level is a little bit too coarse.

I would like to extract all the functions callable from the main() and
dump all them in bottom up order into a new file (that I hope to
compile).

By the way, maybe the resulting executable from compiling such a
single minimalist file would be quite small.
Interesting secondary effect of the approach.

Maybe, what I need is called a reachability analysis by the experts.

> It is not especially user-friendly at the moment, but if you like I could work with you on getting it to do what you want.

Here is a wish:
orefactor --minimize -i src/main.ml --entry-point 'main()' -o src/mini.ml

Regards,
F.

> Reuben
>
>
> On 06/04/18 03:08, Francois BERENGER wrote:
>>
>> Hello,
>>
>> I have a large research prototype code base, with many tested, compiling
>> but abandoned things.
>>
>> I'd like to release only a small cool stuff out of it.
>>
>> I have an executable with an entry point into that code base
>> to use the cool stuffs.
>>
>> Is there a tool that would allow me to extract only the
>> needed source code so that I can do a minimal source-based release with
>> only "cool stuff" plus all its dependencies?
>>
>> Previously, I would do this by hand. But, with years passing, I become
>> more and more lazy. :)
>>
>> Thanks,
>> F.
>>
>

-- 
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

  reply	other threads:[~2018-04-07 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06  2:08 Francois BERENGER
2018-04-06 10:52 ` Reuben Rowe
2018-04-07 15:27   ` Francois BERENGER [this message]
2018-04-08  8:52     ` Cedric Cellier

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='CAAZXAebdr4LvxQ0XKGjFcqnjHXi=MYf++hF4SsA+Lm04J-chBA@mail.gmail.com' \
    --to=francois.berenger.fun@gmail.com \
    --cc=R.N.S.Rowe@kent.ac.uk \
    --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).