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 8012A7FADE for ; Fri, 21 Nov 2014 22:54:30 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of aryx.padator@gmail.com) identity=pra; client-ip=209.85.220.66; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aryx.padator@gmail.com"; x-sender="aryx.padator@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of aryx.padator@gmail.com designates 209.85.220.66 as permitted sender) identity=mailfrom; client-ip=209.85.220.66; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aryx.padator@gmail.com"; x-sender="aryx.padator@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-pa0-f66.google.com) identity=helo; client-ip=209.85.220.66; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aryx.padator@gmail.com"; x-sender="postmaster@mail-pa0-f66.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQDAFG0b1TRVdxCeWdsb2JhbABcgmt4WbdTAQEBBoMDMo8fgWIBDYZnAoEFFgEBAQEBEQEBCQsMCBIwhAMBAQQSLgEbEgsBAwwGBQsNDSEhAhEBBQEKEgYTEhCICQEDEgEECKoqPTGNLYMRimwKGScDCmiFWgEBAQEBAQQBAQEBAQEBAQEBAREBBQ6GLIQ3g10dghwEB4I4UySBHwWFLwIEhm+KPmeFHYIUgTQ/jV9IgnCCDkGFWFcBgkoBAQE X-IPAS-Result: AkQDAFG0b1TRVdxCeWdsb2JhbABcgmt4WbdTAQEBBoMDMo8fgWIBDYZnAoEFFgEBAQEBEQEBCQsMCBIwhAMBAQQSLgEbEgsBAwwGBQsNDSEhAhEBBQEKEgYTEhCICQEDEgEECKoqPTGNLYMRimwKGScDCmiFWgEBAQEBAQQBAQEBAQEBAQEBAREBBQ6GLIQ3g10dghwEB4I4UySBHwWFLwIEhm+KPmeFHYIUgTQ/jV9IgnCCDkGFWFcBgkoBAQE X-IronPort-AV: E=Sophos;i="5.07,433,1413237600"; d="scan'208,217";a="108907993" Received: from mail-pa0-f66.google.com ([209.85.220.66]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Nov 2014 22:54:01 +0100 Received: by mail-pa0-f66.google.com with SMTP id rd3so3626755pab.1 for ; Fri, 21 Nov 2014 13:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=prRR605aYkctsdzdm85ogVTGHd491H4NxJiGU1wpUXg=; b=a+y1mtbPEbGPu/mZklTrVulFCxV4KJEjmgEBMkjrGl2f8QCo2y/7EDdHgJoR3lxwNk XCVBGPdG/Pkc87tC9w4edRHncOjTguhouwUmJzhUM6+zXGtAptUq9ycv1kZ7FKKkU6UE hfm8CrwE/Cs4TTp4ezg23Rg41gIYVfsuFuTxQ/5S3GdIwglBwZ8XxqVbdsxRNcvQvxwM nKKwvGPzB8/dbSQCfCjZMezSfh1luBNdTlK8IE1ogMQYVTf0vWRGXe71GbvWc8UtfYFU LAGMqp3bBQOR8mgPY78EeUwXvYbWipKtslcD2m4KjWxyj+fHyNPsO4/Ob4tSqrNSCYQc SsYw== X-Received: by 10.70.89.42 with SMTP id bl10mr11415270pdb.18.1416606838662; Fri, 21 Nov 2014 13:53:58 -0800 (PST) Received: from ?IPv6:2601:9:5780:18d2:6572:2f07:6d8e:1efa? ([2601:9:5780:18d2:6572:2f07:6d8e:1efa]) by mx.google.com with ESMTPSA id wl10sm5659948pbc.58.2014.11.21.13.53.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 13:53:57 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_4963FD8D-A114-41B7-BDD1-C24040BD7979" Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: yoann padioleau In-Reply-To: Date: Fri, 21 Nov 2014 13:53:55 -0800 Cc: Kenneth Adam Miller , caml users Message-Id: <6FBE45A3-79AF-4C22-8904-E781DA322430@gmail.com> References: To: Gabriel Scherer X-Mailer: Apple Mail (2.1878.6) Subject: Re: [Caml-list] Go Oracle like facility for Ocaml? --Apple-Mail=_4963FD8D-A114-41B7-BDD1-C24040BD7979 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi, Regarding pfff that gabriel mentioned: some of my recent work have been foc= used actually on reproducing some of the features of go oracles (a great tool), but mainly for C. The idea was to use datalog= to declaratively specify complex inter procedural data flow analysis: http= s://github.com/facebook/pfff/blob/master/h_program-lang/datalog_code.dtl=20 and https://github.com/facebook/pfff/blob/master/lang_c/analyze/datalog_c.ml I was able to scale this analysis using bddbddb to C programs of 100 000 li= nes (the plan9 kernel mostly). I would like to extend this approach to data/control flow analysis of ocaml= , so one can know for instance where a function can be called from (a trick= y problem when your code becomes more complex and you start returning functions, encapsulate functions in wrappers, store function in fields, etc). pfff has some good support for ocaml via the typed tree and can generate a =93code graph=94=20 https://github.com/facebook/pfff/wiki/CodeGraph https://github.com/facebook/pfff/blob/master/lang_cmt/analyze/graph_code_cm= t.ml but I have not yet written the datalog fact generator for ocaml. Contributi= ons are welcome though :) On Nov 18, 2014, at 1:06 AM, Gabriel Scherer wr= ote: > (One can find a description of Go oracle's design in > https://docs.google.com/document/d/1WmMHBUjQiuy15JfEnT8YBROQmEv-7K6bV-Y_= K53oi5Y/view > and its user manual in > https://docs.google.com/document/d/1SLk36YRjjMgKqe490mSRzOPYEDe0Y_WQNRv-= EiFYUyw/view#heading=3Dh.kthq8ap0mdwi > ) >=20 > The ecosystem of OCaml tooling is not as refined as Go's (but > contributions are welcome). There is no centralized tool provider with > a common interface, but several contributors have developped separate > tool to anayze different aspects of OCaml programs: >=20 > - ocamlspotter: https://bitbucket.org/camlspotter/ocamlspot > - ocp-index: http://typerex.ocamlpro.com/ocp-index.html > - pfff: https://github.com/facebook/pfff > - merlin: http://the-lambda-church.github.io/merlin/ >=20 > These tool provide a relatively complete coverage of the information > that can easily be retrieved from the typedtree of a program (>=3D4.01 > versions of the OCaml compiler have the option to generate a reified > typedtree for external tools): the occurences of a declared/defined > name, the definition place of a name, the type of an expression, etc. > As far as I'm aware, there is not much in the direction of the more > advanced static analysis feature Go's oracle supports: points-to > information, "who may update this mutable field", etc. I'm not > familiar with Pfff's capabilities, it may be the more advanced in this > regard. >=20 > (There is also more experimental work going on, for example Thomas > Blanc's work on static analysis of exception flow at OCamlPro: > https://github.com/OCamlPro/socaml-analyzer ) >=20 > I think merlin is the best-positioned tool to deal with > partially-incorrect files (typical of an edition session) and > incrementality. It also incorporates some query/analysis feature, but > it's unclear whether those should grow inside a monolithic tool (eg. > it could encompass the current feature set of ocp-index and > ocamlspotter, if it does not already), or rather try to communicate > with external analysis/query plugins. It also interacts with existing > editors through a reasonable query-answer interface, but does not > provide a direct command-line interface (anyone interested in this > could work on it, it may be relatively easy to implement). >=20 > There are fairly orthogonal aspects to a "answering questions about > programs" toolbox, among which: > 1) user-interface, interactive use, and interface with existing editors > 2) support for incrementality and robustness under partially-incorrect fi= les > 3) knowledge of what the "project", or whole program, is; which > dependencies are required to understand the work? (build system > knowledge) > 4) implementation of various program analyses and transformations >=20 > Is it possible to provide them in separate programs and have them > interact to form a useful whole? Or would it be easier, faster and > more robust to implement them all in a monolithic program? What are > the necessary interdependence between these aspects and what interface > should them provide to each other? >=20 > On Tue, Nov 18, 2014 at 6:00 AM, Kenneth Adam Miller > wrote: >> If anybody knows what Go's oracle is you'll know that its a great >> accelerator for your time; it allows expressive and meaningful searches = to >> be done over a source repository. It's fast and dead useful. Opengrok is >> much the same, but to a lesser extent (having links is nice, but not qui= te >> as powerful as oracle, I could be wrong). >>=20 >> Is there anything like this for OCaml? >=20 > --=20 > 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 --Apple-Mail=_4963FD8D-A114-41B7-BDD1-C24040BD7979 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
Hi,
Regarding pfff that gabriel mentioned: some of my recent work have b= een focused actually on reproducing some of the features
of go oracles = (a great tool), but mainly for C. The idea was to use datalog to declarativ= ely specify complex inter procedural data flow analysis: https://github.com/facebook/pfff/blob/master/h_program-lang/datalog_code.d= tl 
and

I= was able to scale this analysis using bddbddb to C programs of 100 000 lin= es (the plan9 kernel mostly).

I would like to exte= nd this approach to data/control flow analysis of ocaml, so one can know fo= r instance where a function can be called from (a tricky problem when
=
your code becomes more complex and you start
returning funct= ions, encapsulate functions in wrappers,
store function in fields= , etc).

pfff has some good support for ocaml via t= he typed tree
and can generate a =93code graph=94 
https://github= .com/facebook/pfff/wiki/CodeGraph
https://gi= thub.com/facebook/pfff/blob/master/lang_cmt/analyze/graph_code_cmt.ml
but I have not yet written the datalog fact generator for ocaml. C= ontributions are welcome though :)

