This brings back fond memory of using Modula-2 on the Amiga. The local Modula implementation even produced faster and smaller code than the default C compiler. While Turbo Pascal basically retrofitted all important parts from Modula onto Pascal, it would have been nice to have a Turbo Modula-2 on the PC too. Actually I would like to have a modern version of that around still.
One of the aspects why I like Go is, that it included many of the good parts of Modula-2, giving them a more modern look by using the C-style syntax.
While arguably Modula-2 two was an improvement upon Pascal, Turbo Pascal was an amazing implementation and fixed enough of Pascal issues that it won.
Turbo Pascal started life as BLS Pascal for Nascom 2 by Anders Heilsberg, published by Poly Data in 1981. In was quickly ported to CP/M and renamed COMPAS Pascal, brought into Borland and renamed Turbo Pascal, then ported to DOS ...
I worked professionally with the latter and worked on a large system which would have been impossible without the Unit module system that TP added.
If Modula-2 had existed with Anders started BLS Pascal, he'd almost certainly had based it on that and it would have been better. I don't think it would have mattered though. In the end C won and would still have won (even though it is a less safe language).
[I don't like Wirth's syntax, so I've been reskinning Oberon-07 to look more Nim-like].
Note the compilation times. Turbo Pascal was pretty awesome in that regard. On the other hand, this was TP 3, which Modula handily beats on, well, modularization. IIRC all you could do in those early days was literal preprocessor includes and that weird overlay thing.
One of the primary languages I was taught in college was Modula-3. At the time it was a huge improvement over both Pascal (which was also taught) but it had some of the same power as C++ but was much safer.
I was always a bit sad it didn't catch on.
I was taught Modula-2 in college as well... 5 years ago. I think they have removed it from the curriculum now though, and just use C that semester, sadly
It seems the difference in execution could be that modula interprets array of boolean as a tp set. I'd be curious to see the time of tp using set instead.
Edit: to clarify, the differece would be array access vs. bit mask of a variable.
Orders of magnitude difference in buid time is significant enough. Sample code also shows no tangible benefit in using Modula/2. No wonder it went away quickly.
Oberon, on the other hand, is an entirely different story.
There is no feature in the Modula language which makes it compilation fundamentally slower than the compilation of Pascal. Actually, Turbo Pascal later retrofitted the main Modula feature - seperate compilation of modules - onto the Pascal language in the form of units.
The observed differences in the compile times should come from implementation differences of the compilers - the fact that the Modula compiler took longer to run but produced the faster executable hints towards the Modula compiler spending its time on code optimization.
And yes, the sample code shows no benefit, but once your code grows, Units/Modules are pretty nice to have, even on constrained systems. And this version of Turbo Pascal didn't have this (nor Pascal in general, resulting in huge hodgepodge of incompatible dialects).
I never did much with coroutines in general and don't know how useful they'd be on a Z80 CP/M system…
Borland gave up on Turbo Modula-2 and decided to extend Turbo Pascal, with Modula-2 features.
In the MS-DOS golden days, Turbo Pascal was the best Pascal dialect, to the point it was more relevant if a Pascal compiler was compatible with Turbo Pascal dialect than with the ISO Pascal.
Also the reason why although ISO Extended Pascal was created as a means to solve the initial complains regarding ISO Pascal, almost no one cared about its existence.
Modula-2 had more commercial success on other systems.
It might be nice to have a standalone Z80 compiler for Modula-2 (or TP, for that matter) for retro game programming. Of course, you're going to have to emulate this compiler since it's also written in Z80 machine code...
One of the aspects why I like Go is, that it included many of the good parts of Modula-2, giving them a more modern look by using the C-style syntax.