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 integration on feature/tree-sitter Date: Mon, 09 May 2022 14:14:26 +0300 Message-ID: <83a6brufe5.fsf@gnu.org> References: <5bada349-2f43-4325-b696-70918584cd3d@email.android.com> <83mtfsuluo.fsf@gnu.org> <87sfpjhm33.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17086"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, casouri@gmail.com, emacs-devel@gnu.org To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 09 13:29:19 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 1no1Zm-0004Fc-7L for ged-emacs-devel@m.gmane-mx.org; Mon, 09 May 2022 13:29:18 +0200 Original-Received: from localhost ([::1]:42232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no1Zl-0002cX-18 for ged-emacs-devel@m.gmane-mx.org; Mon, 09 May 2022 07:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no1LW-0006lw-2t for emacs-devel@gnu.org; Mon, 09 May 2022 07:14:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no1LV-0001a4-Kz; Mon, 09 May 2022 07:14:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+TwI5K+uu9Z//oOC74btcf7Zzgp7dIU2ebQBAEAmJ3E=; b=UYqQjFmHZiX8 UDQHeEP14/0Zcgcy3S1CDdbs+ZHN2yS+Aln3QtevC+C3084aydjbz5iPSrVet0U8k4Ew6NbYhsG1q 41yZINT90nQ/4KgXerT/fxpoJzd4nMLf+3xmV7JMEhf5gZAslzrBVFAIh4NdVXgOlT7BaZX2Z+COF N1tMInMzU90pSxN9LtmpZv3YX2gZTK5hUhV/xr/ATQ8c/NEJCbKZ4yEeOF7cYHP7WBnc3ut1sw0OW hxoBeMv/ujGdkg2wWqKZY9wa1K/WkydLAuyW+elPwx/350U5did9lbDy59+R054BTBXinaPyREefm xP8tVeBgrbAXjf8xiAJFlA==; Original-Received: from [87.69.77.57] (port=3319 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 1no1LT-0004wt-Pq; Mon, 09 May 2022 07:14:32 -0400 In-Reply-To: <87sfpjhm33.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 08 May 2022 21:16:00 +0200) 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" Xref: news.gmane.io gmane.emacs.devel:289520 Archived-At: > From: Theodor Thornhill > Cc: monnier@iro.umontreal.ca, casouri@gmail.com, emacs-devel@gnu.org > Date: Sun, 08 May 2022 21:16:00 +0200 > > Oh right, now I understand. The tree sitter implementation doesn't use > an Emacs module any longer. It uses the language definitions libraries > like any other editor. If you use the tree-sitter-module script you > should use the 'batch-new.sh' script. This only creates a .so file. My > guess is that you could use any guide on the internet to compile such a > shared object, then use it in emacs. It seems to be a bit picky on the > naming; it needs to be called 'libtree-sitter-LANG.so', which should > probably be documented somewhere. I cannot see that it is, yet. > > So in short: Emacs cannot load the .js directly, but when downloaded > they should be compiled to a .so/.dll/.dylib and put somewhere emacs can > see it, such as ~/.emacs.d/tree-sitter. This could be left to the user, > but it would be nice for emacs to do this, or at least a package in > elpa/nongnu elpa that does this so that the barrier of entry isn't too > high. > > I think I understood your concern now, does this answer help? Yes, it does, thanks. However, I don't think I see the need to have in Emacs or ELPA something that helps building shared libraries from the language-specific parser files. The parsers themselves and the way to build them are outside of the Emacs scope. And since building a shared library is not really complicated, and I presume there are prebuilt shared libraries available, it sounds like a simple job, if at all.