From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Bj=C3=B6rn?= Bidar Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter maturity Date: Sun, 29 Dec 2024 16:50:50 +0200 Message-ID: <26666.8826503277$1735483904@news.gmane.org> References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> <86ldwdm7xg.fsf@gnu.org> <6765355b.c80a0220.1a6b24.3117SMTPIN_ADDED_BROKEN@mx.google.com> <00554790-CACA-4233-8846-9E091CF1F7AA@gmail.com> <86msgl2red.fsf@gnu.org> <87o710sr7y.fsf@debian-hx90.lan> <8734i9tmze.fsf@posteo.net> <86plldwb7w.fsf@gnu.org> <87ttapryxr.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Philip Kaludercic , Daniel Colascione , emacs-devel To: Peter Oliver Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 29 15:51:36 2024 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 1tRudk-0001IV-IC for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 15:51:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRud8-0003LR-Dj; Sun, 29 Dec 2024 09:50:58 -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 1tRud6-0003L5-3Q for emacs-devel@gnu.org; Sun, 29 Dec 2024 09:50:56 -0500 Original-Received: from thaodan.de ([185.216.177.71]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRud3-00045F-O6 for emacs-devel@gnu.org; Sun, 29 Dec 2024 09:50:55 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id 9A508D00081; Sun, 29 Dec 2024 16:50:51 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1735483851; bh=V7EXgibgwnDpeljkorZPwc5W78XFOe4T0sO2FulRaQc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Q8p4WxyYZ0eJOQrECUDNKRW5af9oW59hAarw0d6NWQ7bBGVPXqzOva/LrcqmYejQn TeGXxXPr5PhAPPn/YQhJhwH8fJCtWEk723monJu1T4uC8PnjWNf11aI6T+uZIoqGqL 20SwXfuzksS8e0RsQRSqnVI0+f/1jUj2q947u10uo/yEXNR1lsq6yLqYvCDFqEnN4J 6yiEnfmbqkkV3Ev2EXpquW+LuWbc0POny8LN+OFRv6j1N/A7PTSELsmR+YjqusLuQY MENePGYw3hz+0mJf7ZoOY6KODp1wz/M/AeqUiszUWMacqTv/yiKf1YSOb0We/aKQKm zrI/w6n+steVEAg/ZfxUREN1FAblQwA8iKmoQZvmC2NjCV5Woktj42XSJKrzz4QcY/ ij7UBXZAcZNWDvm+XYgivh1bwMPHxuz9s0D/f2bRqFH6zKozxgTCMtnoYv5ZdWjINV nQiuUf8OT02oYwVGkEF141jekwgJ1y2auYE73Ck8wwmP/PpnTUemH3ikCQc8YALXca jSo+R29ryAt880xyAUP3vHyh+qEBlLjHy3xikQT0z4gMJCEP9iK40WW2GSCXITsoCg Xx7E+6iaULcDvVYke+9OqR3aQHK49LXVo5wXcscgSAo+R+1vDZFdHTrVynL2hYgiSd kOC0b4/a5pCCBLs5K3tU5c78= In-Reply-To: (Peter Oliver's message of "Sat, 28 Dec 2024 12:20:35 +0000") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH Received-SPF: pass client-ip=185.216.177.71; envelope-from=bjorn.bidar@thaodan.de; helo=thaodan.de X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 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, INVALID_MSGID=0.568, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:327341 Archived-At: Peter Oliver writes: > On Fri, 27 Dec 2024, 14:20 Philip Kaludercic, wrote: > >> Daniel Colascione writes: >> >> > Why not just vendor all the grammars with the Emacs modes that use them? >> >> I am guessing part of the reason is that TS grammars are not fun to >> build. IIRC they are specified in a Javascript DSL (that used to >> require node.js but AFAIU works with other implementations as well), >> that a program written in Rust translates to C code. > > > It's probably worth mentioning that the generated C code is included in the > Git repositories, these days along with a Makefile. So, if you're only > building rather than developing the grammars, you can simply run `make && > make install` or similar. Note this isn't practical as the C code is a built time artifact which is checked into repositories to avoid issues in some of the projects using the grammars. However that is bad practice for several reasons: - the grammar is C code yes but it is so big that is effectively a blob. Doing so duplicates the blob every time it is generated to a degree. - Since the blob is a build time artifact it is against most distributions (including GNU I assume) to use these. It is also not reproducible since it might have been generated by a different tree-sitter library version, that should not be an issue but still it isn't right. - Further it is hard to verify if the blob hasn't been modified after regenerating. The practice is temporary and could stop at any point in time. As a maintainer of some of these grammar packages the checked in grammars bother me very much.