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

Re: Macros and little languages



Paul Graham wrote:
> 
>...
> 
> When you say you do it at runtime, do you mean you in effect
> call eval?  Because you can do that in Lisp too; it's just
> considered a hack.

You can use some combination of operator overloading, parsing of little
languages (e.g. XPath) and rarely eval. You yourself demonstrated how to
make an object instance "look like" a function. My only complaint was
that you demanded function syntax for something that was semantically an
object method (to a Python/Java/... programmer).

>...
> > Also, as I said earlier, one must get used to variability at runtime
> > because a programming language where you can't choose your function and
> > variable names is essentially useful. But it is demonstrably the case
> > that you can avoid variability at compile time, so maybe Occam's razor
> > suggests that a programming language *should*.
> 
> I'm not sure I follow.  Do you mean to say useful, or is that a
> typo?  

Typo. You cannot remove runtime variability. To put it another way:
there is no template, like a BNF, that you can apply to the runtime
characteristics (e.g. call stack and data structures) of running
programs. But it is demonstrably the case that you can describe the
syntax of a language and hard-code that syntax.

Now if you presume that language growth has a cost (not something Common
Lispers may be inclined to admit ;), then you might think that maybe it
makes sense to choose to increase runtime variability (already
unavoidable) and leave out compile time variability altogether.

Re: infix versus prefix. I have more faith that you could convince the
world to use esperanto than prefix notation. But by all means, have
another go at it. Maybe it just needs one more try!

 Paul Prescod