From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: Make peg.el a built-in library? Date: Tue, 8 Nov 2022 20:08:08 +0100 Message-ID: References: <875yvtbbn3.fsf@ericabrahamsen.net> <877d07a16u.fsf@localhost> <87tu3asg2r.fsf@ericabrahamsen.net> <87edud25ov.fsf@localhost> <87a6511ku0.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o9sOGBCvz7K8MEKk" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2004"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 08 20:08:59 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 1osTxy-0000KQ-Pd for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Nov 2022 20:08:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osTxK-0001bs-V3; Tue, 08 Nov 2022 14:08:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osTxI-0001bV-OR for emacs-devel@gnu.org; Tue, 08 Nov 2022 14:08:16 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osTxG-0002kP-9L for emacs-devel@gnu.org; Tue, 08 Nov 2022 14:08:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding: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=D3UP+7RosDDBtYbzaoUlh5YWxqEQGk+NOI49jZLIfJg=; b=mcCuPAjRoIusm24R9L9FszBFBn rhH71aRgGvz4xew03l9kikv0rMZhlv4sDriRgL2EV5HFYd0qGMdAxzVaQSw2vhnP5rpWiGbwqnMpc w0JPCquW8u0iaNDZLSvI04Rl+Y2eGpEmvVJUFXfpQtKQrU4pCUdv5DnZnalsupf+6hFb6DVhKFXwV 12WI4zf1f5YiV5YiKToGSM4LTHlrhqsRCeJWMKFj5npza0SFDtZiJ4rbG9Twfz5qsweWSkYNeAexh l8Cx8EH2D4WWj99zAbaA79b6a40VhrqAcJBSh8DtmHs/kJcaIIB7PMgyc7VN+jgB68K3gDR6VwSow rrLUqOkA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1osTxA-0008Ke-Rr for emacs-devel@gnu.org; Tue, 08 Nov 2022 20:08:08 +0100 Content-Disposition: inline In-Reply-To: <87a6511ku0.fsf@ericabrahamsen.net> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299360 Archived-At: --o9sOGBCvz7K8MEKk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 08, 2022 at 08:18:15AM -0800, Eric Abrahamsen wrote: > Ihor Radchenko writes: >=20 > > Eric Abrahamsen writes: > > > >>> Is there any progress merging peg.el to Emacs? > >>> I do not see any obvious blockers in the discussion, but the merge ne= ver > >>> happened? [...] > > As the comment in peg.el states, the definitions are adapted from the > > original PEG paper [...] > This is what I was saying in my original message, though: if peg.el is > going to go into core, it probably needs more/better docs than code > comments and "read this paper". Its likely users will be Elisp library > authors like me, who are just trying to free themselves from regexp hell > and want a relatively straightforward alternative. Yes. Coming from regexp they are deceivingly similar but frustratingly different. The best way I found to wrap my head around them is that they are a fancy notation for a recursive descent parser. Thus slightly more powerful than regexps, but slightly less than a full YACC (i.e. LALR or thereabouts). What is attractive about them is that one can do "full" parsers (as long as your grammar is roughly LL(k)) without having to build two storey buildings. I guess it takes some practice, though (I haven't). I think comparing them to treesitter is a category error. Cheers --=20 t --o9sOGBCvz7K8MEKk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY2qpGAAKCRAFyCz1etHa RsqhAJ9SvFPqkXshSLqUguCkvNdhx0oYFQCfaWgkgaCdfILmm5w/sCVmhQEcd7I= =mcM2 -----END PGP SIGNATURE----- --o9sOGBCvz7K8MEKk--