From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Proposed new core library: pl.el Date: Wed, 04 Nov 2015 21:14:27 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446689721 959 80.91.229.3 (5 Nov 2015 02:15:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Nov 2015 02:15:21 +0000 (UTC) Cc: Ted Zlatanov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 05 03:15:11 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZuA51-0001v9-BG for ged-emacs-devel@m.gmane.org; Thu, 05 Nov 2015 03:15:11 +0100 Original-Received: from localhost ([::1]:58158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuA50-0000jv-LV for ged-emacs-devel@m.gmane.org; Wed, 04 Nov 2015 21:15:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuA4m-0000jf-21 for emacs-devel@gnu.org; Wed, 04 Nov 2015 21:14:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuA4j-0000tP-8k for emacs-devel@gnu.org; Wed, 04 Nov 2015 21:14:55 -0500 Original-Received: from mail-yk0-x235.google.com ([2607:f8b0:4002:c07::235]:33272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuA4j-0000tL-4R for emacs-devel@gnu.org; Wed, 04 Nov 2015 21:14:53 -0500 Original-Received: by ykdv3 with SMTP id v3so17807726ykd.0 for ; Wed, 04 Nov 2015 18:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mail-followup-to :mime-version:content-type; bh=MCPHQueoe/8Dbe7nNrgEz/PMHKTEjHxJkmPaVKmdgG4=; b=WA0pH8NgoI+gqBFriIn1ephpooDKqzd3q4azDDHymH3oOhAoDpka/4pHTSP8or3IB6 i8cp6vfxAwoLMYkm+l2EHqPBcj1HqI8QAohPkLHDhVNzMSy/aF1rpaNfU/2u1U+Fbk4X h0gyLdlrXP/fdc95IYkHj9nQocyZmUUaPFVBH1g6+4xSL3paT7Mi6JPVJGq45tv19Tpq bzPSOSVbjrEgZE5fr3TgblkmTqrNY5IZxk9XTaMzsaF3duYV025vHufOXYERSAigKXA7 vIx8GkE/nnYxGLhZobl7cP2gRhiyzjt0Svt6RxJGyKyeJseXDUbQCa+OzyJHO5x348H0 mzmA== X-Received: by 10.31.181.209 with SMTP id e200mr4868301vkf.123.1446689692545; Wed, 04 Nov 2015 18:14:52 -0800 (PST) Original-Received: from Hermes-2.local ([38.140.12.50]) by smtp.gmail.com with ESMTPSA id p138sm3080759vkd.25.2015.11.04.18.14.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Nov 2015 18:14:52 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Hermes-2.local (Postfix, from userid 501) id D949648E70AD; Wed, 4 Nov 2015 21:14:28 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Mail-Followup-To: emacs-devel@gnu.org, Ted Zlatanov X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193262 Archived-At: pl.el (standing for "parser library") is a combinator parsing library for Emacs, similar to Haskell's Parsec. You can see how it works at the following README: https://github.com/jwiegley/emacs-pl PL offers a way to write very compact parsers of structured text. For example (from the README): (pl-parse (delete-region (pl-str "" :beg) (pl-until (pl-str "" :end)))) The idea being applicative parsers is that the result of `pl-parse' is the FORM you pass in, where every sub-parser becomes a value of the type you intended to parse. If a sub-parse fails, either the whole parse fails, or it returns nil if you wrap the parser in `pl-try'. There is room for improving performance, but the API is complete enough to start using it. Giving the unproven status, though, perhaps it should start out in ELPA, and move to core after it has solidified and gained some users? John