caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com>
Cc: Runhang Li <marklrh@gmail.com>, OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] [Q] How to use merlin with mikmatch_str ?
Date: Thu, 27 Aug 2015 15:59:37 +0200	[thread overview]
Message-ID: <CAPFanBFmqMhtJ7YCAWiEAwEjRhitvZVYFUMw8YpzP1Dcy9j5=A@mail.gmail.com> (raw)
In-Reply-To: <55DF1548.30901@gmail.com>

Merlin solves the harder problem of incremental type-checking: if you
make a small modification to your code buffer, it will compute the
difference between the previous and the current state and try to only
re-{parse,typecheck} this.
This approach is elegant and, in the long run, necessary to guarantee
the fluidity necessary for interactive usage (although in practice
compilation is fast enough that you might be able to make do with a
batch re-checking fallback in many scenarios).

Currently Merlin breaks the abstraction of the OCaml parser and
type-checker, to turns them into incremental-aware tools; but Merlin
authors are trying to get their changes upstream as much as possible.

This also means that the world of supported syntaxes is closed, it
cannot be extended with arbitrary syntax extensions if they were
designed to support batch preprocessing only, with no interface to use
them incrementally. (But merlin authors have implemented support for
some common extensions in their incremental parser.)

On Thu, Aug 27, 2015 at 3:48 PM, Matej Kosik
<5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
> On 08/27/2015 02:55 PM, Runhang Li wrote:
>> Hi, Matej
>>
>> See if this issue answers your question: https://github.com/the-lambda-church/merlin/issues/358
>>
>> You can see all extensions that are being supported at src/kernel/extension.ml [1] .
>>
>> [1] : https://github.com/the-lambda-church/merlin/blob/master/src/kernel/extension.ml#L49
>
> Hi,
>
> If I understand this correctly, then the support for a particular syntactic extension need to be hardwired into merlin?
>
> Isn't that strange?
>
> (compared to tools such as:
>
>         - ocamlc
>         - ocamlopt
>         - ocamldep
>         - ocamldoc
>
>  which need not to be sperately modified to support any new (valid) syntactic extension. Do they?
> )
>
> Why is merlin different in this respect?
>
> --
> 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:[~2015-08-27 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 12:45 Matej Kosik
     [not found] ` <1440680128794.50230274@Nodemailer>
2015-08-27 13:48   ` Matej Kosik
2015-08-27 13:59     ` Gabriel Scherer [this message]

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='CAPFanBFmqMhtJ7YCAWiEAwEjRhitvZVYFUMw8YpzP1Dcy9j5=A@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=5764c029b688c1c0d24a2e97cd764f@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=marklrh@gmail.com \
    /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).