[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: R5RS interpreters need not apply?
I'm a bit worried about the complexity of Scheme macros.
I find them significantly harder to understand than the rest
of Scheme, and I think I might have a hard time implementing them.
There are a lot of subtle issues, and I'm not sure I understand them.
The ftp-able implementations I've seen are not very encouraging,
since they're fairly complex and not extensively commented or
explained.
I'm not even sure I understand the high-level language. For
instance, what happens with nested ...s? If I have a... inside
another ..., do all the a's get gathered into one "flat" list,
or is there something like a list of lists? RnRS seems to
assume that it's clear what interpretation is natural w/o really
explaining it. (At least that's what I remember.)
Also, can I write macro-defining macros, or do the ...s get
interpreted at the wrong level?
I've written a couple of Scheme interpreters in the past, and
I have a little Scheme-in-Common Lisp now that I use when a
real Scheme compiler isn't available. Scheme macros would
be (or would have been) a significant increase in the
complexity of these systems, if the ftp-able implementations
are anything to go by.
I also think that cost of expanding macros must be great enough
so that I wouldn't want them to be repeatedly expanded at run-time.
Some sort of pre-processig would be required. I don't mind doing
that (indeed, I tend to prefer systems that work that way); but
I can understand why people might want their implementations to
work differently.
On the other hand, I like Scheme macros, and I want them to
succeed. Having people say "they're too expensive", "no they're
not" doesn't get me any closer to understanding the issues for
myself. It would certainly help me, and maybe some others, if
the people who understand the new macros and feel they can be
implemented simply and efficiently could explain why this is
so and how it can be done.
-- jd