guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PEG Parser


From: Noah Lavine
Subject: Re: PEG Parser
Date: Fri, 28 Jan 2011 22:07:05 -0500

Hello,

> Indeed!  I'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.  (2) was sufficiently big that I didn't have time to fix
> it up.  My apologies for stalling on this...  But maybe now is the time
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]