On Nov 18, 2014, a= t 1:06 AM, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:

(One can find a description of Go ora= cle's design in
 https://docs.google.com/doc= ument/d/1WmMHBUjQiuy15JfEnT8YBROQmEv-7K6bV-Y_K53oi5Y/view
and its us= er manual in
 https= ://docs.google.com/document/d/1SLk36YRjjMgKqe490mSRzOPYEDe0Y_WQNRv-EiFYUyw/= view#heading=3Dh.kthq8ap0mdwi
)

The ecosystem of OCaml toolin= g is not as refined as Go's (but
contributions are welcome). There is no= centralized tool provider with
a common interface, but several contribu= tors have developped separate
tool to anayze different aspects of OCaml = programs:

- ocamlspotter: https://bitbucket.org/camlspotter/ocamlspot
- ocp-inde= x: http://typerex.oc= amlpro.com/ocp-index.html
- pfff: https://github.com/facebook/pfff
- merlin: http://the-lambda-church.github.io= /merlin/

These tool provide a relatively complete coverage of th= e information
that can easily be retrieved from the typedtree of a progr= am (>=3D4.01
versions of the OCaml compiler have the option to genera= te a reified
typedtree for external tools): the occurences of a declared= /defined
name, the definition place of a name, the type of an expression= , etc.
As far as I'm aware, there is not much in the direction of the mo= re
advanced static analysis feature Go's oracle supports: points-to
i= nformation, "who may update this mutable field", etc. I'm not
familiar w= ith Pfff's capabilities, it may be the more advanced in this
regard.
=
(There is also more experimental work going on, for example Thomas
B= lanc's work on static analysis of exception flow at OCamlPro:
https://github.com/OCamlPro/s= ocaml-analyzer )

I think merlin is the best-positioned tool to d= eal with
partially-incorrect files (typical of an edition session) andincrementality. It also incorporates some query/analysis feature, but
= it's unclear whether those should grow inside a monolithic tool (eg.
it = could encompass the current feature set of ocp-index and
ocamlspotter, i= f it does not already), or rather try to communicate
with external analy= sis/query plugins. It also interacts with existing
editors through a rea= sonable query-answer interface, but does not
provide a direct command-li= ne interface (anyone interested in this
could work on it, it may be rela= tively easy to implement).

