2 ms·
Theres a video of this on YouTube it always fascinated me. I asked an old timer about it he said it was designed to be simple to compile and the compiler was in
by giancarlostoro 6y ago
Theres a video of this on YouTube it always fascinated me. I asked an old timer about it he said it was designed to be simple to compile and the compiler was in Assembly. Not sure how truthful this is would love to hear more about how and why its so fast. I would love to someday see FreePascal be just as fast. Its a shame Borland didnt try to make some sort of collaboration between them and FPC. I am sure FPC would welcome some sort of joint effort you help us we help you kinda deal.
- pkaye 6y agoI think optimizations passes is what takes the most time in a compiler. Older compilers did a lot less.
- andi999 6y agoWell then at leastbwith -O0 should be similiar times achievable?
- TazeTSchnitzel 6y agoModern compilers are still pass-based with an optimisation-friendly IR even if you skip the actual optimisation passes. A single-pass compiler will be faster because it does not have the overhead of doing things in multiple passes.
- Touche 6y agoTurbo pascal was single pass, parse and compile.
- pkaye 6y ago-O0 still does some optimization from what I can find online. Maybe someone knows more specifics since the manual is pretty brief.
- guenthert 6y agoI can only confirm that -O0 performs some optimization, which can be annoying when single-stepping through the code (cough, cough) using a debugger. Hence gcc offers -Og to suppress those optimizations (not sure, whether that in itself causes some debugging info to be added though).
- aninteger 6y agoI think a very early Turbo Pascal was in assembly, but I would find that hard to believe of Delphi.
- tpmx 6y agoIt isn't that much of a stretch to believe that they kept most of the compiler in assembly. The language itself didn't change that much from Borland/Turbo Pascal 6.0/7.0 to Delphi iirc. Also, there was a source code leak about a decade ago of Turbo Pascal 6.0 that showed the compiler was still 100% x86 assembly. Just found it via Yandex - it was pretty hard to find with Google. (I only looked at the directory listings of the source code filenames just now, at some sourceforge-like site.)
- FullyFunctional 6y agoAs a young lad, I studied the internals of BLS Pascal (the great-grandfather of Turbo Pascal) and was blown away by the cleverness of much of the code. I had never seen such clever machine code before and have ever since considered Anders a bit of a genius.
- noir_lord 6y agoAnders isn't a 'bit of a genius' when it comes to language/runtime design he is straight up one of the geniuses. I'm 40, I've programmed since 87 and the languages I've truly loved using in the real world have always been Anders languages in some way (TP -> Delphi -> C#/.Net -> TypeScript) - he has amazing taste in what he implements and when - he just has an eye for practical languages that solve common problems nicely.