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

Re: Vectors as functions



From: <mike@newhall.net>


> > To correct something I've repeatedly seen mentioned in this thread:
> >
> > [These freedoms] make it hard to optimize also make it hard for
> > tools to reason about programs.
> >
> > Shriram
> 
>     These are valuable abilities, but why not let the programmer decide
> when to break optimization-compatibility, etc., when he judges the
> power of the language feature provides a greater benefit than cost?

Sometimes it can be hard to allow the language user the choice.
Suppose I had a language that allowed you to override the primitive
arithemetic via an `*arithmetic-operation-hook*'.  This `clever'
feature allows you to redefine all binary operations by just assinging
this hook at any time.

Unfortunately, there would be no longer be an obvious mapping from
simple arithmetic statements to machine code, so chances are this
language would be dog-slow in math....   even if you *didn't* ever
use this hook.

If instead I decided to take this ability away from the programmer,
I could make an awful lot of code run an awful lot faster.