If you haven't lived through this era, try one day to download DOSBOX and run Turbo Pascal. You will be impressed with how fast it compiles on an old machine... Often faster than most modern projects on our modern computers.
Even if the basic ones that tend to be part of university compiler assignments, .e.g. peephole optimisations, constant propagation, inlining, bounds checking removal, redundant loads removal,....
See chapter 21 from Turbo Pascal 7 Language Guide, to use the last one for MS-DOS as example.
Similar build performance available in other languages, alongside a small set of optimisations.
It is a urban myth that we cannot have both, only because folks experience is tainted with C and C++ compilers.
If you want a good example of fast compilation times with optimisations enabled, check D reference compiler dmd, or to keep on the subject, FreePascal or Delphi 13.
Optimizations is one reason for modern languages to compile slowly, but it's certainly not the only reason. Even at -O0, C++ and Rust are much slower to compile. The culprits are more likely much more advanced type-systems and monomorphization passes for generics. Slow compile times are much more inherent to the languages (compared to Turbo Pascal, certainly).
Not even, regarding type systems, see D or Ada compilers.
Or if you prefer to travel back to 1993, here is a developer experience using C++ as if it was Lisp Machine/Smalltalk environment with incremental compilation and hot code reloading.
One of the noteworthy papers I remember reading in the early 90's was a demonstration that you could even add SSA form to ETH's Oberon compiler to apply optimisations equivalent to the then-current version of gcc with very little loss in compilation speed.
I guess today if you want fast, optimized codegen you need to look more at JIT research since it seems the AOT compiler research seems as you say to have just accepted that slow compilers is normal.
Optimisations existed back then. But what Pascal did differently to a lot of modern languages was it only required a single-pass compiler and no macros.
On slow systems of the era, that vastly reduced the amount of work a compiler had to do to turn ASCII into machine code.
These days, compilers run macros, multiple passes of the source code. Often then building their own byte code or an interim machine representation, before turning that into machine code.
Those layers of abstraction aren’t without benefit. You get greater composability of code, greater portability, and so on and so forth. So they exist for a reason.
the game back then was to use inline assembly for the critical bits, this really worked a treat for the meta of the 90s, with computers that were being asked for multimedia processing with slow CPUs, little RAM and typically no hardware acceleration
As a positive side of that tradeoff, inline assembly in Turbo Pascal was extremely pleasant to write. Because the optimizations were so light, it did not require complex constraint specifications on the values passed in and out, so you could just refer to local variables directly.
My first compiler was for a Pascal-like language that started with just reading assembler in and spitting assembler out, and then I layered in blocks and expressions step by step and slowly rewrite the compiler itself from a basic text processor in assembler to a proper compiler, making use of each new feature as soon as I'd made sure it worked.
I wish I still had the code for it - because it had a very simple Wirth-style code generator it was predictable enough that you could even use registers directly in expressions. (M68k, so e.g. you could do "x = D7.w" to set the variable x equal to the low 16 bit word of register D7)
As a nerd of a certain age, at one time I had a mighty shelf of programming references from Waite Group and Swan and (of course) O'Reilly. Over time, I let nearly all of them go because it's faster to have stuff available digitally now (and has been for 20 years or more), but I kept a few as keepsakes.
The survivors live on a shelf about six feet from where I'm typing, and there you'll find my K&R book, Booch's work on OO, my college FORTRAN textbook, an O'Reilly twofer (a camel and a baboon; extra points if you can identify those by animal alone), and a fat blue tome called Mastering Turbo Pascal 5.5. It has a rendering of a 911 on the cover. My pal Mike gave it to me for my birthday in probably 1990, back when we were both in college and writing code for a computer lab at the business school there.
Years turned into decades, and we remained close. Last summer, my wife and I relocated to North Carolina, in part because Mike and his wife live here. I'm having lunch with him today, just as I do every week.
I started programming with Turbo Pascal at high school. I made a few games in DOS text mode.
Nowadays my favorite language is Go. It appears that among the programming languages that I did use, Go is the one that feels the nearest to Turbo Pascal.
Even if the basic ones that tend to be part of university compiler assignments, .e.g. peephole optimisations, constant propagation, inlining, bounds checking removal, redundant loads removal,....
See chapter 21 from Turbo Pascal 7 Language Guide, to use the last one for MS-DOS as example.
Similar build performance available in other languages, alongside a small set of optimisations.
It is a urban myth that we cannot have both, only because folks experience is tainted with C and C++ compilers.
If you want a good example of fast compilation times with optimisations enabled, check D reference compiler dmd, or to keep on the subject, FreePascal or Delphi 13.
Or if you prefer to travel back to 1993, here is a developer experience using C++ as if it was Lisp Machine/Smalltalk environment with incremental compilation and hot code reloading.
"Lucid Energize Demo"
https://www.youtube.com/watch?v=pQQTScuApWk
With one of the very first ideas of a LSP could be like,
https://dreamsongs.com/Files/Energize.pdf
We got into a culture that accepted slow compilers is normal, it doesn't have to be.
I guess today if you want fast, optimized codegen you need to look more at JIT research since it seems the AOT compiler research seems as you say to have just accepted that slow compilers is normal.
On slow systems of the era, that vastly reduced the amount of work a compiler had to do to turn ASCII into machine code.
These days, compilers run macros, multiple passes of the source code. Often then building their own byte code or an interim machine representation, before turning that into machine code.
Those layers of abstraction aren’t without benefit. You get greater composability of code, greater portability, and so on and so forth. So they exist for a reason.
the game back then was to use inline assembly for the critical bits, this really worked a treat for the meta of the 90s, with computers that were being asked for multimedia processing with slow CPUs, little RAM and typically no hardware acceleration
I wish I still had the code for it - because it had a very simple Wirth-style code generator it was predictable enough that you could even use registers directly in expressions. (M68k, so e.g. you could do "x = D7.w" to set the variable x equal to the low 16 bit word of register D7)
If I recall correctly it already has a few years behind it, thus it was actually written by someone that can use the donation.
> This is not the "original" Borland source code of the Turbo Pascal since it was probably not written in Pascal.
Indeed, it was written in Assembly during the CP/M days, and slowly got to have more Turbo Pascal into it as the language evolved.
As a nerd of a certain age, at one time I had a mighty shelf of programming references from Waite Group and Swan and (of course) O'Reilly. Over time, I let nearly all of them go because it's faster to have stuff available digitally now (and has been for 20 years or more), but I kept a few as keepsakes.
The survivors live on a shelf about six feet from where I'm typing, and there you'll find my K&R book, Booch's work on OO, my college FORTRAN textbook, an O'Reilly twofer (a camel and a baboon; extra points if you can identify those by animal alone), and a fat blue tome called Mastering Turbo Pascal 5.5. It has a rendering of a 911 on the cover. My pal Mike gave it to me for my birthday in probably 1990, back when we were both in college and writing code for a computer lab at the business school there.
Years turned into decades, and we remained close. Last summer, my wife and I relocated to North Carolina, in part because Mike and his wife live here. I'm having lunch with him today, just as I do every week.
Sometimes, good languages make good friends.
Nowadays my favorite language is Go. It appears that among the programming languages that I did use, Go is the one that feels the nearest to Turbo Pascal.