From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Fri, 16 Dec 2022 17:38:51 +0200 Message-ID: <83bko3jr3o.fsf@gnu.org> References: <83edszjslp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23132"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pedz@easesoftware.com, emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 16 16:39:11 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 1p6Cnm-0005ne-Im for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Dec 2022 16:39:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6CnU-0002Et-MG; Fri, 16 Dec 2022 10:38:52 -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 1p6CnS-0002DY-RJ for emacs-devel@gnu.org; Fri, 16 Dec 2022 10:38:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6CnS-0004gl-J3; Fri, 16 Dec 2022 10:38:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=FduPp7t7VNfIjrzOtbIG4VfpUf0W5l+Fxs5YnAgDVxM=; b=leC1HYj0KXNASafLxLfA 2eRsuGBu6RZMMk5Wb/z5BUaRwvjO5cgXZw0TmrxznkFAmuSPXtgRLwctkYFyqeL/LcJND/I+WymmY TV6VNmJPNVbCUrv9ijcIV0Oc5bE0VobfqQoDz3jvjxeWBZ+jF8Ku5fPkP7ftCGrgYWam3K42YkqU4 CINRpJTxp7RNIWFH+ev+l1WCnNUOaiwFOH6b3pxN1egQV28s3fBweemGk2p3izqkJ8kr3DxyrpNKi OcGHyhX2WsQwIBY2AajQD7P8KWzSoV+NLovqKzCs1mLoILzQiAZdaFNwKtWzQDyfB4slK25WGlKup QrRXr2BV2BY8GA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6CnS-00075I-0d; Fri, 16 Dec 2022 10:38:50 -0500 In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Fri, 16 Dec 2022 15:24:59 +0000) 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:301494 Archived-At: > From: João Távora > 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.