3 ms·
> it compiles ridiculously fast Courtesy of its simple precedence grammar ... as we all undoubtedly remember ;) http://en.wikipedia.org/wiki/Simple_precedence
by huhtenberg 13y ago
> it compiles ridiculously fast
Courtesy of its simple precedence grammar ... as we all undoubtedly remember ;)
http://en.wikipedia.org/wiki/Simple_precedence_grammar http://en.wikipedia.org/wiki/Simple_precedence_grammar
- vidarh 13y agoI don't know if Delphi still does that, but Wirth-style compilers also tends to avoid an AST in favour of calling the code generator directly from the compiler, and Turbo Pascal at least used to do that.
- lobster_johnson 13y agoActually, Delphi/ObjectPascal's compilation speed comes mainly from being a one-pass compiler. Code is translated directly to native code per compilation unit, and since there is no "header file hell", each unit is an independent part whose generated code can be cached in its entirety, so during a single compile, if you have changed just one unit, the compiler only needs to compile that unit (plus dependencies) and then perform linking. The linking is much less complicated, too. Delphi also benefits from having a hand-coded parser and not too many machine code optimizations. I think the simplicity of the grammar may contribute some, but probably very little.