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: Fri, 16 Dec 2022 15:48:03 +0000 Message-ID: References: <83edszjslp.fsf@gnu.org> <83bko3jr3o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c6ccaa05eff3e519" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33242"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pedz@easesoftware.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 16 16:49:23 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 1p6Cxf-0008Tb-Ll for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Dec 2022 16:49:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Cwn-0006mj-BR; Fri, 16 Dec 2022 10:48:29 -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 1p6Cwd-0006m5-F6 for emacs-devel@gnu.org; Fri, 16 Dec 2022 10:48:21 -0500 Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6Cwb-0007K9-GO; Fri, 16 Dec 2022 10:48:19 -0500 Original-Received: by mail-ot1-x32e.google.com with SMTP id r2-20020a9d7cc2000000b006718a7f7fbaso1596505otn.2; Fri, 16 Dec 2022 07:48:16 -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=jBd8y3/KXOErhL7HaRFv/E4o8Ot7j++XZhbiwDl8kJw=; b=JQHd2KjjufSuTygAPE7uCuwS7JI5QVaW2UCRhXKvWUZkqX0u0U3nLiVxJHWnvHeAzx vdcnfQJK49OZUuhYtr/iu6TAVGr2nngZ5thtUaC8KnsUem3hs9ImXszImcy7bakcjpjS nqz2xVo/ucg7UPXyYwhbKxAmr+jyfMdBZksoGa/OkM0eOsYciyPtf4Hf66iSjqilJTRy useXUvkkvMi48GItih9cZfX7/0YU8g4yH5r+DIjKxLh0p0OtoCO7dkqiAVpkJXpCme4s IZJcJB7wFSrMdlgH/kDJdiv5OcBeIJov0rDuPZXQyVEl0aTC+3SGi6lYY/V0y8U+SLIu 2LKg== 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=jBd8y3/KXOErhL7HaRFv/E4o8Ot7j++XZhbiwDl8kJw=; b=TVrenQXrZJMzudiA4s7tJ2cCAJ9fnMdiDGQRQXyLonySTwi8rVv29TSJTtP3DjKUmt a6GOqn/RgLKJAKtVo1cVQTrude6fjSKuvEK+WKsXTV/ddjgNEwWkpdfew+x5enEbrcvl IJLZqmMfdS5cS2RxMa4WdzR1BlctBjMsQX6G79SM0avrfcK9Db95Az1x92Mac6Dn+Pe/ LtaaeTtLtceSKj44sfRuaXdMQiMF+m7UMBmUMXTfh8RGvweUu2E7tYHOxsFiUcCnLIFT vTlP1W8L8u9zDc4ExnYdkADmiWwSkm7fbk6I+VSoFeUyanHmCsXNX3uAtJY5EF/OM64y UF8A== X-Gm-Message-State: ANoB5pm256D90bW4Q8jLD5IEebfojMrnEZd3cjCHJVq+TePa9TpP5vwK 3nUGcxj185xudrcuBLYe4s8m/9mOqPMwckebftAX1dCNvHk= X-Google-Smtp-Source: AA0mqf7ht6z9sLRFsRJzVfCUooIVn3qZb6GvsVlB9pA5pXRDX7HbVtSyGPw9YIUiDFnquX6D9W3fcma12r3a5Vr9ZLY= X-Received: by 2002:a9d:80a:0:b0:670:8334:ccf2 with SMTP id 10-20020a9d080a000000b006708334ccf2mr1544335oty.201.1671205694654; Fri, 16 Dec 2022 07:48:14 -0800 (PST) In-Reply-To: <83bko3jr3o.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=joaotavora@gmail.com; helo=mail-ot1-x32e.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:301496 Archived-At: --000000000000c6ccaa05eff3e519 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 16, 2022 at 3:38 PM Eli Zaretskii wrote: > > From: Jo=C3=A3o T=C3=A1vora > > Date: Fri, 16 Dec 2022 15:24:59 +0000 > > Cc: Perry Smith , emacs-devel@gnu.org > > > > I agree this is a problem, especially the language specific parser > > bits. Yesterday I tried out tree sitter Emacs on my Arch system. > > Finding the tree-sitter system lib was easy enough, but finding the C++ > > definition object wasn't so easy. Eventually I made it, but it needed > > compilation from source and a NodeJS toolchain that I didn't know > > I needed for that. > > No, you don't need a NodeJS toolchain to compile a grammar. You only > need to compile the C/C++ source files that are part of the grammar, > and then link them into a shared library. I use a simple Makefile to > build all of them, as the structure of the files and the way to > compile and link them are identical and boilerplate. And I definitely > don't have NodeJS installed here. > I used: https://aur.archlinux.org/packages/tree-sitter-cpp-git which builds with the makepkg tool, and am pretty sure it used NodeJS somewhere down the line. The language definition it seems to use is https://github.com/tree-sitter/tree-sitter-cp= p which also contains a log of JS stuff. Is that where you get your C++ grammar from? Or am I looking at an alternate outlet for slightly different grammar? If so where do you get your grammars from and can we bundle some version of them with Emacs? Jo=C3=A3o --000000000000c6ccaa05eff3e519 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Dec 16, 2022 at 3:38 PM Eli Zaret= skii <eliz@gnu.org> wrote:
> From: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>
> Date: Fri, 16 Dec 2022 15:24:59 +0000
> Cc: Perry Smith <pedz@easesoftware.com>, emacs-devel@gnu.org
>
> I agree this is a problem, especially the language specific parser > bits.=C2=A0 Yesterday I tried out tree sitter Emacs on my Arch system.=
> Finding the tree-sitter system lib was easy enough, but finding the C+= +
> definition object wasn't so easy.=C2=A0 Eventually I made it,=C2= =A0 but it needed
> compilation from source and a NodeJS toolchain that I didn't know =
> I needed for that.

No, you don't need a NodeJS toolchain to compile a grammar.=C2=A0 You o= nly
need to compile the C/C++ source files that are part of the grammar,
and then link them into a shared library.=C2=A0 I use a simple Makefile to<= br> build all of them, as the structure of the files and the way to
compile and link them are identical and boilerplate.=C2=A0 And I definitely=
don't have NodeJS installed here.

I= used:


which builds with the mak= epkg tool, and am pretty sure
it used NodeJS somewhere down the l= ine.=C2=A0 The language
definition it seems to use is=C2=A0https://github.com/tre= e-sitter/tree-sitter-cpp
which also contains a log of JS stuf= f.

Is that where you get your C++ grammar from? Or= am I=C2=A0
looking at an alternate outlet for slightly different= grammar?=C2=A0
If so where do you get your grammars from and can= we=C2=A0
bundle some version of them with Emacs?

<= /div>
Jo=C3=A3o
=C2=A0
--000000000000c6ccaa05eff3e519--