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 A447F7EE49 for ; Thu, 21 Feb 2013 10:21:25 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.49 as permitted sender) identity=mailfrom; client-ip=209.85.214.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-bk0-f49.google.com) identity=helo; client-ip=209.85.214.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f49.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoIBAF3mJVHRVdYxkGdsb2JhbABFEwEBAa5jiVUBiB9+CBYOAQEBAQkJDQcUBCOCHwEBBAEMNAEbEgsBAwELBgULGiEiAREBBQEKEgYTEodtAQMJBgyhHIwygnuEMAoZJwMKWYh7AQUMjn4EB4NAA5YygR2NXxYpglOBWA X-IPAS-Result: AoIBAF3mJVHRVdYxkGdsb2JhbABFEwEBAa5jiVUBiB9+CBYOAQEBAQkJDQcUBCOCHwEBBAEMNAEbEgsBAwELBgULGiEiAREBBQEKEgYTEodtAQMJBgyhHIwygnuEMAoZJwMKWYh7AQUMjn4EB4NAA5YygR2NXxYpglOBWA X-IronPort-AV: E=Sophos;i="4.84,706,1355094000"; d="scan'208";a="3840406" Received: from mail-bk0-f49.google.com ([209.85.214.49]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Feb 2013 10:21:24 +0100 Received: by mail-bk0-f49.google.com with SMTP id w11so4030393bku.8 for ; Thu, 21 Feb 2013 01:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=re7OrzsKcr79F071jDsQKYSnpYq7TEIw9tgpm/U05NU=; b=NYLtvuWSFpRvlvGmsxa+3QilaIMQJTeLHFA7yIGln9gCySqk/mQFGYgqyBMAT/iRcX i50+oVNlisiOjSreHGZfoUt76dGyJ/ipH5vCtb+rm+sDnwUgoj8CI5LMrVBKdpbZH0os nuS+nPE9E0+5lDB6Mw8MW7bhhFjsi9WSu+Gpux/Z9tGGY3EtyZ3QmngjtC4MLNUAOF6r lbT0vZMyC+uwb5sF2KpWupYvWvVa02IWhTuuWWD3aSmHKF/yY3GZ0dtqSz6kkYEY+m4k o2huFh7UM7YzCEwV2AIEsBXpNIQC27hkNPMqcgau31CvaIrSl1gwiuoGJ9uI/w9Xljor VU9w== X-Received: by 10.204.129.16 with SMTP id m16mr9976011bks.103.1361438484222; Thu, 21 Feb 2013 01:21:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.205.83.144 with HTTP; Thu, 21 Feb 2013 01:20:44 -0800 (PST) In-Reply-To: <512557EB.7030607@lakaban.net> References: <512557EB.7030607@lakaban.net> From: Gabriel Scherer Date: Thu, 21 Feb 2013 10:20:44 +0100 Message-ID: To: caml users Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric_Bour?= Content-Type: multipart/alternative; boundary=0015173feca63c51ac04d63899f6 Subject: Re: [Caml-list] [ANN] Beta-release of Merlin --0015173feca63c51ac04d63899f6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I looked into Merlin in the last few days, so here is a bit more information if you, like me, are interested in design information about projects before deciding whether to use (and potentially contribute to) them. Interface-wise: using Merlin (at least on emacs) feels a lot like ProofGeneral (or CoqIde): there is a "checked zone" from the start of the buffer to the first error, and reliable type information is available in all this checked zone. The interface is rather simple and easy to use. (If you're considering porting Merlin to another editor: merlin is an OCaml program that inputs and outputs JSON queries, so it seems rather easy to port to any editor having plugin support in any language with JSON support. Given its youth, you should however expect Merlin's protocol to evolve over the next development period, so editor plugin developers would need to follow Merlin's internal changes for now.) The major difference between Merlin and -annot-based tools such as Ocamlspotter or Typerex2 is that Merlin does the work of parsing OCaml sentences into chunks and sending them incrementally to the type-checker, instead of sending the whole buffer at once and using the output. This means that Merlin is much more robust with respect to files that have errors and cannot be compiled as a whole: you'll get reliable type information from the start of the file upto the first error (and some resilience heuristic to have more after). The OCaml type-checker is in fact able to provide some typing information even for incorrect programs, so -annot-based tools do support some of those features, but in a less reliable and more coarse-grained way. The design trade-off is that Merlin has to copy/adapt more logic from the compiler: it embeds an OCaml parser derived from the compiler's one (you won't get parsing bugs as with regexpy elisp modes), and currently also copies and slightly modifies the type-checker (I hope this can be changed in the future, possibly by adding some flexibility to the type-checker regarding eg. production of warnings). This means more maintenance work to port Merlin to future OCaml versions. On the other hand, it's probably not reasonable to expect the compiler type-checker to be re-engineered for optimal incrementality support, so having an external implementation of incrementality that piggybacks on the batch typer interface makes sense. My personal intuition is that Merlin's design is a good long-term choice for an editor service (as opposed to code-analysis services). You want tools such as ocamldoc, dead code analysis, or everything concerned with analysis of an existing correct codebase to be based on -bin-annot and work on the typedtrees directly (without local support for parsing and typing programs). You want tools designed to work on incomplete programs in the process of being created to embed incrementality logic (insofar as it hasn't been pushed into the compiler), understanding partial files and local modifications to cleverly control the parsing&typing process with reactivity in mind. The One True Editor Mode will merge both aspects, working on .cmt of already-compiled dependencies on one side, and partial/incremental information in edition buffers on the other. Merlin can evolve in this way, as its type-directed analyses (those performed in the "checked zone") work directly on the typedtree, so could work with .cmt files. On Thu, Feb 21, 2013 at 12:10 AM, Fr=E9d=E9ric Bour wrote: > We are very pleased to announce the beta release of Merlin. Merlin is a > tool > which provides smart completion, among other things, in your favorite > editor. > As of today, Vim and Emacs are supported. > > See it at work: > https://github.com/def-lkb/**merlin#screenshots > > Its features include: > - completion of values, constructorsand modules based on local scope > - retrieving type of identifiers and/or expressions under cursor > - integration of findlib to manage buildpath > - highlighting of syntax errors, type errors and warnings inside the edit= or > - to a certain amount, resilience to syntax and type errors > > It works only with Ocaml 4.00.1 (may works with newer versions). > > If you happen to have an opam installation with the right version > (opam switch 4.00.1), you can try it right away with: > > $ opam remote add kiwi http://kiwi.iuwt.fr/~asmanur/**opam/.git< > http://kiwi.iuwt.fr/%**7Easmanur/opam/.git > > > $ opam install merlin > > Then to get started and set-up your editor: > - https://github.com/def-lkb/**merlin#setting-up-vim > - https://github.com/def-lkb/**merlin#emacs-interface > > Check it out at: https://github.com/def-lkb/**merlin > > The current version still needs to be tested under various systems and > configurations, your feedback iswelcome. > > > -- > 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 > --0015173feca63c51ac04d63899f6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I looked into Merlin in the last few days, so here is a bit more informatio= n if you, like me, are interested in design information about projects befo= re deciding whether to use (and potentially contribute to) them.

Interface-wise: using Merlin (at least on emacs) feels a lot like=20 ProofGeneral (or CoqIde): there is a "checked zone" from the star= t of=20 the buffer to the first error, and reliable type information is=20 available in all this checked zone. The interface is rather simple and easy= to use.

(If you're considering porting Merlin to another editor= : merlin is an OCaml program that inputs and outputs JSON queries, so it se= ems rather easy to port to any editor having plugin support in any language= with JSON support. Given its youth, you should however expect Merlin's= protocol to evolve over the next development period, so editor plugin deve= lopers would need to follow Merlin's internal changes for now.)

The major difference between Merlin and -annot-based tools such as Ocam= lspotter or Typerex2 is that Merlin does the work of parsing OCaml sentence= s into chunks and sending them incrementally to the type-checker, instead o= f sending the whole buffer at once and using the output. This means that Me= rlin is much more robust with respect to files that have errors and cannot = be compiled as a whole: you'll get reliable type information from the s= tart of the file upto the first error (and some resilience heuristic to hav= e more after). The OCaml type-checker is in fact able to provide some typin= g information even for incorrect programs, so -annot-based tools do support= some of those features, but in a less reliable and more coarse-grained way= .
The design trade-off is that Merlin has to copy/adapt more logic from the c= ompiler: it embeds an OCaml parser derived from the compiler's one (you= won't get parsing bugs as with regexpy elisp modes), and currently als= o copies and slightly modifies the type-checker (I hope this can be changed= in the future, possibly by adding some flexibility to the type-checker reg= arding eg. production of warnings). This means more maintenance work to por= t Merlin to future OCaml versions. On the other hand, it's probably not= reasonable to expect the compiler type-checker to be re-engineered for opt= imal incrementality support, so having an external implementation of increm= entality that piggybacks on the batch typer interface makes sense.

My personal intuition is that Merlin's design is a good long-term c= hoice for an editor service (as opposed to code-analysis services). You wan= t tools such as ocamldoc, dead code analysis, or everything concerned with = analysis of an existing correct codebase to be based on -bin-annot and work= on the typedtrees directly (without local support for parsing and typing p= rograms). You want tools designed to work on incomplete programs in the pro= cess of being created to embed incrementality logic (insofar as it hasn'= ;t been pushed into the compiler), understanding partial files and local mo= difications to cleverly control the parsing&typing process with reactiv= ity in mind. The One True Editor Mode will merge both aspects, working on .= cmt of already-compiled dependencies on one side, and partial/incremental i= nformation in edition buffers on the other. Merlin can evolve in this way, = as its type-directed analyses (those performed in the "checked zone&qu= ot;) work directly on the typedtree, so could work with .cmt files.

On Thu, Feb 21, 2013 at 12:10 AM, Fr=E9d=E9r= ic Bour <frederic.bour@lakaban.net> wrote:
We are very pleased to announce the beta release of Merlin. Merlin is a too= l
which provides smart completion, among other things, in your favorite edito= r.
As of today, Vim and Emacs are supported.

See it at work:
https://github.com/def-lkb/merlin#screenshots

Its features include:
- completion of values, constructorsand modules based on local scope
- retrieving type of identifiers and/or expressions under cursor
- integration of findlib to manage buildpath
- highlighting of syntax errors, type errors and warnings inside the editor=
- to a certain amount, resilience to syntax and type errors

It works only with Ocaml 4.00.1 (may works with newer versions).

If you happen to have an opam installation with the right version
(opam switch 4.00.1), you can try it right away with:

$ opam remote add kiwi http://kiwi.iuwt.fr/~asmanur/opam/.git <http://k= iwi.iuwt.fr/%7Easmanur/opam/.git>
$ opam install merlin

Then to get started and set-up your editor:
- https://github.com/def-lkb/merlin#setting-up-vim
- https://github.com/def-lkb/merlin#emacs-interface

Check it out at: https://github.com/def-lkb/merlin

The current version still needs to be tested under various systems and
configurations, your feedback iswelcome.


--
Caml-list mailing list. =A0Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs

--0015173feca63c51ac04d63899f6--