emacs-devel
[Top][All Lists]
Advanced

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

Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock


From: Akib Azmain Turja
Subject: Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2)
Date: Fri, 12 Aug 2022 22:00:43 +0600

Lynn Winebarger <owinebar@gmail.com> writes:

> On Wed, Aug 10, 2022 at 7:31 AM Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> I don't have this information.  Maybe someone else does.  But in
>> general, it is a very small wonder that a parser written in optimized
>> C is much faster than anything written in Emacs Lisp, given that Lisp
>> is an interpreted language that has no special support for writing
>> parsers.
>
> That can be cured over time, now that the bulk of the core of emacs
> uses lexical scoping.  With proper tail recursion, ELisp should be
> able to produce lexers and parsers roughly as efficient as C code, if
> not more efficient (depending on if you allow use of "computed goto"
> in the C code for the lexers and parsers).  That does require changes
> to the byte code VM, but it's doable.

It's hard for any compiled language to beat C code, and I believe it's
*impossible* for any interpreted language to do that.  And if it somehow
does that, I would believe that the result is *hard-coded* in it.

By the way, is native compiled Emacs Lisp faster than the code produced
by Guile's JIT?  If so, we can write the parser and the lexer in Scheme
and use the result in Emacs.

(Triggering a heated discussion again...)  Or maybe we can link Guile
to Emacs so that people can extend Emacs with the "GNU’s Ubiquitous
Intelligent Language for Extensions".

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social.

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

Attachment: signature.asc
Description: PGP signature


reply via email to

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