There are fairly orthogonal aspects to a = "answering questions about
programs" toolbox, among which:
1) user-in= terface, interactive use, and interface with existing editors
2) support= for incrementality and robustness under partially-incorrect files
3) kn= owledge of what the "project", or whole program, is; which
dependencies = are required to understand the work? (build system
knowledge)
4) impl= ementation of various program analyses and transformations

Is it pos= sible to provide them in separate programs and have them
interact to for= m a useful whole? Or would it be easier, faster and
more robust to imple= ment them all in a monolithic program? What are
the necessary interdepen= dence between these aspects and what interface
should them provide to ea= ch other?

On Tue, Nov 18, 2014 at 6:00 AM, Kenneth Adam Miller
&l= t;kennethadammiller@gmail.co= m> wrote:
If anybody knows what Go's or= acle is you'll know that its a great
accelerator for your time; it allow= s expressive and meaningful searches to
be done over a source repository= . It's fast and dead useful. Opengrok is
much the same, but to a lesser = extent (having links is nice, but not quite
as powerful as oracle, I cou= ld be wrong).

Is there anything like this for OCaml?

--
Caml-list mailing list.  Subscription management and archi= ves:
https://symp= a.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.= com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bug= s

= --Apple-Mail=_4963FD8D-A114-41B7-BDD1-C24040BD7979--