Paolo Bonzini wrote:
On 04/21/2010 07:04 PM, Steven Bosscher wrote:
On Wed, Apr 21, 2010 at 6:56 PM, Robert Dewar<de...@adacore.com> wrote:
Actually for my taste, you have to get a MUCH bigger factor in compile
time before you can call yourself a fast compiler (Realia COBOL by
comparison compiles millions of lines a minute of code on current
PC's, using just one core).
Heh, you always bring up the Realia compiler when there's a compile
time discussion. Must have been a really impressive piece of work,
that it was so fast :-)
It was fast, I used it for my first summer job, and spent some time
looking at its output too. :-)
And actually I'm impressed especially because it wasn't (as far as I
remember) an optimizing compiler, yet it was written in itself _and_ so
fast.
It did not do what we would call global optimization, but it had very
good local optimization, and very good handling of jumps and effective
inlining of PERFORMS which made a big difference. For example
HANDLE-BALANCE.
IF BALANCE IS NEGATIVE THEN
PERFORM SEND-BILL
ELSE
PERFORM RECORD-CREDIT
END-IF.
SEND-BILL.
<<code to send bill>>
RECORD-CREDIT.
<<code to record credit>>
(see you can read COBOL even if you never saw it before :-) :-))
was compiled as though the two performs were inlined. This is
valuable in COBOL (and not done by the IBM mainframe compiler
at the time), since it is the style in COBOL to do these small
named local refinements, COBOL programmers consider nesting
constructs such as IF's to be bad style, preferring instead
to name the refined blocks as shown above (see what a very
nice compact syntax COBOL has for this kind of refinement,
much better than the algol or fortran style languages :-)
still shouldn't start a COBOL flame war here, sorry!)
Paolo