back to index

Bjarne Stroustrup: C++ Implementations - Clang, GCC, Microsoft, and EDG


Chapters

0:0 Intro
0:30 Multiple implementations
1:0 Backend infrastructure
1:30 Compilers
2:30 Monoculture
3:0 Barriers
3:30 Competition
4:0 Conclusion

Whisper Transcript | Transcript Only Page

00:00:00.000 | So is there differences in your view, not saying which is better or so on, but differences
00:00:09.420 | in the different implementations of C++?
00:00:13.820 | Why are there several sort of maybe naive questions for me?
00:00:17.800 | GCC, Clang, so on.
00:00:21.820 | This is a very reasonable question.
00:00:24.600 | When I designed C++, most languages had multiple implementations.
00:00:33.840 | Because if you run on IBM, if you run on a Sun, if you run on a Motorola, there was just
00:00:40.400 | many, many companies and they each have their own compilation structure and their old compilers.
00:00:46.420 | It was just fairly common that there was many of them.
00:00:50.260 | And I wrote C front, assuming that other people would write compilers for C++ if I was successful.
00:00:58.840 | And furthermore, I wanted to utilize all the backend infrastructures that were available.
00:01:06.320 | I soon realized that my users were using 25 different linkers.
00:01:10.200 | I couldn't write my own linker.
00:01:12.240 | Yes, I could, but I couldn't write 25 linkers and also get any work done on the language.
00:01:21.060 | And so it came from a world where there was many linkers, many optimizers, many compiler
00:01:28.400 | front ends, not to start, but many operating systems.
00:01:35.080 | The whole world was not an 86 and a Linux box or something, whatever is the standard
00:01:41.280 | today.
00:01:42.280 | In the old days, they said a set of X.
00:01:45.780 | So basically I assumed there would be lots of compilers.
00:01:49.580 | It was not a decision that there should be many compilers.
00:01:53.700 | It was just a fact.
00:01:55.420 | That's the way the world is.
00:01:57.620 | And yes, many compilers emerged.
00:02:03.260 | And today there's at least four front ends, Clang, GCC, Microsoft, and EDG.
00:02:14.540 | It is design group.
00:02:16.420 | They supply a lot of the independent organizations and the embedded systems industry.
00:02:24.220 | And there's lots and lots of backends.
00:02:27.140 | We have to think about how many dozen backends there are because different machines have
00:02:34.020 | different things, especially in the embedded world, the machines are very different.
00:02:39.120 | The architectures are very different.
00:02:42.340 | And so having a single implementation was never an option.
00:02:49.580 | Now I also happen to dislike monocultures.
00:02:54.660 | Monocultures?
00:02:55.660 | They are dangerous because whoever owns the monoculture can go stale and there's no competition
00:03:03.820 | and there's no incentive to innovate.
00:03:07.140 | There's a lot of incentive to put barriers in the way of change because, hey, we own
00:03:13.020 | the world and it's a very comfortable world for us.
00:03:16.140 | And who are you to mess with that?
00:03:19.860 | So I really am very happy that there's four front ends for C++.
00:03:26.940 | Clang's great, but GCC was great, but then it got somewhat stale.
00:03:34.020 | Clang came along and GCC is much better now.
00:03:38.660 | Competition is good.
00:03:39.660 | Microsoft is much better now.
00:03:41.900 | So at least a low number of front end puts a lot of pressure on standards compliance
00:03:53.100 | and also on performance and error messages and compile time speed, all this good stuff
00:03:59.340 | that we want.
00:04:01.940 | Do you think, crazy question, there might come along, do you hope there might come along
00:04:09.060 | an implementation of C++ written, given all its history, written from scratch?
00:04:17.300 | So written today from scratch?
00:04:20.100 | Well, Clang and the LLVM is more or less written from scratch.
00:04:25.780 | But there's been C++ 11, 14, 17, 20.
00:04:30.780 | You know, there's been a lot of...
00:04:31.780 | I think sooner or later somebody is going to try again.
00:04:34.780 | There has been attempts to write new C++ compilers and some of them has been used and some of
00:04:41.660 | them has been absorbed into others and such.
00:04:43.940 | Yeah, it'll happen.
00:04:44.820 | Yeah.
00:04:45.320 | Yeah.
00:04:50.320 | Yeah.
00:04:55.320 | Yeah.
00:05:00.320 | [BLANK_AUDIO]