(no title)
fm77 | 2 years ago
For all who wonder why Turbo Pascal was so fast here some insights: https://news.ycombinator.com/item?id=38477688#38486185
fm77 | 2 years ago
For all who wonder why Turbo Pascal was so fast here some insights: https://news.ycombinator.com/item?id=38477688#38486185
acqq|2 years ago
https://techtinkering.com/2013/03/05/turbo-pascal-a-great-ch...
1) The fact that the author was very used to think in assembly is that he was able to generate a compiler to the native code that even without optimizing passes already "well behaves": not squeezing every drop possible for optimization but also making a lot of optimization passes not necessary. That's the "magic sauce" in being what was called "a single pass."
2) Description "a single pass" is actually somewhat imprecise when used by most who talk about it. The passes through something are necessary in compilers, the actual goal is making once the processing on the levels which hurts the whole compilation process the most.
3) So the major difference between the typical "production" compilers and Turbo Pascal was in later being able to fit "everything" in the RAM between the last edit and the production of the compiled code. If I remember correctly it didn't even have to write anything to the disk if one just needed to run the program(!) Only when one needed the executable the write happened.
So assembly was an important part of the story but at the time most of the professionals used assembly anyway, the speed vas result every other decision was also made to achieve minimal I/O (which also wasn't necessarily unique feature) while also being useful enough for the real programs (that was less unique) and comfortable (Wordstar-keys editor, jump to the error after compilation).
A lot of very good decisions combined, that was special. And finally, comparably cheap, too.