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 (was: Drop the Copyright Assignment requirement for Emacs) Date: Sat, 09 May 2020 09:17:38 -0700 Message-ID: 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> <83r1vtdrl7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35343"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: AquaMail/1.24.0-1585 (build: 102400006) Cc: dgutov@yandex.ru, joaotavora@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 18:20:08 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 1jXSCt-00095Z-B6 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 18:20:07 +0200 Original-Received: from localhost ([::1]:43014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXSCr-0008QM-N1 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 12:20:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXSAZ-000781-DI for emacs-devel@gnu.org; Sat, 09 May 2020 12:17:43 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:57152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXSAX-00050t-OI; Sat, 09 May 2020 12:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:References:In-Reply-To:Date:CC:To:From: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=Tba9bycsFGhf8I62RxA1PgL6a5ZEI8jaBBvzS14wdRE=; b=S1n4aCra4vqSVtdoNbLJIHDLLH iuVSTly+uwlxJsHPbUAvygAi25GFTAgj6Mv4L882IeRb0sDvvqSoMZALsPm0oZ7uGY/slJKn/Ol9q 7cYyCeNlEUeyEcmNSWho2U2/ZIeU4in1MToLm1hvmFh+VyRO1unL/GSD3P6XtTsuDEEc3tQDXbBz/ hWkcGIwU5WvULXxDTPIfAjZ4mXXuL8TcPluahE1fizgt6o6VkD2X4qRpq4fSqTM/CTG7krw9R7ITm tl2trQrny+3aONadxET4kPdRdlzKt8OGEGAOSNe0IQzeMHr5UmGnSnTze6R5uNfPMdgKkCsOEV+tZ S2S9GZlA==; Original-Received: from [172.92.145.124] (helo=[192.168.86.155]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jXSAV-0008Qw-4a; Sat, 09 May 2020 09:17:39 -0700 In-Reply-To: <83r1vtdrl7.fsf@gnu.org> 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:249499 Archived-At: On May 9, 2020 9:02:43 AM Eli Zaretskii wrote: >> 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. They do have this problem, and they usually address it with hand written fix-up and glue code. (See the IntelliJ family.) I really want modes (and multi-modes) driven entirely by declarative (and customizable!) grammars --- with everything else figured out automatically. Maybe this goal isn't practical and we should start with the parser combinator C acceleration. > > >> 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.