From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: PL support (was: Drop the Copyright Assignment requirement for Emacs) Date: Sat, 09 May 2020 19:02:28 +0300 Message-ID: <83r1vtdrl7.fsf@gnu.org> References: <9mmFgzvrBwjt_n_VJyaJdXINraNi5HsGpwq-0MLeKiJA7kG2BQA4uywrzjyz7lpRS0OZDpjEi8lspOKYUA7P_QsODsDew_8nbH960G55fmY=@protonmail.com> <87d07xamrg.fsf@ericabrahamsen.net> <878silajdl.fsf@ericabrahamsen.net> <87tv18pyh4.fsf@russet.org.uk> <83zhaih0oz.fsf@gnu.org> <83pnbegsvm.fsf@gnu.org> <83imh5hby1.fsf@gnu.org> <2e4e8ce9-d857-f3e3-31cf-a40dee67bd25@yandex.ru> <83y2q1dsvh.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="105998"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgutov@yandex.ru, joaotavora@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 18:05:10 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 1jXRyP-000RQR-K2 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 18:05:09 +0200 Original-Received: from localhost ([::1]:50798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXRyO-0004pp-6G for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 12:05:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXRw0-000823-H7 for emacs-devel@gnu.org; Sat, 09 May 2020 12:02:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54512) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXRw0-00014Z-49; Sat, 09 May 2020 12:02:40 -0400 Original-Received: from [176.228.60.248] (port=4022 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXRvx-000308-VL; Sat, 09 May 2020 12:02:39 -0400 In-Reply-To: (message from Daniel Colascione on Sat, 09 May 2020 08:50:45 -0700) 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:249490 Archived-At: > From: Daniel Colascione > CC: , , > Date: Sat, 09 May 2020 08:50:45 -0700 > > > Please someone start working on this ASAP. We sorely need that, just > > look at the recent discussions on Reddit that underline these > > deficiencies in Emacs. > > It's a hard problem. A mode based on a real parser must be fast, > incremental, and robust against transient errors that arise in the normal > course of editing. I agree. But other IDE's have the same problem, don't they? And AFAIU incremental parsers such as tree-sitter are explicitly targeting such use patterns, and their documentation says they are tolerant to temporarily incorrect source. > We'd also want the ability to parse complex languages > (far beyond LALR) and incorporate out-of-band information in order to > resolve semantic ambiguities --- e.g. the C++ template problem. On top of > all that, the parser would need to be highly malleable to make it easy to > adjust to slight differences in dialect as well as deal with multiple > languages in a buffer. AFAICT, tree-sitter supports many languages already. I know less about LSP, but I'm guessing they are not very far of that, either. > A much simpler approach I've also had in mind is providing a C-assisted > incremental parser combinators facility to Lisp --- something like the > venerable pyparsing. Parser combinators make it pretty easy to incorporate > error recovery rules, and the C code can use approaches like current > syntax-ppss to keep the parse up to date and maintain, cheaply, an AST. I'm sure more than one alternative exist, and maybe we should support more than one. Thanks.