[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PL support

From: Stefan Monnier
Subject: Re: PL support
Date: Sat, 09 May 2020 16:08:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> They do have this problem, and they usually address it with hand written
> fix-up and glue code. (See the IntelliJ family.) I really want modes (and 
> multi-modes) driven entirely by declarative (and customizable!) grammars ---

tree-sitter is basically doing just that.
LSP is different because it usually goes further than just the grammar,
providing information based on scoping and typing rules rules.

Type checking is much less standardized than parsing.  For parsing we
know that a GLR engine should be able to handle the vast majority of
circumstances fairly efficiently.  For type checking every compiler
implements basically its own approach by hand, and the algorithms and
data-structures can be fairly different between a C++ compiler, a Rust
compiler, and a Haskell compiler (and while parsing-time is usually
negligible and linear in complexity, time to perform type checking is
something at which engineering efforts are throw to keep it in check
because it can blow up in complexity).

So, I think the current state of the art is pretty far from knowing what
would be a good *declarative* specification of typing rules for use by
a generic tool providing the same kind of functionality as LSP servers.


PS: We do know fairly well how to specify typing rules declaratively on
    paper (where efficiency is not a concern), tho, so there's hope.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]