From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Wed, 28 Dec 2022 08:38:26 -0500 Message-ID: References: <87tu1vxs3a.fsf@ledu-giraud.fr> <831qozjob7.fsf@gnu.org> <87cz8jxoat.fsf@ledu-giraud.fr> <83wn6ri7pn.fsf@gnu.org> <5e0a3185-de82-b339-0fa2-956779e63d6f@cornell.edu> <868rj6vfep.fsf@gmail.com> <4895891b-e5ea-9c37-f51b-df2e479ee758@yandex.ru> <83y1qt11xq.fsf@gnu.org> <9eb013da-d0fc-8e17-c6e3-1e8f913aebfa@yandex.ru> <83pmc50xxc.fsf@gnu.org> <71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru> <83h6xg29z3.fsf@gnu.org> <838ris22n4.fsf@gnu.org> <8335901zz3.fsf@gnu.org> <87cz84y5le.fsf@posteo.net> <3F91FDEA-881A-49DB-BB52-5A0D81C004CE@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006640e905f0e37cf2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Philip Kaludercic , Eli Zaretskii , Dmitry Gutov , Tim Cross , emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 28 14:39:27 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pAWeV-0001g0-Ei for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Dec 2022 14:39:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAWdo-0004MZ-OH; Wed, 28 Dec 2022 08:38:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAWdm-0004KY-N4 for emacs-devel@gnu.org; Wed, 28 Dec 2022 08:38:42 -0500 Original-Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAWdk-0001Ku-SY; Wed, 28 Dec 2022 08:38:42 -0500 Original-Received: by mail-pf1-x42a.google.com with SMTP id z7so5056412pfq.13; Wed, 28 Dec 2022 05:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2Knx5Fy6wVscW/qO1t8cmkHg+IHK1QyMrhjJWqDRyMA=; b=deSN/GUK8W7p6uwrzJh9RbYDvOuQCauTfECTd2xlBDwoLg/3weKI9vlZE/QpeQqn0C 72XqBBhY8LnYAAY1/CP1BtT1ZOsui25V+tZA+tiU4XTk1JGCKRkGcjoWI4fPCnacGWAz fWCIqdx9009ldPNG/do7h4X7570NVFWQelMay1FnJNpZj92jTyht1iGYQ3QgYfQ7GeW6 L3td92bNn4AkEn7UrAOFebvi5X0lEEwDECjwSoJ41WAM7EXzNaT0LqT3TsaKN5pSdXlW Daolv7VUARLd0S+59Gm+MQ0ezAQNYl4XfbTPiFTjywnkJC/ojL1BGjnCHC0ETw9Otn61 XLhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2Knx5Fy6wVscW/qO1t8cmkHg+IHK1QyMrhjJWqDRyMA=; b=FI1apQVnjDCweG+L9UNWtvu+RxKZCUYqDeEU8MQwhwsCihRZrLcs6o5kzHTHIWHveJ EGdfygBer+j5Fb8QiEX5/KWc0SUVM+J7RnW3KslCRpzUyVOL9LhdMZDm7/kgBTxqXf3e +ZFPRyKvd05zd4kzE94REVeGoj8pQZDRU4dTPgloFaHgVgoIp6dePF47gHY8tscCUkij dH7uYl9CiHprM1IuLWiyBNucOL648EHamEVPD0qUuvNtY61HfiN4MO5rJSCiKgbH00dn M6zyo+hlnuRJT3w2zZI/BEA4xKJ97E5slEYUdD7NHrCkYI90g8H9twu3siwsfq/2Ubng WZgA== X-Gm-Message-State: AFqh2krgaNYxu64CkPacys+04W08LUhMuzMH++qRgZXcveSs6Ks/GKR3 SMR0/8DvDg74HGEKVSWgtCKzWJPH2K/sTyHpr+Q= X-Google-Smtp-Source: AMrXdXsZMBDNfbPAnUp3mTqkY9LVFFn6u6aKeLZSYeWay0cu4H1TdxzY/6ih/VkV7eq6dlbI2CFmLMyETo0GgjGoo3o= X-Received: by 2002:aa7:9008:0:b0:57f:bdca:63ed with SMTP id m8-20020aa79008000000b0057fbdca63edmr1681752pfo.0.1672234718869; Wed, 28 Dec 2022 05:38:38 -0800 (PST) In-Reply-To: <3F91FDEA-881A-49DB-BB52-5A0D81C004CE@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=owinebar@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302002 Archived-At: --0000000000006640e905f0e37cf2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 27, 2022, 9:53 PM Yuan Fu wrote: > > > > On Dec 27, 2022, at 1:13 PM, Stefan Monnier > wrote: > > > >> It should be possible to port this, but I question if it is worth > >> the effort. > > > > I think it's worth the effort in order to help empower our users to mak= e > > changes to their grammars. Otherwise we're back to grammars whose > > source is legally-speaking Free but that most of ours users wouldn't > > know how to change. > > The =E2=80=9CDSL=E2=80=9D used to describe language grammar is reasonably= straightforward, > and our manual explains it to some degree (see the end of section 37.1 > Tree-sitter Language Definitions). Though one probably need some addition= al > knowledge on writing parsers to work on the grammar. > The problem is that the "cli" written in Rust is the parser generator. I looked into trying tree-sitter last summer, but gave up when I discovered the Rust tool chain isn't available for cygwin. A cursory inspection doesn't show me why the author goes to the length of using JavaScript and nodejs, since all the real work appears to be in Rust. I suspect that Stefan and Eli would prefer a solution that decoupled the use of libtreesitter from the tool that generates the shared library with the parser tables (and whatever else is required) that the tree sitter library loads. Generating GLR automata is well-understood, but tree-sitter appears to have some additional functionality in its parser generation. How much of that is required for libtreesitter to function is another question that would need to be understood. This is where the culture of free software, where the process of building software is expected to be inclusive of the user-developer's local system, and corporate open-source, which requires repeatable processes and controlled build environments, are at logger heads. Chromium (and its component projects) is not encumbered by a software license, but it's build process is a nightmare for any individual that wants to validate or control, at least in principle, all software running on their system. I'm only using Chromium as an example with which I'm somewhat familiar. It sounds like Rust incorporates some bias towards "continuous integration" builds as well. Lynn --0000000000006640e905f0e37cf2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Dec 27, 2022, 9:53 PM Yuan Fu <casouri@gmail.com> wrote:


