emacs-devel
[Top][All Lists]
Advanced

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

Re: [SPAM UNSURE] Re: [SPAM UNSURE] Maybe we're taking a wrong approach


From: Stephen Leake
Subject: Re: [SPAM UNSURE] Re: [SPAM UNSURE] Maybe we're taking a wrong approach towards tree-sitter
Date: Fri, 30 Jul 2021 11:48:55 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt)

Andrei Kuznetsov <r12451428287@163.com> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> How long does the generator take?
>
> I did not measure that, but as most people would be loading compiled
> parsers, and not running the generator, I don't think it would matter
> too much.  FWIW macroexpansion of the macro `defgrammar' blocks Emacs
> for a second or 2.

It can matter a lot for large grammars. wisitoken used to take hours to
generate the LR1 parse table for Ada; now it takes a couple minutes.
tree-sitter never finishes that grammar.

A naive LR grammar generator can easily be O (n**3) or worse in the
grammar size; I spent a lot of time optimizing wisitoken so it can
handle Ada reasonably.

-- 
-- Stephe



reply via email to

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