From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Sat, 17 Dec 2022 10:40:35 +0000 Message-ID: References: <83edszjslp.fsf@gnu.org> <83bko3jr3o.fsf@gnu.org> <83359fjoie.fsf@gnu.org> <86cz8ivfvw.fsf@gmail.com> <83bko2ifq4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002508dd05f003b32b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tim Cross , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 17 11:39:49 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 1p6Ubc-00010H-4B for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Dec 2022 11:39:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6UbK-0005z0-AL; Sat, 17 Dec 2022 05:39:30 -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 1p6UbI-0005ya-12 for emacs-devel@gnu.org; Sat, 17 Dec 2022 05:39:28 -0500 Original-Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6UbG-0004xe-7w; Sat, 17 Dec 2022 05:39:27 -0500 Original-Received: by mail-oo1-xc29.google.com with SMTP id w4-20020a4aaf04000000b004a1ab217cecso739889oon.13; Sat, 17 Dec 2022 02:39:25 -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=gGogYuQG/VRzPRsPiV3kKONG0XtWW1L3sm22FLajlTo=; b=GI77xJulffLihh1O2W2spa4Sx9p+NNXEU1VYkI0ToL3J9CwfEqVjv9XfAWSZS/6e5r ENcJO8oWnuZK9K6U/qptoH9V03MHRZ59ewK9TUuv2ld4byynWn9LCwuohnhshOw2UThb Z//xpKZ3Pva5xRV0GJ4gFS4kwkPCWxfaOCQzaHEcgrVOCiA3Fd0h6NmJTlMr8McqMwSb uUHbRwr8SXD2iPHFIh1CwKAVIu0qTE9G8yqH9w/b5hfvLMpXKRscZMTm1PyaAsT7rSaO kNidh1WQG5FMjMBUwa4laDIKO18A1QCHY1DPyqjb3j2lbDAcmUQun5cD6NPD5W3ZqQZt 8Crg== 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=gGogYuQG/VRzPRsPiV3kKONG0XtWW1L3sm22FLajlTo=; b=GNd419ugUiE6eOGAzzvhdsohe0l0+b4ckN761DwJymewH5jAJbAsjVdKErhudMHjQD IkQ13tiYDDbYxmtI7xz9JlErKonwk89gwM0WS7lAuScagDOYEqRJ8TwR+HIFG4O/dIUp qg6KCH76n4ojNGXbu1uC//HF7AbIOHv5MYaoTrBYN5Wqt6ivkgdpZUXnIUAOqV+zOkNL 6ykqffQLGGikNQYvAWdT5eKhU/D223BHf7RJ9Jg5ES51r2ehQjN9ugzhWN9cX3We1PFM eCM8CJNx52NNPFKouR/8jwr7gFd7FSDnxdhx/dFkTCfoVyQlhBh4sY4fZ8EdPnOHvcXw evhg== X-Gm-Message-State: ANoB5pkKKze2eJc+Egf/XMyHQmc9pY273rlxUs1Vsyg/I/JPkN6po+hF rHH1HktJ0iTA9AwL4neQpmEPFz15EqymyqLy+J0gIhKR X-Google-Smtp-Source: AA0mqf4atInyzj0/2O2GJ/R4fk9YHcwd8Pjv5IrklUF/xpyGtm29IzKjhVweXfNfWHsI4g4x14Zw2MeBhDpZBQf74rs= X-Received: by 2002:a4a:dc53:0:b0:4a3:e23d:4e2a with SMTP id q19-20020a4adc53000000b004a3e23d4e2amr1044372oov.7.1671273564668; Sat, 17 Dec 2022 02:39:24 -0800 (PST) In-Reply-To: <83bko2ifq4.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=joaotavora@gmail.com; helo=mail-oo1-xc29.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:301555 Archived-At: --0000000000002508dd05f003b32b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've just run admin/notes/tree-sitter/build-modules/batch.sh and it worked flawlessly and built many .so. Could probably have used Make instead of Bash, but worked fine regardless, and reasonably quickly. There's one thing that I think could be added which is that the admin/notes/tree-sitter/build-modules/dist path relative to the Emacs source directory be pre-set in the variable treesit-extra-load-path, or something to that effect. Then this could be even smoother. But could it be smoother yet? After all, all that build.sh does is download and compile some C/C++ code after downloading it from the internet. Why can't we bundle this code with the Emacs source distribution and build the shared objects as part of the normal build process? Bundling is also one way to help us pin the grammar version, a dependency of our major mode source code. The way it is right now, it seems that if the upstream repository introduces an incompatible change in the Foo grammar, our foo-ts-mode will break. The grammar repositories seem to be MIT licensed, and we already promote its download anyway. I'm not an expert, but it seems MIT is compatible with GPL, so we could carry some MIT code in our repo. Jo=C3=A3o --0000000000002508dd05f003b32b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've just run admin/notes/tree-s= itter/build-modules/batch.sh and
it worked flawlessly and built m= any .so.

Could probably have used Make instead of = Bash, but worked fine
regardless, and reasonably quickly.

There's one thing that I think could be adde= d which is that the
admin/notes/tree-sitter/build-modules/dist pa= th relative to the
Emacs source directory be pre-set in the varia= ble
treesit-extra-load-path, or something to that effect. Th= en this could
be even smoother.

But= could it be smoother yet?=C2=A0 After all, all that build.sh does
is download and compile some C/C++ code after downloading it
fr= om the internet. Why can't we bundle this code with the Emacs
source distribution and build the shared objects as part of the
=
normal build process?=C2=A0

Bundling is = also one way to help us pin the grammar version,
a dependency= of our major mode source code.=C2=A0 The way it is
right now, it= seems that if the upstream repository introduces
an incompatible= change in the Foo grammar, our foo-ts-mode
will break.
=

The grammar repositories seem to be MIT licensed, and w= e
already promote its download anyway. I'm not an expert= , but
it seems MIT is compatible with GPL, so we could carry= some
MIT code in our repo.

Jo= =C3=A3o
--0000000000002508dd05f003b32b--