Bjarne Stroustrup: C++ Implementations - Clang, GCC, Microsoft, and EDG
Watch on YouTubeVideo summary
Bjarne Stroustrup explains that the existence of multiple C++ implementations, including GCC, Clang, Microsoft Visual C++, and EDG (Eclipse Development Group), was not a deliberate design choice but rather an inevitable reflection of the computing landscape when he created the language. In his early vision for C++, it was assumed that many different companies would develop their own compilers to run on various operating systems such as Sun, Motorola, and others, just as they did with older languages like PDP-11 or 86-based Linux boxes today. Stroustrup explicitly states he never intended a single implementation; instead, he anticipated the need for diverse front ends because users were already utilizing twenty-five different linkers alone, making it impossible to maintain compatibility without leveraging existing backend infrastructure from these varied sources. The necessity of supporting multiple compilers is further driven by the diversity of hardware architectures, particularly in the embedded systems industry where machines vary significantly and cannot be served by a single implementation. Stroustrup warns against "monocultures," arguing that when one entity controls an entire ecosystem, there is little incentive to innovate or improve performance because competitors are absent. He notes that owners of such monopolies often become stagnant and may erect barriers to change simply to protect their comfortable position. The presence of at least four distinct front ends today creates essential competition that pressures the standard committee regarding compliance, error messages, compile time speed, and overall optimization quality. Historically, GCC was a dominant force but eventually became somewhat stale before Clang emerged as a revitalizing competitor, forcing improvements in both areas. Similarly, Microsoft's implementation has evolved to become much better over time due to this competitive pressure. Stroustrup expresses satisfaction that the C++ ecosystem remains fragmented rather than unified under one provider, ensuring continuous advancement across all major platforms. This dynamic environment ensures that no single group can dictate terms without facing scrutiny from others who are actively working on alternative implementations and backends. Looking toward the future, while it is unlikely a completely new compiler will be written entirely from scratch given the extensive history of C++ standards versions 11 through 20, attempts to build fresh compilers continue to occur periodically. Some of these projects have been absorbed into larger ecosystems or used directly by specific communities before fading away or merging with others like LLVM-based solutions. Stroustrup acknowledges that someone will inevitably try again in the future to write a new C++ compiler from scratch, driven by the same necessity for innovation and adaptation that has characterized the language's development since its inception decades ago.
Read the full video transcript
it says there differences in your view
not saying which is better or so on but
difference in the different
implementations of C++ why are there
several sort of money of you naive
questions for me
GCC clang so this is a very reasonable
question when I designed C++
most languages have multiple
implementations because if you wanna I
p.m. if you run on the Sun if you wanna
Motorola those just many many companies
and they each have their own compilation
structure the old compilers it was just
fairly common that those many of them
and I wrote C front assuming that other
people would write compilers for c++ if
i was successful and furthermore i
wanted to utilize all the backend
infrastructure were available I soon
realized that my users were using 25
different linkers I couldn't write my
own linker yes I could but I couldn't
write 25 linkers and also get any work
done on the language and so it came from
a world where there was many linkers
many optimizers many compiler front ends
not not to start but over at many
operating systems the whole world was
not an 86 and linux box or something
whatever is the standard today in the
old days they said a set of X so
basically I assumed there'd be lots of
compilers it was not a decision that
there should be many compilers it was
just a fact that's the way the world is
and yes many compilers emerged and today
there's at least four front ends clang
GCC Microsoft and EDG it is the same
group they they supply a lot of the
independence organizations and the
embedded systems industry and there's
lots and lots of backends we have to
think about how many dozen begins there
are because different machines have
different things especially in the
embedded world the machines are very
different the architectures are very
different
and so having a single implementation
was never an option
now I also haven't disliked monocultures
monocultures they are dangerous because
whoever owns the monoculture can go
stale and there's no competition and
there's no incentive to innovate there's
a lot of incentive to put barriers in
the way of change because hey we own the
world and it's a very comfortable world
for us and who are you to to mess with
that so I really am very happy that
there's four front ends for C++ clanks
great but GCC was great but then it got
somewhat stale plane came along and GCC
is much better now competition why
Microsoft is much better now so hello at
least a low number of front end puts a
lot of pressure on
stand-ups compliance and also on
performance and error messages and
compile time speed all this good stuff
that we want do you think crazy question
there might come along you hope that
might come along implementation of C++
written given all its history written
from scratch so written today from
scratch well playing and the LLVM as
more less written by from scratch but
there's been c++ 11 14 17 20 you know
this is a lot you know later somebody's
going to try again there has been
attempts to write new C++ compilers and
some of them has been used and some of
them has been absorbed into others and
so it's yeah it'll happen
you