From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Date: Fri, 28 Jan 2011 22:07:05 -0500 Message-ID: References: <87bp3fi5cp.fsf@gnu.org> <87aaisr6sn.fsf@gnu.org> 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 1296270442 828 80.91.229.12 (29 Jan 2011 03:07:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 03:07:22 +0000 (UTC) Cc: Michael Lucy , =?ISO-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 29 04:07:12 2011 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 1Pj19c-0001Ch-3H for guile-devel@m.gmane.org; Sat, 29 Jan 2011 04:07:12 +0100 Original-Received: from localhost ([127.0.0.1]:38720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pj19b-0007qa-HY for guile-devel@m.gmane.org; Fri, 28 Jan 2011 22:07:11 -0500 Original-Received: from [140.186.70.92] (port=35890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pj19X-0007oU-RH for guile-devel@gnu.org; Fri, 28 Jan 2011 22:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pj19X-0002IA-0M for guile-devel@gnu.org; Fri, 28 Jan 2011 22:07:07 -0500 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:45045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pj19W-0002I6-Sl; Fri, 28 Jan 2011 22:07:06 -0500 Original-Received: by gyd10 with SMTP id 10so1649036gyd.0 for ; Fri, 28 Jan 2011 19:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=QGT9KNDbRCbzTz5gr7cuGhHjplQUREiBelZ84sCJleU=; b=CsbmBAVFcLMB+G491pOmYdj5IamQi//awsDQteFcFekcXnyFhU2IaufbeCUiu5lcfq xICXfS6bvc8RBeb8cs6FmnLcaf7u4Y5j9sAIIjHRD0+JvkvlqwBnlRg7vTB6b6WXeIzg 80e6BnDKjLnyWoaIm2AOM9lLCgtx7a5b6RJjM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=i4eZYVTRZ0DiEXPLllVGZf4vS3i7sGTQavqFFTjtTZzxRxMmAxixTAb2ZSvMHgc+YA rqDRHE8exFEV8IvA2J374JSqx4YNgllMIkRItkp9+5x1hNSzqlmMk4x0HyxIwfa0gkwl rr3Bm0pBJ+b7enAgzxOXoj48GNMTevhAIakAk= Original-Received: by 10.147.124.1 with SMTP id b1mr5004911yan.22.1296270425342; Fri, 28 Jan 2011 19:07:05 -0800 (PST) Original-Received: by 10.147.32.7 with HTTP; Fri, 28 Jan 2011 19:07:05 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 2MRrg7V7b1bUECtCIL1VnbKguBM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 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:11392 Archived-At: Hello, > Indeed! =A0I'm looking forward to having it in Guile. Great! I don't intend to be pressuring you to merge it, by the way. I hope my message didn't come across that way. > The reason I didn't merge it yet was twofold: (1) the commit logs were > not in the standard style, and (2) I wasn't comfortable with the macro > binding stuff. =A0(2) was sufficiently big that I didn't have time to fix > it up. =A0My apologies for stalling on this... =A0But maybe now is the ti= me > to look at it again! Yes, the binding stuff actually seemed very weird to me too, mostly because it's very non-idiomatic. More specifically, the peg module does most of its code generation in regular functions rather than macros. safe-bind implements hygiene for these code-generating functions. It's basically what you'd get with defmacro. I eventually came to the conclusion, however, that it's really a symptom of a larger issue. Most likely it would be possible to take all of the functions that use safe-bind and rewrite them as macros themselves, using either syntax-case or syntax-rules. However, I am afraid that the result might be incredibly ugly. In order to make the code more readable, we use normal functions for code generation and provide hygiene through safe-bind. So the larger issue is that Scheme needs nicer-looking ways to define macros. If it had those, we wouldn't be using hacks like safe-bind. But we don't, and that's a huge issue to tackle. Those are my thoughts, but I would be quite curious to know if you (or anyone else) think the same way, or think something different is going on. Noah