From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eKRXHSa+3mPajgAAbAwnHQ (envelope-from ) for ; Sat, 04 Feb 2023 21:20:54 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2JiGHCa+3mNyVQAAG6o9tA (envelope-from ) for ; Sat, 04 Feb 2023 21:20:54 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D7BAB45FE5 for ; Sat, 4 Feb 2023 21:20:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOP1P-0000Vx-JN; Sat, 04 Feb 2023 15:20:27 -0500 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 1pOOD1-0005vb-BP for guix-devel@gnu.org; Sat, 04 Feb 2023 14:28:23 -0500 Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pOOCy-0005Sj-Ap for guix-devel@gnu.org; Sat, 04 Feb 2023 14:28:23 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4P8Mxc2b3cz9sJ5; Sat, 4 Feb 2023 20:28:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minikn.xyz; s=MBO0001; t=1675538884; 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=XCNgcahnzm7SO8m1i0cvmKY323dqInwAZBuU7+JLgOE=; b=MkK16djjjkmFE1Hb/i2n2AcGnwW/rI60/Su6tFqGdQdz63J7rPoODdSXrmxxEv/lKV+/+D APl346KpsUHnMmSNlbwl5z0Uj+9XKWpe9XsI+NuQTcTiw7/DmwzwD1TTZ+LRi5OdVSHh4h kkrE1N+eZ/OLCPjmd6PqkHK15Y6uffy8lFaaiBMyETaRe1Jqi1GyOyVHxOykXzDQRGVvuN stjk7HTDs/M9+W4YYBvV0U2fcTbnjK2/5XPeb8+JZB8P1XdH0nGHInjyVCrj4lQTrgAA3k KgZ0X1nfIt9uOjVXQIhnu6e1BxhOV5Pxs/2J3ZK+zhsVP8zraqCqiViogVZsEg== From: Demis Balbach To: Simon Tournier , guix-devel@gnu.org Cc: andrew@trop.in Subject: Re: Getting tree-sitter grammars in Guix In-Reply-To: <86fsc21sw0.fsf@gmail.com> References: <87h6wycn8f.fsf@minikn.xyz> <86fsc21sw0.fsf@gmail.com> Date: Sat, 04 Feb 2023 20:27:56 +0100 Message-ID: <87ilghfcxv.fsf@minikn.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=2001:67c:2050:0:465::102; envelope-from=db@minikn.xyz; helo=mout-p-102.mailbox.org X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 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, FROM_SUSPICIOUS_NTLD=0.499, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_PDS_OTHER_BAD_TLD=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 04 Feb 2023 15:20:25 -0500 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675542054; h=from:from:sender:sender: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XCNgcahnzm7SO8m1i0cvmKY323dqInwAZBuU7+JLgOE=; b=S1UjTuJf2peuEgNp83sRvfdi1OMUW7S5YYeY5t7biwnIgPyV+RxcaChy/tVT4bK1zzZJ2p vECQZtg6kdKcovADzDpMdcvh2mYaCK8PkTtOUpZVceC3v/jLQ01pX2U3AqrFYXkbdZ8dyr 1ng2tRTLRL19feJck0J7+7GFJwg6u5ibiNKCpzTbGUIgPjqcj7dFtt6ZNb5oDoPjY9xD3N mrSNiagTuQeOr5vmv1WqJQ5v/1fdOG3tHFVWxtNkHiYH4ciEE3I9k+UoOSz4MQQVb++sqC C9dJLY+j6HXeR/fINsbUsur0IZofcvhINxrRvsERhruQj4Gj7cHIabOSjd16ew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=minikn.xyz header.s=MBO0001 header.b=MkK16djj; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675542054; a=rsa-sha256; cv=none; b=Wv1+vjmHYHl62VtZOn/CWCwFm8FSehjzk5C724H81lCxQ3gmIaPYT/eOAiKxsAgLv44MBF hRd2WfbYDB3ZnzOUxK23q0SLJtq1Ac7IIrDrpazlp8Z+SnXPDx8d4VUvibPzUsL9UnGxlS KRHsKnx9YRN6id3f2FgZ2DWh8ClBnXXsX/yxL/NsANEnz8lirc3FiWpoDDPpb1RHdOKTcg gT6Lsu4DnCGIUYl9ip9PwkW1oLLJNoM0QPAVzdWfjo/Qj2FLMpbtdzczOqdhmFUdDrLlIo COKRmx9tbPJkFu+vWYHNpBoqtaUkR9XPxU0SMiBM4h6QbBYFR37lfAS+rK/Lfw== X-Migadu-Queue-Id: D7BAB45FE5 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=minikn.xyz header.s=MBO0001 header.b=MkK16djj; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.58 X-Spam-Score: -7.58 X-TUID: ab+oEMSUmsbT --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-01-22 16:38, Simon Tournier wrote: > Hi, > > On Tue, 10 Jan 2023 at 18:29, Demis Balbach wrote: > >> Hello, I was wondering what the "correct" way would be to get grammars >> for the tree-sitter library available in Guix when using tree-sitter >> with Emacs 29+. > > This raises a question about the bootstrap. > > From my understanding, the inputs of Tree-sitter is the file > =E2=80=99grammar.js=E2=80=99 and then using Node.js, it generates C files= . It is often > these C files which are considered as the Tree-sitter parser. > > Many Tree-sitter parsers are available [1]. For example, Bash [2]. The > grammar is described by =E2=80=99grammar.js=E2=80=99 [3] and then using i= t, the file > =E2=80=99src/parser.c=E2=80=99 [4] is generated (note the size 3.46MB!). = Then, using > this file =E2=80=99src/parser.c=E2=80=99 is generated a library which is = called by the > editor tool (say Emacs tree-sitter [5]). > > I am not aware if someone has tried to rebuild using Guix only from the > grammar.js to a working tree-sitter editing experience. > > Well, considering the state of Node.js and Guix, it appears to me > difficult to debootstrap. And maybe, we should accept a large > unverified seed for Tree-sitter. Well, I do not know. > > What people think? What do we do with Tree-sitter? > > > 1: > 2: > 3: > 4: > 5: > > > Cheers, > simon Hello Simon, Thanks for the input. I came across this: https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00073.html Maybe this can be used as a foundation. I tested it locally and it works fine, but I don't know how it needs to be altered in order to be pushed upstream. On that note, how would one package an emacs package that leverages tree-sitter? I want to package https://github.com/isamert/jsdoc.el which requires tree-sitter. I wrote a package definition where I substituted My understanding is that I need to provide emacs with tree-sitter support as an input for that to work. Here's a package definition I wrote: =2D-8<---------------cut here---------------start------------->8--- (define-public emacs-jsdoc (let ((commit "2e7c02ff2dc422bc21c405bd90a7092c2f599630") (revision "0") (version "0.2")) (package (name "emacs-jsdoc") (version (git-version version revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/isamert/jsdoc.el") (commit commit))) (sha256 (base32 "07sz5lpyqv7ixvnnzdfjkj7f0ykdz31lkljp13pvlf36a6sff4rc")) (file-name (git-file-name name version)))) (build-system emacs-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'patch-bin (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "jsdoc.el" (("'tree-sitter") "'treesit"))))))) (inputs (list ;; tree-sitter emacs-next-pgtk-stable emacs-s emacs-dash)) (home-page "https://github.com/isamert/jsdoc.el") (synopsis "Inserts JSDoc function comments/typedefs easily.") (description "Inserts JSDoc function comments/typedefs easily. It also tries to infer types by itself while doing that. Type inference is quite primitive.") (license license:gpl3+))))=20=20=20=20=20 =2D-8<---------------cut here---------------end--------------->8--- My understanding is that I need to provide emacs with tree-sitter support as an input for this to work, which I did, but it'll fail with =2D-8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (file-missing "Cannot open load file" "No suc= h file or directory" "treesit") =2D-8<---------------cut here---------------end--------------->8--- Maybe someone can help me here. I tried looking at other package definitions, but I don't know if there are any emacs packages that require tree-sitter packaged in Guix yet. Thanks in advance. =2D-=20 Best regards / Mit freundlichen Gr=C3=BC=C3=9Fen, Demis Balbach --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEz9zHmXzCRksxyCGU8X3bmMw8QFwFAmPesbwACgkQ8X3bmMw8 QFy3LA//X4448wmfvrC8+2RhGZ9XQTOFK7yS8TojPAzyVQGJmjQq+Ags1GaYLV8p 6/VguvXOQWTTKTfaQw/d3sw9H/uDalpQODIgOygLoa1Bz53NzpuouyUJxQOYbEwd HwCiufXBPSpIKpVSmsgWI7aBiIJ0waJuOD7ccr9DF6+oB0kzAq2vKUPTG1Rp4/O2 03oP/BK3F3Yeg/0tTmC/redIrGow04whP/amMlccaqtEr5iy5IHBHSfO0MDKD+eN DQp/j/LlxfzkaJFjG1vHRYlWPc+7ey+hHS8HMiAzjgSCvv0/hMvXcjOIjIfXYyPq wAXfC4WTMgqDRRc5dKrOKqpPSb+xoO5vZWXPQtaYbTlr09Zwq5aLu/Yarbbg5oSN hNyZVWKSiOZMSLIoJhrzDFW7xUkVJUZ91UuHyUKbMVHcv7lWvDquBe3W8ajXJsMH c2YiLeHMa/XKz5nms+NNU1UOAYub+RSkowE9X6SB/XU+aeICTLT5dcVoVuILLmEq EMYY3AbtYBDWUySrG0ZjUM0UnpkLyC1VOTukhnMIRhLvE/ReXVOHJixnpslwNSw7 Vpd6If7nwPAIuB6lqo5Sj7pOAJLH4KCtO9PvH2wU2nibqGFtU8TzwRzb0lu69PXe 5jCaj24r1Cxk4URj7BW24cAWG0rwZaQGfvSlnYKiQXfmITuc3qk= =5pHv -----END PGP SIGNATURE----- --=-=-=--