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

Re: [plt-scheme] The same macro problem

At Fri, 24 May 2002 11:26:45 +0200 (CEST), Zbyszek Jurkiewicz wrote:
> On Thu, 23 May 2002, Matthias Felleisen wrote:
> This said, I am on the Eli's side.  There is an approach to programming
> (which we call authoritarian) that you should only give "safe" tools
> to programmers.  I've seen many languages based on this, which nobody
> uses anymore.  On the other side, "democratic" approach says "Programmers
> are intelligent, just don't put any barrier (this is how Scheme was 
> originally conceived) and they select appropriate ones for each job.
> Of course, you have to teach them first. 

There are two possible ways to interpret "safe":

 * Safe for the programmer --- a programmer can't do unintended things
   (whatever that might mean)

 * Language safety, or safe for the programming environment --- the
   programmer can't crash DrScheme or produce undefined results

There's a small element of the former interpration in PLT Scheme's new
macro system. `defmacro' is bad in the same way as dynamic scope. (And,
yes, for the few cases you want dynamic scope there should be a good
approximation. The same hoilds for `defmacro'.)

But the real reason behind the new macro system is the latter
interpretation of "safe". DrScheme v103 _doesn't work_ with macro
definitions. Many hacks make it appear to do the right thing, but there
are lots of cases where DrScheme v103 behaves strangely. Even the
implementors can't always predict what will happen.

> For me, I would like to have hygienic macros for typical tasks (I always
> try to use them first) and low level define-macro tools which allow me
> to do anything I like (even if I cheat sometimes with them) - e.g.
> as transformer procedures, which I could put in define-syntax instead
> of syntax-rules.

Just to make sure we stay on the same page: Eli's issue is not about
hygiene versus non-hygiene. It's about the phase separation between
compilation and execution.