From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sun, 08 May 2022 21:16:00 +0200 Message-ID: <87sfpjhm33.fsf@thornhill.no> References: <5bada349-2f43-4325-b696-70918584cd3d@email.android.com> <83mtfsuluo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31056"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 08 21:17:13 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 1nnmP2-0007oy-T0 for ged-emacs-devel@m.gmane-mx.org; Sun, 08 May 2022 21:17:12 +0200 Original-Received: from localhost ([::1]:38308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnmP1-0003sI-EH for ged-emacs-devel@m.gmane-mx.org; Sun, 08 May 2022 15:17:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnmO5-0003DC-M7 for emacs-devel@gnu.org; Sun, 08 May 2022 15:16:13 -0400 Original-Received: from out2.migadu.com ([2001:41d0:2:aacc::]:25410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnmO3-0001LJ-1p; Sun, 08 May 2022 15:16:13 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1652037362; 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=Z44uM7uKhB+si6dm0Juq6r2tG2wciKH1u4BQMAkWaaQ=; b=T26VLcW9qE/3IoOCgiC2BlmscbTFNeoNasvuS4y+N/YRuOv9VaUm6nP5IzAiqlvWHK3rQ5 Sd7bVt3ZunWUm6XX6qSQnqChKelPk131CwTI5O7OdhV7AP/p9nP50i20PTQBWIo5CvyvOC sv+NM5Q6jj+etG+4M2EhwzfKGzGrdZeFbmRpjxaxuwn9IHbOYDPiS2IorsmPNIDDyvPMQ6 kbNmj3dpHo0neQeFK0O7h2MlxQ09dItxYXm2xntXSHLfrB82HyINhyfOzkdZA47H+91XFA U/PcSV11tXzUBHRYNIucqTppQux+3oxs0y0Vg6zGdZvfJD+Bcfact8DSA4F/xQ== In-Reply-To: <83mtfsuluo.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: thornhill.no Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:289495 Archived-At: > > My understanding was that tree-sitter can load these *.js parsers as > they are downloaded from the respective sites, or that there are tools > available to compile them if needed. Why cannot we leave it to users > to do that by themselves, instead of using an Emacs module? 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? Theodor