guile-user
[Top][All Lists]
Advanced

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

Re: Please explain different macros


From: Michael Livshin
Subject: Re: Please explain different macros
Date: 22 Apr 2001 18:25:04 +0300
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Crater Lake)

Neil Jerram <address@hidden> writes:

> >>>>> "Michael" == Michael Livshin <address@hidden> writes:
> 
>     Michael> Neil Jerram <address@hidden> writes:
>     >> But procedure->* must be in the reference manual, for
>     >> completeness.
> 
>     Michael> I'm not so sure about that, actually.
> 
>     Michael> I'd be quite surprised to hear about any user who
>     Michael> actually needed the non-memoizing macro variants in his
>     Michael> work.
> 
>     Michael> this is not to say that these things shouldn't be
>     Michael> documented at all -- of course they should.  in the
>     Michael> developer documentation (wherever that is supposed to be)
>     Michael> or something like that, but IMHO *not* in the user
>     Michael> documentation.
> 
> You have a good point, but the user/developer distinction is one that
> simply doesn't exist yet in the reference manual.

I thought the reference manual is strictly on the "user" side of
things.  if it is not so, then I don't think I really have as good a
point as I thought I had. ;)

>     >> I prefer define-syntax myself, but I don't have any
>     >> performance-critical Guile applications to worry about.
> 
>     Michael> scripts, presumably?  macro expansion speed (or lack
>     Michael> thereof) should only affect the load time, after all.
> 
> I see; is that true for the implementation in Guile as well?

it's tricky.

the R5RS macros are implemented through the portable syntax-case
implementation.  syntax-case pre-processes the Scheme source before
it gets to the eval -- so it's kind of slow, and it processes all the
code, even though your particular program may not excersize all the
code it loads.

defmacro/define-macro, on the other hand, are more "primitive".  you
pay for them when the code that uses them goes through the memoizer --
i.e. on the first use at each call-site.  plus the memoizer is
implemented in C and is thus supposed to be fast.

not that I ever really noticed the difference, mind you, but I don't
tend to write CGIs in Guile so I wouldn't know anyway.

I'd say the ideal situation (well, a certain, erm, extremely local
maximum of "ideal") would be for a compiler to find its way into Guile
before the reference manual is released. ;))))

-- 
All ITS machines now have hardware for a new machine instruction --
BAH
Branch And Hang.
Please update your programs.




reply via email to

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