caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] how to automatically extract a subset of some ocaml code base?
@ 2018-04-06  2:08 Francois BERENGER
  2018-04-06 10:52 ` Reuben Rowe
  0 siblings, 1 reply; 4+ messages in thread
From: Francois BERENGER @ 2018-04-06  2:08 UTC (permalink / raw)
  To: caml-list

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] how to automatically extract a subset of some ocaml code base?
  2018-04-06  2:08 [Caml-list] how to automatically extract a subset of some ocaml code base? Francois BERENGER
@ 2018-04-06 10:52 ` Reuben Rowe
  2018-04-07 15:27   ` Francois BERENGER
  0 siblings, 1 reply; 4+ messages in thread
From: Reuben Rowe @ 2018-04-06 10:52 UTC (permalink / raw)
  To: caml-list

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.

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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] how to automatically extract a subset of some ocaml code base?
  2018-04-06 10:52 ` Reuben Rowe
@ 2018-04-07 15:27   ` Francois BERENGER
  2018-04-08  8:52     ` Cedric Cellier
  0 siblings, 1 reply; 4+ messages in thread
From: Francois BERENGER @ 2018-04-07 15:27 UTC (permalink / raw)
  To: Reuben Rowe; +Cc: caml-list

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] how to automatically extract a subset of some ocaml code base?
  2018-04-07 15:27   ` Francois BERENGER
@ 2018-04-08  8:52     ` Cedric Cellier
  0 siblings, 0 replies; 4+ messages in thread
From: Cedric Cellier @ 2018-04-08  8:52 UTC (permalink / raw)
  To: Francois BERENGER; +Cc: caml-list

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

I'm not sure, but I think this is part of what js_of_ocaml does.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-08  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06  2:08 [Caml-list] how to automatically extract a subset of some ocaml code base? Francois BERENGER
2018-04-06 10:52 ` Reuben Rowe
2018-04-07 15:27   ` Francois BERENGER
2018-04-08  8:52     ` Cedric Cellier

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