> On Dec 27, 2022, at 1:13 PM, Stefan Monnier <monnier@iro.umon= treal.ca> wrote:
>
>> It should be possible to port this, but I question if it is worth<= br> >> the effort.
>
> I think it's worth the effort in order to help empower our users t= o make
> changes to their grammars.=C2=A0 Otherwise we're back to grammars = whose
> source is legally-speaking Free but that most of ours users wouldn'= ;t
> know how to change.

The =E2=80=9CDSL=E2=80=9D used to describe language grammar is reasonably s= traightforward, and our manual explains it to some degree (see the end of s= ection 37.1 Tree-sitter Language Definitions). Though one probably need som= e additional knowledge on writing parsers to work on the grammar.

The proble= m is that the "cli" written in Rust is the parser generator.=C2= =A0 I looked into trying tree-sitter last summer, but gave up when I discov= ered the Rust tool chain isn't available for cygwin.=C2=A0=C2=A0
<= div dir=3D"auto">A cursory inspection doesn't show me why the author go= es to the length of using JavaScript and nodejs, since all the real work ap= pears to be in Rust.=C2=A0=C2=A0
I suspect that Stef= an and Eli would prefer a solution that decoupled the use of libtreesitter = from the tool that generates the shared library with the parser tables (and= whatever else is required) that the tree sitter library loads.=C2=A0=C2=A0=

Generating GLR automata= is well-understood, but tree-sitter appears to have some additional functi= onality in its parser generation.=C2=A0 How much of that is required for li= btreesitter to function is another question that would need to be understoo= d.

This is where the cul= ture of free software, where the process of building software is expected t= o be inclusive of the user-developer's local system, and corporate open= -source, which requires repeatable processes and controlled build environme= nts, are at logger heads.=C2=A0 Chromium (and its component projects) is no= t encumbered by a software license, but it's build process is a nightma= re for any individual that wants to validate or control, at least in princi= ple, all software running on their system.=C2=A0 I'm only using Chromiu= m as an example with which I'm somewhat familiar.=C2=A0 It sounds like = Rust incorporates some bias towards "continuous integration" buil= ds as well.

Lynn

--0000000000006640e905f0e37cf2--