3 ms·
cfront in the 80s was a far simpler C++ compiler than today. And if you ever looked at the code it generated, you'd be horrified. One major problem it had in g
by WalterBright 5y ago
cfront in the 80s was a far simpler C++ compiler than today. And if you ever looked at the code it generated, you'd be horrified.
One major problem it had in generating C was the lack of COMDAT sections in the generated object file. This was needed for generating code for the same member function in multiple source files. C compilers would just stick the code into the text segment, resulting in multiple declaration errors from the linker.
I am not saying Bjarne was an inept programmer. He's actually brilliant, it was just a very very hard problem he set for himself, and it's amazing cfront worked as well as it did.
The cfront on DOS also was very slow (imagine writing the generated source code out to floppies!) and crippled because it didn't have near and far pointers. Zortech C++ was the first native C++ compiler, which bypassed all these problems. ZTC++ simply vaulted over cfront by making C++ simple and fast on DOS. DOS at the time was where 90% of the programming action was, so this was no small thing.
My opinion, and that of a few others at the time, was that Zortech saved C++ from oblivion by having a usable implementation on DOS. You can see that by the traffic level in comp.lang.c++ at the time - it took off immediately after ZTC++ was released, and never looked back.
- sitkack 5y agoI always love your responses. I didn't know about COMDAT, but I did use the SAS compiler on the Amiga which was Cfront based. I didn't know enough to be horrified, but I often looked at the output because I was integrating the output with regular C code (interpreters, Arexx, etc). It was kinda like Hungarian Notation++ ;) I got to the point where it felt natural to read the name mangling. The Amiga SAS/C compiler was also pretty slow. I can see how ZTC would be popular in by skipping intermediates and not having to reinvoke the compiler. How many problems from the 80s melted away because of the large amount of ram available in the 90s?
- WalterBright 5y agoOne problem that melted away was the compiler's 3 separate passes could be merged into one! Also, the amount of code in the compiler increased enormously from the 80's to today.