From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: PL support Date: Sat, 9 May 2020 12:28:57 -0700 Message-ID: <4b15a709-8d3a-d51f-1841-3f34d87a9fbc@dancol.org> References: <9mmFgzvrBwjt_n_VJyaJdXINraNi5HsGpwq-0MLeKiJA7kG2BQA4uywrzjyz7lpRS0OZDpjEi8lspOKYUA7P_QsODsDew_8nbH960G55fmY=@protonmail.com> <83zhaih0oz.fsf@gnu.org> <83pnbegsvm.fsf@gnu.org> <83imh5hby1.fsf@gnu.org> <2e4e8ce9-d857-f3e3-31cf-a40dee67bd25@yandex.ru> <83y2q1dsvh.fsf@gnu.org> <2468efa6-7dbd-8634-44cc-586bb6985f49@yandex.ru> <83pnbddrfd.fsf@gnu.org> <5bcc1b01-6000-52bc-e7e3-86e0f60dabb2@dancol.org> <6e9117c1-a05c-e6a4-0c9d-aa3ef386d371@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="39180"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: emacs-devel@gnu.org, joaotavora@gmail.com, monnier@iro.umontreal.ca To: Dmitry Gutov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 21:31:22 2020 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 1jXVBw-000A3F-5P for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 21:31:20 +0200 Original-Received: from localhost ([::1]:35434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXVBv-0008M3-42 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 15:31:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXV9j-0006lA-SR for emacs-devel@gnu.org; Sat, 09 May 2020 15:29:03 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:60170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXV9i-0005yi-Jf; Sat, 09 May 2020 15:29:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=k5cob+I1ZG0ffXvTMezjzSSk46k7PAi90sCKkKojMLM=; b=fMFCFGYBylYVo3+nfZh1veI2qQ Lac3rRhafgCeKGo93m38FX1tlaPQMq5D/3ih15fGfltYD/SGPSNDPC1GTN9+GSvi44eEKvff9epPA WDxKx/89fQdKZxgJuDnEiBgfArMUCqKrK5xKIGy/OiCoqqpd2mOaV0tjPnnsBELbpBz47RLKIIdwf 2E/1aTeFgTe6a83HHiO1u50BLicoJ8I68B9n2uYrlGpvlmNMh54uJpT2rpDNlty/BPYkwfoVA+8QG aHnjsq9gW9UKt0qJQF9sUzF0wzHeX8awhYcT3//AMFxDq2cMb83oErI1gLdtQ/qGQBzTQPjK8ALVP LfhL2dfw==; Original-Received: from [2604:4080:1321:9a00:3d60:5fe6:8cb4:e9e6] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jXV9e-0003jI-Ut; Sat, 09 May 2020 12:28:58 -0700 In-Reply-To: <6e9117c1-a05c-e6a4-0c9d-aa3ef386d371@yandex.ru> Content-Language: en-US Received-SPF: pass client-ip=2600:3c01::f03c:91ff:fedf:adf3; envelope-from=dancol@dancol.org; helo=dancol.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:249560 Archived-At: On 5/9/20 12:01 PM, Dmitry Gutov wrote: > On 09.05.2020 21:41, Daniel Colascione wrote: >> TreeSitter requires NPM for customization and compiles to C, right? I >> don't want people to require either to customize Emacs. Why not just >> port the tree sitter parser generator to elisp? > > You might want to pop to the previous discussion of TreeSitter on this > mailing list. > > I made these points there already, you're welcome to read the responses. I should go back and reread that. (I declared emacs-devel unread email bankruptcy recently.) > Bottom line is: if someone implements this, we can talk. Does anyone need to implement it? Looking at TreeSitter's repository, it looks like the parser generator itself is written in Rust (which could be linked directly into Emacs), the JS-specific grammar bit is pretty small and directly translatable to elisp [1], and the output of the parser generator is a bunch of tables that could, in principle, be used directly instead of having to round-trip through a C compiler. If TreeSitter works as well as described, it'd be worth just making it a build requirement for Emacs so that --- at long last --- the core modes could be grammar-based. Doing that would require ditching platforms that Rust doesn't support, but I'm okay with that. It looks technically doable. Sure, integrating TS this way would require taking a dependency on LLVM --- at least for the moment, since gccrs is still immature. It'd be a political shift. But is it more important to catch up with the rest of the editingworld or to keep shunning LLVM (which is free software!) for some reason? [1] https://github.com/tree-sitter/tree-sitter/blob/master/cli/src/generate/dsl.js