[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: S&I's idea of EQ?
>From JINX:
> Besides, coalescing is not really necessary, since it is an
> optimization which can be trivially accomplished by the user by
> slightly rearranging his/her code. On the other hand, if the
> implementation is free to coalesce, the other behaviour can only be
> obtained thorugh very obscure and unintuitive coding. I'm not saying
> that I agree completely with the philosophy that if an optimization
> can be done by the user himself the implementation should not do it,
> but it is something worth considering.
I would agree with your first sentence except for three problems:
(1) Not all programmers have been properly trained in good programming
style using Scheme. Let's hope this improves drastically with time,
but I'm constantly amazed at the influence of styles from other Lisp
dialects, Pascal, and even FORTRAN on Scheme programmers I've run into!
(2) Many Scheme systems implement most of the ``special forms'' in
RRRS as well as other syntactic extensions as macros. One reason for
optimization is to overcome the mish-mash that often results from
macro expansion. For example, the programmer who uses DO doesn't have
the option of placing the LAMBDA which results in the best possible
place in the overall program.
(3) Similarly, Scheme programs that are created by other programs
often can be substantially improved by an optimizing compiler.
> that I agree completely with the philosophy that if an optimization
> can be done by the user himself the implementation should not do it,
> but it is something worth considering.
So, I think it's irrelevant whether an implementation should do an
optimization that the users can do themselves, since they frequently
can't.
Regards,
David Bartley
-------