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 18:34:49 +0200 Message-ID: <83359fjoie.fsf@gnu.org> References: <83edszjslp.fsf@gnu.org> <83bko3jr3o.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="28114"; 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 17:42:14 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 1p6Dmo-00076B-K5 for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Dec 2022 17:42:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Dfn-00009D-UZ; Fri, 16 Dec 2022 11:34:59 -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 1p6Dfd-00006i-F8 for emacs-devel@gnu.org; Fri, 16 Dec 2022 11:34:56 -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 1p6Dfc-0003Bl-TX; Fri, 16 Dec 2022 11:34:48 -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=xOAm7dM1bWjvUo9178EOtrtIsFWDvnN3bBMmExg7V9U=; b=lrrcN3gxoG66sZdiIR81 A4RHieYgzA23v6pz27drygIqWkA+UTU9cTnTej6bFVCAY00lMBSHzBRztNMtH/JoNrfyGcLOvgMwA 5K5aCNuey/IoHMHQ9RfikvLsvE8cJ9KBdTtU8U4+77U6pBmRtSNnUwAGda55tRdXsfGTVZXC0FRF5 zAx+ryiKiAyrJkdI8nrKDCLVNNcy+GASKI4maYy/pG4dLjzlPGIbGVYJspNUqShPNPJfPWXUNVm99 BLAT1BZeai1yzLsU4K49/MyQZSMeaynuKs3UhmXWz4M6L2T9/gMJ0VdWEwM0mB4s0PKKVQPjT0N1J ugOAwS+HxSgRzA==; 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 1p6Dfc-0002XL-AJ; Fri, 16 Dec 2022 11:34:48 -0500 In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Fri, 16 Dec 2022 15:48:03 +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:301504 Archived-At: > From: João Távora > Date: Fri, 16 Dec 2022 15:48:03 +0000 > Cc: pedz@easesoftware.com, emacs-devel@gnu.org > > 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-cpp > which also contains a log of JS stuff. It might contain JS stuff, but you only need to compile and link the C/C++ files in the src subdirectory. You don't need to even look at the rest. > Is that where you get your C++ grammar from? Yes. > If so where do you get your grammars from and can we > bundle some version of them with Emacs? No, we won't bundle grammar libraries with Emacs. It is not in the scope of the Emacs project to provide external libraries; that's for distros to arrange and for the individual users to install by themselves. There are limits to what Emacs as a project can do about using external libraries and tools.