From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Wed, 28 Dec 2022 09:41:15 -0500 Message-ID: <87k02btw8j.fsf@dfreeman.email> References: <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: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14124"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , Stefan Monnier , Philip Kaludercic , Eli Zaretskii , Dmitry Gutov , Tim Cross , emacs-devel@gnu.org To: Lynn Winebarger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 28 15:55:04 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 1pAXpe-0003PF-IB for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Dec 2022 15:55:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAXox-0001Tm-Ii; Wed, 28 Dec 2022 09:54:19 -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 1pAXow-0001TZ-5z for emacs-devel@gnu.org; Wed, 28 Dec 2022 09:54:18 -0500 Original-Received: from out-207.mta0.migadu.com ([2001:41d0:1004:224b::cf]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAXot-0001L4-3i for emacs-devel@gnu.org; Wed, 28 Dec 2022 09:54:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1672239250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z+flZv2wyYK0bXy9ru1vhmg+iTZSPWfcl5yTYKHqXMY=; b=r/efmAbPe9MfqzwH1ZVyCksGHT9K2LqeE8uW7bcEOodq66nVBCmKEDDqLJfw5mRS9Of0L3 6k6NwYtgITfFjadxAUiLVhsGOqLXMts2eSffuR1Aeutkme65C/uDjCJNwSsteDtKdJEip2 kCCV7HkkXS/jH+cwfNRYrR7oPeq4Ak8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::cf; envelope-from=danny@dfreeman.email; helo=out-207.mta0.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:302004 Archived-At: Lynn Winebarger writes: > > 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 Something I haven't seen mentioned here that might be relevant to the conversation is the tree-sitter 1.0 checklist from last year: https://github.com/tree-sitter/tree-sitter/issues/930 It's not been updated in a while, so I'm not sure what the status is, but one of the items on the list is: > - Mergeable Git Repos - Make it easier to collaborate on grammars by removing generated files from version control. which means anyone cloning the repository with the intention of installing it would be required to have more than just a C compiler to get started. They would need tree-sitter-cli and it's dependencies installed to make things work. I'm assuming that tree-sitter maintainers will work their way through this checklist one day, so maybe it's best to operate under the assumption that this change is coming to the grammar repos in the near future. Also, nixos packages tree-sitter grammars, and their distribution of the Emacs master branch uses these successfully. As an end user, I find it convenient to have the distro provide these. https://search.nixos.org/packages?query=tree-sitter-grammars Although I might be worried about breaking changes to the grammars and distros getting out of sync with what the treesitter major modes expect. -- Danny Freeman