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, 28 Sep 2021 10:09:02 +0200 Message-ID: <20210928080902.GC14380@tuxteam.de> References: <875yvtbbn3.fsf@ericabrahamsen.net> <87bl5k87hq.fsf@alphapapa.net> <87fsuvpod4.fsf@ericabrahamsen.net> <874ka7wqko.fsf@gmail.com> <87sfxp4ard.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30092"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 28 10:13:46 2021 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 1mV8FG-0007eh-FQ for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 10:13:46 +0200 Original-Received: from localhost ([::1]:46850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mV8FF-0003rm-Da for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 04:13:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mV8Ar-0006HM-H6 for emacs-devel@gnu.org; Tue, 28 Sep 2021 04:09:16 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:55817) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1mV8Ap-00018U-2h for emacs-devel@gnu.org; Tue, 28 Sep 2021 04:09:13 -0400 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; bh=gpAvHbGwPZYP9s5INl4P/KRGGuuKoxbPA6YPCG/WXiU=; b=t6aTna4WUFFXLDlMkFI5FIK6B6JPascloychkt5QnJevvwhiWVPXVhAVV+rfCyhzaL0QyIWM2fDpPmKc6rgYF7xUFTR3jXT/wbB0oV147fjzoLgNvDmplX7W8g8MrSCej8sKWv+AeG5uh+sW87U7Md+HG8/xfeIQBLMwe2mzRu90RH4rN3MGFxz2dI7kBMtbGWnq8W53O2MVjhlsrBCzVuGiIFcuEQiUuN3dOlLwSGOJhtby2loztljr3Vh5ytuZoIaMKQFeqfNI8VfxS1Q6HEuJslrMxedsvnSiUgij+rpinttID4K6r22aoUGwDZb3qiEHgF8r3pZ34jfTsOG6QQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1mV8Ag-0004t1-Td for emacs-devel@gnu.org; Tue, 28 Sep 2021 10:09:02 +0200 Content-Disposition: inline In-Reply-To: <87sfxp4ard.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.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:275671 Archived-At: --qjNfmADvan18RZcF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 27, 2021 at 08:52:38PM -0700, Eric Abrahamsen wrote: >=20 > On 09/27/21 18:34 PM, Richard Stallman wrote: > > [[[ To any NSA and FBI agents reading my email: please consider ]]] > > [[[ whether defending the US Constitution against all enemies, ]]] > > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > > What is a PEG? >=20 > A Parsing Expression Grammar: > https://en.wikipedia.org/wiki/Parsing_expression_grammar >=20 > Basically a way of composing a parser out of smaller regexp-like > expressions. They can be very useful in a wide variety of situations. In the Chomsky hierarchy, they live in some funny place between regular (Type-3) and context free (Type-2). They are strictly more powerful than regular grammars (but can eat memory for breakfast [1], but (quoting the Wikipedia ref above: "It is an open problem to give a concrete example of a context-free language which cannot be recognized by a parsing expression grammar." I don't know at the moment whether there is a (non-constructive) proof that CFGs be strictly more expressive than PEGs? Cheers [1] Memory has become significantly cheaper since Thompson, this might have a practical significance or not ;-) - t --qjNfmADvan18RZcF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmFSzZ4ACgkQBcgs9XrR2kafRgCfT4B3ClVzgFIycbCpXbViubc4 sVUAninOEJ7DY4gm/hIJI8vsk0E0eF0C =e9nn -----END PGP SIGNATURE----- --qjNfmADvan18RZcF--