4 ms·
The original Turbo/Borland Pascal compiler was a single-pass compiler written in assembly. Not sure if they ever rewrote it in a high-level language. The small,
by atombender 8y ago
The original Turbo/Borland Pascal compiler was a single-pass compiler written in assembly. Not sure if they ever rewrote it in a high-level language. The small, simple grammar helped, as did the unit system. With Delphi, linking became the most expensive stage of compilation.
Part of being single-pass was it hardly did any optimizations, and of course declaration order was completely rigid. Back in the 1990s there were competing commercial compilers like Stony Brook Pascal that did optimization, and at the time there were optimizers that you could run on the .exe files, but for the most part people stuck to Borland's tools.
I spend a good part of the 90s writing fast 2D and 3D graphics stuff, including a commercial game, and performance was never an issue, especially as Object Pascal supported embedding assembly blocks seamlessly into your code.
- pjmlp 8y agoIf I am not mistaken, later versions of Delphi removed the restrictions on declaration order. I am with you on performance for graphics stuff, hence why I never bought into stuff like disabling bounds checking on the whole application is a must for performance.
- atombender 8y agoI stopped using Delphi after version 4, but I was curious, so I did some googling. Looks to me like forward declarations were still needed in Delphi 2010, at least for class declarations: https://stackoverflow.com/questions/2137030/cant-get-a-forward-class-declaration-to-work-in-delphi-2010 https://stackoverflow.com/questions/2137030/cant-get-a-forwa.... Borland's Pascal compilers did have a way to disable bounds checking locally, with a special compiler directive comment: {$R-}. It took effect from where you used it, so you could do: {$R-} for i := 1 to 10 do writeln(myArray[i]); end; {$R+} </nostalgia>
- pjmlp 8y agoYep I used R- a few times, just not everywhere. :) Thanks for googling it.