From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: PL support Date: Sat, 9 May 2020 22:49:45 +0300 Message-ID: <7d5833cc-28e5-af3d-c0b1-b35b91a1e968@yandex.ru> 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> <4b15a709-8d3a-d51f-1841-3f34d87a9fbc@dancol.org> 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="120316"; 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: Daniel Colascione , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 21:51:23 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 1jXVVK-000VCD-Ui for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 21:51:23 +0200 Original-Received: from localhost ([::1]:51238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXVVK-0003xe-0p for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 15:51:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXVTr-0001xN-5B for emacs-devel@gnu.org; Sat, 09 May 2020 15:49:51 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:33678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXVTq-0005BG-3D; Sat, 09 May 2020 15:49:50 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id d207so719361wmd.0; Sat, 09 May 2020 12:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1PLsyPzAx23LKDuprRyqD0BSoJeGwxdp+xoOd1SY+U0=; b=FYwno9vYZDPX9v5r2y4x2Du77zuZW8MeR37n7LgtaRi9vVU2xWMM9QNViQoOAUtqhQ C+trWzCo3Wl/lLV/MDmLHkhrHLyKhR2bs8rti4gkibTXT46IVH992cDCiirJzTelFgn/ xcjHToeqP13yWmfgUW91XnnnIKzj6me1wuZ5A+c33LqBvKT5ZvjTxmNKF8droDUdOQEA hujjpbE5W/F0k7TiqJ1F0LYrzImeaU//fUzTPE+oeUe+gP8Cmr++8FqsS/sSN9Md3Nn1 slFv4DhWbvAFgw5sUGLA+5dFWLpx1vgbgpp+xTbv30QAzQHI9dV7ZASG5avGysQsn19z uBOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1PLsyPzAx23LKDuprRyqD0BSoJeGwxdp+xoOd1SY+U0=; b=E1SwrQeuLHzvf2jvu2YgpxAYcl9xa9AL/bgFlWHNsYSu5Fm4t0fEtxY2D6QSCTpXJY 4w7ahXzcXkLOY3PYd4rkFMDlKBjgYtECPzDZGv1PM+XXtyDfid0iviJkUfe73LmasNiA EJ1fdzma83R6sdlmlQM7DI45f209Dh+KvCkMi5cOOzU0aSs5RawoAB9klxBHW08FEIp+ 8F6xFqmImKe2DfFj36p/qF5wHQlBTypyUtKhemi2kkdI0JPWpVXoHufoNdJ5S51kSEZ/ HADEtFVUjF9GqRTyem0+mudPtx9R65yEJLPQr1Ex00idSErTdHKr6BGa7U9fgQnqRC5B 91Vg== X-Gm-Message-State: AGi0PuYM6yMY5WuxJZpm2RD9st9Xvizw19OIaGyLW1ND922qNf2nET5i XKBQtXXCdHGUkTthQ7YTLZnGuz69 X-Google-Smtp-Source: APiQypK7UkSZgH4XKVHj59fVMmWDJhIDLmDSsikKjgsBBR5Kv4ahoTDbZui7CFw7gdxCkcXxel6J9Q== X-Received: by 2002:a1c:6a0b:: with SMTP id f11mr22483942wmc.123.1589053788066; Sat, 09 May 2020 12:49:48 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id v20sm9947176wrd.9.2020.05.09.12.49.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2020 12:49:47 -0700 (PDT) In-Reply-To: <4b15a709-8d3a-d51f-1841-3f34d87a9fbc@dancol.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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:249567 Archived-At: On 09.05.2020 22:28, Daniel Colascione wrote: > 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.) I sympathize. >> Bottom line is: if someone implements this, we can talk. > > Does anyone need to implement it? It doesn't work yet, does 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. I guess the question is how fast this is going to work, compared to the original. Then the details of the Elisp interface. And also our ability to keep up with the grammars and TreeSitter's development (new features, api changes, etc). In the meantime you can try out https://github.com/ubolonton/emacs-tree-sitter/ (they seem to have gotten syntax highlighting working now). That's a straightforward integration, though. > 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. Um, well... That sounds like a beginning of the "Rust in Emacs core" project as well. :) > 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? I wouldn't want to rain on this parade, but I think we might need strong practical evidence of this approach before such a move would be considered.