From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C164F82416 for ; Sat, 7 Apr 2018 17:27:16 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=francois.berenger.fun@gmail.com; spf=Pass smtp.mailfrom=francois.berenger.fun@gmail.com; spf=None smtp.helo=postmaster@mail-ot0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of francois.berenger.fun@gmail.com) identity=pra; client-ip=74.125.82.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.berenger.fun@gmail.com"; x-sender="francois.berenger.fun@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of francois.berenger.fun@gmail.com designates 74.125.82.169 as permitted sender) identity=mailfrom; client-ip=74.125.82.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.berenger.fun@gmail.com"; x-sender="francois.berenger.fun@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-ot0-f169.google.com) identity=helo; client-ip=74.125.82.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.berenger.fun@gmail.com"; x-sender="postmaster@mail-ot0-f169.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3APef/Gh92cAj2jv9uRHKM819IXTAuvvDOBiVQ1KB3?= =?us-ascii?q?1egcTK2v8tzYMVDF4r011RmVBd6ds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+55Pebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsYSmpPXshfWS9PDJ6i?= =?us-ascii?q?YYQTFOcBIfpUopPhq1cSsRezBw+hD/7vxD9SgX/22LU33eQ7EQ7c2gwvA9UOsH?= =?us-ascii?q?XPrN7oKaocXvy7wqbQwzvCYP1YxSr25Y/GchA7u/6MW65/cc3QyUk0DQ/KlUuf?= =?us-ascii?q?qZb7MDOT2eQCrXKb4/BuVeKyjW4qsA5xoj21ycctjonFnJ4aylfB9Shgxos+ON?= =?us-ascii?q?O2SEl+YdG+EZtQsTmXN4R3QsM+R2Fnoj01xqcatp68eSgHzoksyR3Ha/GfcYWF?= =?us-ascii?q?7QjvWPuPLTp4nn5oe6yziwyv/UWhzuDxUNS/3kxQoSpfiNbMs2gA1xzN5ciDTf?= =?us-ascii?q?tw5kKh1iyO1wDX8+1EJlw0mbbCJ54v37I9l54evV7MHi/xn0X2g6uWeVs+9ue0?= =?us-ascii?q?7OTnZ63qpp6aN4BqlgHzKqYjl8OlDeglLAQDX3KX9Oei2LH54EH0QbFHguUzkq?= =?us-ascii?q?bDsZDaIcobprS+Aw9Qyosj5Qy/AC2g0NsEmnkHLUlFdAicgIf3IVHBPvb4Dfih?= =?us-ascii?q?jFS2ijtrye3GPrv6D5XCK3jMirbhfbJn50FAzwozyMhT54hIBbEZPPLzRkjxuc?= =?us-ascii?q?TEARAjNgy0x//rCNF81oMFRWKCGbSZMaPXsV+Q/O0jOeiMZIkPuDb8Mfcp/fDu?= =?us-ascii?q?jWVq0WMaKJOkwJEabjiCGetraxGjJ1yquZE7FngHlgkzSvCsgVbETD0FNFioWK?= =?us-ascii?q?dpyCsyDomhDJyLbK2XrZqu8R3zSpNMb2ZNDVGXV33lbYiCVPoWLiyPJOdulzUF?= =?us-ascii?q?Uf6qTIp3hkLmjxPz17cydrmcwSYfr5+2kYEtv7SCxyF3ziR9CoGm60/ISmh1mm?= =?us-ascii?q?0SQDpvhfJwpEV8zhGI1q0q2qUER+wW3OtAV0IBDbCZ1/ZzUomgVQfIf9PPQ1Gj?= =?us-ascii?q?EI3/XGMBC+kpytpLWH5TXtWviheZgXivCr4R0ruXXNk6q/yNmXf2IMl5xjDN06?= =?us-ascii?q?xz11Q=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CyAACh4shahqlSfUpdDg4BAQEEAQEKA?= =?us-ascii?q?QGEI28oCoNVlQyBdIEPh0iNDwsjhGACgjIHGQcBBDQUAQIBAQEBAQEBAQETAQE?= =?us-ascii?q?BCAsLCCgjDII1JAGCSAEBAQECASMdARsPDgEDAQsGBQsDCgICJgICHwMBEQEFA?= =?us-ascii?q?RwGE4R0AQMNCA+fNzyLBYF/BQEXgm8Fg0gKGSYNVFeCFgIGEneGYoITg2Iuh2+?= =?us-ascii?q?CVAKMWoptCBqFPIJOhhGBbYpWiRyGWw8DHoEEM4FzcE8xghIJggsag06EIIV4S?= =?us-ascii?q?TAwAQGOeAEB?= X-IPAS-Result: =?us-ascii?q?A0CyAACh4shahqlSfUpdDg4BAQEEAQEKAQGEI28oCoNVlQy?= =?us-ascii?q?BdIEPh0iNDwsjhGACgjIHGQcBBDQUAQIBAQEBAQEBAQETAQEBCAsLCCgjDII1J?= =?us-ascii?q?AGCSAEBAQECASMdARsPDgEDAQsGBQsDCgICJgICHwMBEQEFARwGE4R0AQMNCA+?= =?us-ascii?q?fNzyLBYF/BQEXgm8Fg0gKGSYNVFeCFgIGEneGYoITg2Iuh2+CVAKMWoptCBqFP?= =?us-ascii?q?IJOhhGBbYpWiRyGWw8DHoEEM4FzcE8xghIJggsag06EIIV4STAwAQGOeAEB?= X-IronPort-AV: E=Sophos;i="5.48,419,1517871600"; d="scan'208";a="321755069" Received: from mail-ot0-f169.google.com ([74.125.82.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 07 Apr 2018 17:27:15 +0200 Received: by mail-ot0-f169.google.com with SMTP id h26-v6so4250435otj.12 for ; Sat, 07 Apr 2018 08:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GM8W5ae7RRU43d8bzOck725zPALRCHHuu8GgRw3tadE=; b=YPKxkUmBH14lBOo2FXGDZGk48tybsC7crwqYI0HsaxLPJBN8n0QhjHtndfeFj/INji Pf7y+ktHJTl7JvoEjdgEwJINFj/G1+kUguttXFiP/wRj7DCFg0MTuE5EDtTPt+9zM/MZ QlohGnO5R9ogtbEM1VdSop+vTxiQNYTcLgH4RGtvRXTldgEjDcFn1QyHv8V6ODRWPr0K lUz7gxfmjVbWDjgZ6e/qyrzEsGBElJT/1CfE3+gNoWLWbJNHotmPCgEt9wWb/FvQ7Ewk FlskWs1bIXGk0w6sTpaqxqcXhjM7obnVZTIea1c5ZvXnc21Oin3NkMHQRVTG9EfXxEM6 cXlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GM8W5ae7RRU43d8bzOck725zPALRCHHuu8GgRw3tadE=; b=kCmNt07GGP3tZiq9aKUTlZ5Ivb/dprA4h/f9Qn/seOfWJATUjMoO9ykjfQ1O4c5qd+ g4gCQ4KfMk6jLKfMgy6uNDrttdRdmd1pAQek9Iu0VtzVyiDRiyMV8451/lg80ZxdZk3l bi/2YHvpmtJLgFX8xeA2pVV/6SWHNRJXKRtlFWytKFPdInnlCyUbkGCkyCqm4YJaLhaB 2HCypZe2ZOk9tjy9wf7dVe1gkS9DoBrqG4rgzsvW3sysrjPZYWbUVuCgRGnas/bxpiGT 5KjoPlM8gcqzHmAZ3iY+kVdml3SX/IxfDOIFkJc0a7A48+7Kz0k56TFemlgObA8CAsEg mPbA== X-Gm-Message-State: ALQs6tCVBQZKF83gwGnx9WCtQYa2Z2Tx0EZG+BGq3sRIUgeOcYO7Px9o YKYU+jRfqRdFDiOawgCBZlpR2atEjG7C/LpUjELR8ipW X-Google-Smtp-Source: AIpwx4/OMMU6O3omJKJJr3VD8U0Grrk0x+QcaI7mV6art3CwD1m07biyUi0K01my/TRt80XnUJ9vDV7AbmOKPrReLko= X-Received: by 2002:a9d:22e8:: with SMTP id y95-v6mr19774788ota.84.1523114834249; Sat, 07 Apr 2018 08:27:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.138.244 with HTTP; Sat, 7 Apr 2018 08:27:13 -0700 (PDT) In-Reply-To: References: <7edba90e-d17b-9389-832b-ac662465b4c1@bioreg.kyushu-u.ac.jp> From: Francois BERENGER Date: Sun, 8 Apr 2018 00:27:13 +0900 Message-ID: To: Reuben Rowe Cc: caml-list@inria.fr Content-Type: text/plain; charset="UTF-8" Subject: Re: [Caml-list] how to automatically extract a subset of some ocaml code base? 2018-04-06 19:52 GMT+09:00 Reuben Rowe : > > 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. >> >