[conspire] Compiler Optimizations (was: Jamie Zawinski doesnt like mailman)
Nick Moffitt
nick at zork.net
Thu Jan 11 02:14:16 PST 2007
Rick Moen:
> (Actually, I particularly appreciate his listing of the reasons why
> the Lisp runtime environment is _much_ better designed, but the fact
> that even an _emulated VAX_ makes more sense than a JRE was a
> particular eye-opener.)
It's funny, but he mentions dynamic optimization in LISP systems, and
says "This is dynamic optimization, and can give Lisp code speed
advantages over Fortran and C."
Ben Woodard once explained to me why FORTRAN is still going strong in
scientific computing applications, and why gcc's FORTRAN front-end will
always lose. You'll often hear people tout FORTRAN's matrix data types
as an advantage over C, but the real benefit is that it's had decades of
work on the big popular compilers to make them optimize your *math*.
So while C compiler optimization is all about looking at the assembly
and trying to find shortcuts, good FORTRAN compilers actually look at
your *equations* and try to optimize *those*. So if you're doing lots
of matrix operations, the compiler can tell when certain groups of
operations reduce to, say, the identity matrix, and just substitute that
in.
But gcc just treats FORTRAN like a funny front-end to C, and ignores the
higher-level structures.
--
You are not entitled to your opinions. Nick Moffitt
nick at zork.net
More information about the conspire
mailing list