From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Lucy Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Updates/Questions Date: Mon, 16 Aug 2010 00:37:46 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1281937103 24656 80.91.229.12 (16 Aug 2010 05:38:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Aug 2010 05:38:23 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Aug 16 07:38:22 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OksOr-0000Uf-Uy for guile-devel@m.gmane.org; Mon, 16 Aug 2010 07:38:22 +0200 Original-Received: from localhost ([127.0.0.1]:57153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OksOq-0006vN-D5 for guile-devel@m.gmane.org; Mon, 16 Aug 2010 01:38:20 -0400 Original-Received: from [140.186.70.92] (port=33825 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OksOj-0006vI-D2 for guile-devel@gnu.org; Mon, 16 Aug 2010 01:38:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OksOd-00082d-Io for guile-devel@gnu.org; Mon, 16 Aug 2010 01:38:13 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:61918) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OksOd-00082T-Dm for guile-devel@gnu.org; Mon, 16 Aug 2010 01:38:07 -0400 Original-Received: by vws16 with SMTP id 16so3442299vws.0 for ; Sun, 15 Aug 2010 22:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type:content-transfer-encoding; bh=exHiGySYEOCSgaofLbmCa50pmvwVHKUsuwe5Te3qy80=; b=ZWcIH3A1ypRipBTmJ1P6f9Gm4W8mNZ7oavK8Y/bOOC6Wp+mfYJ+70jnqypdmORYuJ6 3rgvQfwJIwPo9vPxq9OrcA+X6cL4pke0aw2uGbPtie87AjuSqTZ4f/+y/Ve9vW3QUDYf o6DxjSZzBvpVUmPo5QLots1di4Cdn8uo2WMPo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=pS/5jEz3p14aipfxmvHIQ6x0NBW3dl0Y/Pc3ZPfphtcWLZG23J0h9RVOtaVIxodE7v IAkppySmLwd5/8plnWqFRoZhsAr3H/Th1Nx3j7N0WsUNEMyeQJJq6K509XwI07L/7gNn vp6CHfllX0jdhxQCY8uQ0/93ZFn3Y92ncUbtc= Original-Received: by 10.220.60.70 with SMTP id o6mr3009266vch.2.1281937086187; Sun, 15 Aug 2010 22:38:06 -0700 (PDT) Original-Received: by 10.220.128.202 with HTTP; Sun, 15 Aug 2010 22:37:46 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: -VN-BWF1BTG7Zn1yTRkci3YwzLU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10768 Archived-At: On Fri, Aug 6, 2010 at 1:40 AM, Michael Lucy wrote= : > On Wed, Jul 28, 2010 at 12:13 AM, Michael Lucy w= rote: >> I've officially eliminated the last define-macro expression. >> >> However, I get the feeling that things may not be exactly as desired. >> The original program made extensive use of functions in building the >> macros, and I originally tried to replace these with macros. =A0This >> turned out to be a little difficult to debug, however (read: I was >> unable to make the code actually work). =A0I eventually abandoned this >> and just made datum->syntax calls. > > I've left this alone since then; it would be nice to get some > confirmation that this was the right choice though. =A0If it isn't, I > think I still have time to change it before the GSOC deadline (and > like I said, I'll hang around after it). So, we're essentially at the GSOC deadline. I pushed up the finished form of what I have to the git repository, plus some benchmarks. I also added a variant on packrat parsing using a cache instead of a hash (the hash performs poorly on flat text files). This turned out to be well worth it; on the relatively limited benchmarking suite it was about a 50x performance boost. Quick summary of files added (all in origin/mlucy): Actual module: module/ice-9/peg.scm Test suite: test-suite/tests/peg.test Benchmarks: test-suite/tests/peg.bench (wasn't quite sure where to put this= ) Documentation: doc/ref/api-peg.texi (also updated guile.texi to include it) The macros haven't been touched (except I fixed up one define-macro macro that had slipped past my radar). I'll be hanging around after the deadline tidying up a bit more (I'd like some more benchmarks); if the macro situation isn't what you guys want I'll fix it. > > Anyway, I just pushed up everything I have to the git repository (I > think; I may have screwed up the syntax). =A0I'm basically done except > that the documentation/comments could use some more touching up, I > don't have a set of benchmarks yet and I haven't really optimized > things all that much. > >> >> On the one hand, this works. =A0I also find it easier to debug, and I >> think it looks cleaner. >> >> The downside is that one doesn't get all the same benefits of >> referential transparency, so I still have gensyms in the functions >> etc. =A0Is this a problem? >> >> If so, I can definitely replace everything with macros, but I might >> not be able to do that and get everything else done by the GSOC >> project deadline. =A0I'd like to hang around after the project is >> officially done from Google's point of view to polish things up, so I >> could also do it then. >> >> Another question about module namespaces: =A0I have some syntax that I'd >> like to be available to code generated by macros in my module, but >> which I'd rather not export to the user (to avoid clobbering their >> functions). =A0Is there a standard way of doing this? =A0I can't seem to >> find anything in the module documentation regarding giving namespaces >> to things in modules except for :renamer, which has to be done by the >> user--the only options appear to be not exporting it at all, or >> exporting it straight into the user's namespace. =A0The best fix I can >> think of is naming the syntax things the user is unlikely to ever take >> (or maybe using gensyms to make sure it isn't a name they take). >> >