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

Where to use SELF - your opinion



> I think you're thinking of a kind of static typing that goes beyond mere
> protocol checking.  Just knowing protocols often doesn't help performance.
> What the compiler needs is additional information about representations and
> particular implementations.

I mostly agree, although I believe that any type system that can do
protocol checking is well on its way to providing increased performance
with relatively little compiler work, since it allows switching from a
hashing-style to an indexing-style implementation, and also allows
de-virtualizing functions when doing whole-program optimizing compilation.

Whole-program optimization is one of the frontiers in compilation
technology, by the way.  Ken Kennedy's group at Rice was the first to do it
(with Fortran), as far as I know; the Eiffel compiler does it; Stoney
Ballard's new C++ compiler is the first C++ compiler that I know of that
does it.  It presents an interesting new tradeoff between performance and
flexibility, since it may lead to substantial performance improvements at
the price of not being able to share library code.  While in principle the
Self dynamic optimization techniques can do the same thing, an optimizer
that can look at the entire program and take a long time doing the
compilation may do better and have a wider choice of heuristics available
to it than an optimizer that has to trade off code generation time against
how far it looks.