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

  Переглядів 115,644

Lex Fridman

Lex Fridman

День тому

This is a clip from a conversation with Bjarne Stroustrup from Nov 2019. New full episodes are released once or twice a week and 1-2 new clips or a new non-podcast video is released on all other days. You can watch the full conversation here: • Bjarne Stroustrup: C++...
(more links below)
Podcast full episodes playlist:
• Lex Fridman Podcast
Podcasts clips playlist:
• Lex Fridman Podcast Clips
Podcast website:
lexfridman.com/ai
Podcast on Apple Podcasts (iTunes):
apple.co/2lwqZIr
Podcast on Spotify:
spoti.fi/2nEwCF8
Podcast RSS:
lexfridman.com/category/ai/feed/
Note: I select clips with insights from these much longer conversation with the hope of helping make these ideas more accessible and discoverable. Ultimately, this podcast is a small side hobby for me with the goal of sharing and discussing ideas. I did a poll and 92% of people either liked or loved the posting of daily clips, 2% were indifferent, and 6% hated it, some suggesting that I post them on a separate UKposts channel. I hear the 6% and partially agree, so am torn about the whole thing. I tried creating a separate clips channel but the UKposts algorithm makes it very difficult for that channel to grow. So for a little while, I'll keep posting clips on this channel. I ask for your patience and to see these clips as supporting the dissemination of knowledge contained in nuanced discussion. If you enjoy it, consider subscribing, sharing, and commenting.
Bjarne Stroustrup is the creator of C++, a programming language that after 34 years is still one of the most popular and powerful languages in the world. Its focus on fast, stable, robust code underlies many of the biggest systems in the world that we have come to rely on as a society. If you're watching this on UKposts, many of the critical back-end component of UKposts are written in C++. Same goes for Google, Facebook, Amazon, Twitter, most Microsoft applications, Adobe applications, most database systems, and most physical systems that operate in the real-world like cars, robots, rockets that launch us into space and one day will land us on Mars.
Subscribe to this UKposts channel or connect on:
- Twitter: / lexfridman
- LinkedIn: / lexfridman
- Facebook: / lexfridman
- Instagram: / lexfridman
- Medium: / lexfridman
- Support on Patreon: / lexfridman

КОМЕНТАРІ: 178
@lexfridman
@lexfridman 4 роки тому
This is a clip from a conversation with Bjarne Stroustrup from Nov 2019. New full episodes are released once or twice a week and 1-2 new clips or a new non-podcast video is released on all other days. If you enjoy it, subscribe, comment, and share. You can watch the full conversation here: ukposts.info/have/v-deo/rYSphnxsmJ1jmHU.html (more links below) Podcast full episodes playlist: ukposts.info/slow/PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 Podcasts clips playlist: ukposts.info/slow/PLrAXtmErZgOeciFP3CBCIEElOJeitOr41 Podcast website: lexfridman.com/ai Podcast on Apple Podcasts (iTunes): apple.co/2lwqZIr Podcast on Spotify: spoti.fi/2nEwCF8 Podcast RSS: lexfridman.com/category/ai/feed/
@ianpan0102
@ianpan0102 4 роки тому
"I couldn't write my own linker!" (pauses for a second) "...Actually, I could." - Bjarne Stroustrup
@dannydk6
@dannydk6 3 роки тому
He wouldn’t have enough time to work on the language if he built 25+ linkers
@dialecticalmonist3405
@dialecticalmonist3405 2 роки тому
It brings up an interesting notion. A notion that applies to computer science in the most fundamental way. The notion of TIME. Anyone "could" do anything. A baby "could" eventually write their own linker. Or perform brain surgery, etc. It's just a question of time and efficiency. He "could" have done it, but would it be worth his time?
@yash1152
@yash1152 Рік тому
1:09
@TheSast
@TheSast Рік тому
​@@dialecticalmonist3405Every baby has done anything a human has ever done! Because they grew, up.
@rosomak8244
@rosomak8244 6 днів тому
@@dannydk6 Not really. It's a doable task.
@sundeepjoshi9773
@sundeepjoshi9773 4 роки тому
The moment when he says: when i designed C++
@anatheistsopinion9974
@anatheistsopinion9974 3 роки тому
He's basically God at this point
@pendergastj
@pendergastj 3 роки тому
@@anatheistsopinion9974 Ironic for you to say.
@giancedrick507
@giancedrick507 3 роки тому
@@pendergastj If I weren't catholic I would say the same
@sundeepjoshi9773
@sundeepjoshi9773 3 роки тому
@@pendergastj 😂🔥
@kevinjones238
@kevinjones238 3 роки тому
@@ollydix The language, as a whole, is so expressive that it tends to introduce more problems(via buggy code) than provisions for solutions. C++ could be one of the most productive programming languages while being the most troublesome at the same time. James Gosling and Bjarne Stroustrup both agreed on that finding when Java started gaining appeal in the mid to late 1990's.
@senatorpoopypants7182
@senatorpoopypants7182 3 роки тому
Man the energy in the room, like calm down folks I get that you're excited but calm down
@JaapVersteegh
@JaapVersteegh 4 роки тому
"All this good stuff that we want!" His smile with that reveals a lot.
@rosalineslon6910
@rosalineslon6910 4 роки тому
Excellent interview thank you. Two important facts to do for a responsibly outcome efficiency and reliability. I agree 100% to know the basics in whatever you are going to do. Gave you the micro knowledge of how things work.
@solomonaryeetey7370
@solomonaryeetey7370 4 роки тому
I love Lex, except he always sounds like he just got up from bed :) Great interview
@mokhan6052
@mokhan6052 4 роки тому
I noticed a lot of developers have that demeanor I think it's just from sitting too long at a time everyday. He seems pretty cool tho as unlike other developers, he has a LOT of hobbies 👌
@onjofilms
@onjofilms 4 роки тому
No room for drama in technology. That's for the liberal arts.
@BryanBortz
@BryanBortz 3 роки тому
I wish I spoke that slowly and carefully.
@AZOffRoadster
@AZOffRoadster 3 роки тому
A bit monotone. Wonder what he sounds like when he gets excited.
@adityasinghrathore3935
@adityasinghrathore3935 3 роки тому
I initially thought you meant Lex Luther (Bjarne , He would make a great villain ) 😂😂😂
@ChrisM541
@ChrisM541 Рік тому
I was hoping this question would be about the significant differences in machine code/assembly (size and executable speed) between these different compilers - for the SAME destination CPU.
@matthewmoulton1
@matthewmoulton1 Рік тому
I honestly don't think that would be a productive conversation. Which architecture(s) do we choose to talk about? What program(s) are we compiling for that architecture? Broadly speaking, the major compiler implementations for C++ are the same: they only differ (for the user) when you start comparing specific examples. And when you start getting too specific, you risk your facts getting out of date. All of the implementations are still being worked on.
@shreyanshsharma9228
@shreyanshsharma9228 3 роки тому
Lots od whistles in one video! But really love the conversation ❤️
@dsuess
@dsuess 8 місяців тому
Absolutlely amazing interview! Bjarne Stroustrup is a living legend and living history. Its amazing to hear his humble perspective
@jonathanmoore5619
@jonathanmoore5619 3 роки тому
What a lad. A real hero....
@kanglei7807
@kanglei7807 Рік тому
Is there any source code analysis information for clang? Or how to read the source code of large projects
@kylegaijin
@kylegaijin 2 роки тому
Love your show. I'm not real familiar with some of the vocabulary and I think the words such as front-end, back-end, compiler, etc... are overloaded just enough that it's difficult to find a reasonable explanation on Google. Can you help me understand what front-end / back-end means when talking about compilers? My intuition is suggesting that a compiler is the part of the tool-chain that creates the actual machine code - or possible assembly. I'm not sure if this is synonymous with back-end. And front-end sounds like it's just a parser that streams an AST to any number of backends. So a C++ frontend could write to a C back-end ? Sort of confusing - but I'm quite curious.
@abhinavchavali1443
@abhinavchavali1443 2 роки тому
front end parses the syntax and generates some sort of intermediate, platform independent representation. Backend takes that IR, and generates native machine code for that architecture/OS and performs optimizations
@kylegaijin
@kylegaijin 2 роки тому
@@abhinavchavali1443 thanks !! I like your explanation.
@MarcosCpp
@MarcosCpp 4 роки тому
That is, all are good depending on the architecture and system that it will be compiled. But the most complete for sure is the GCC.
@destiny_02
@destiny_02 2 роки тому
Actually in terms of Standard Library, MSVC is the most complete. In terms of core features GCC and Clang are most complete
@laughingvampire7555
@laughingvampire7555 7 місяців тому
removing the monoculture from the compiler just moves it to the language
@IsozwWz
@IsozwWz Рік тому
I think the last question was misinterpreted ;) Lex was talking about a clean slate C++ language, while Bjarne assumed they were still talking about compilers.
@dheerajkrishnaputrevu
@dheerajkrishnaputrevu 3 роки тому
Man Bjarne Stroustrup talks like Derry Murbles from Parks and Rec
@JMiskovsky
@JMiskovsky 3 роки тому
One implemention, one compiler, one c++! / Sarc
@EasternBoss
@EasternBoss Рік тому
What I understood is they're many machines and not all the machines compatible with one single compiler. Is that what Berjan means?
@GeGa-jq5es
@GeGa-jq5es 11 місяців тому
every machine has its own structure and assembly so yeah not every machine is the same
@yirenxindudu
@yirenxindudu 2 роки тому
Linus is his friend
@scottfranco1962
@scottfranco1962 3 роки тому
Do you expect a C++ compiler to be written from scratch? Well, Clang was written from scratch.... No I mean in the last 5 minutes....
@rosomak8244
@rosomak8244 6 днів тому
I'm pretty sure that rather sooner than later someone will write a new C++ compiler. And I'm 100% sure that it will be done in Rust. They will claim that it will be supposedly better to do it this way.
@JakobKenda
@JakobKenda 10 місяців тому
2:50 "I happen to dislike monocultures." The Rust foundation can afford to do whatever the hell they want because Rust only has one compiler. I think it would be very good if GCC manages to implement a Rust frontend. But there has to be a standard first.
@ballsnface2416
@ballsnface2416 3 роки тому
Mono-culture=intel for 10 years.
@kyleheaser2385
@kyleheaser2385 3 роки тому
Intel became a monoculture.
@loknathshankar5423
@loknathshankar5423 3 роки тому
Well CLR is monoculture... atleast its kind of open source now
@yash1152
@yash1152 Рік тому
clr ??
@aidsralientv
@aidsralientv Рік тому
@@yash1152 The Common Language Runtime, basically executes the binary executables that were written in C#
@luisgonzalez1637
@luisgonzalez1637 4 роки тому
GCC all day!
@pendergastj
@pendergastj 3 роки тому
GCC is great at taking all day.
@coshvjicujmlqef6047
@coshvjicujmlqef6047 3 роки тому
@@rakinrahman890 clang SUCKS and only losers use it
@pendergastj
@pendergastj 3 роки тому
@Vishwesh Rajurkar Uh. No it isnt. Visual C++ is the most behind on the standard and is non-conforming. It also produces extremely slow machine code and has limited optimization
@michaelrosen6478
@michaelrosen6478 3 роки тому
@@rakinrahman890 Maybe early versions of Clang. Clang nowadays is just as slow as GCC. Seriously. Have you even compiled anything with either lately?
@bennguyen1313
@bennguyen1313 4 роки тому
He mentions 4 frontend compilers (clang gcc, microsoft, edg), but what about Zig, mingw64, llvm, icc? How do these fit in the picture?
@matthiasschuster9505
@matthiasschuster9505 4 роки тому
Llvm is no compiler?
@callykitten5095
@callykitten5095 4 роки тому
mingw *is* GCC unless I'm wrong? Minimal GCC?
@lonewolfakela6602
@lonewolfakela6602 3 роки тому
mingw64 is GCC. LLVM is a backend (which is used by clang), not a frontend. icc, if I remember correctly, use edg as its frontend. And, correct me if I'm wrong, but I don't think zig compiler compiles c++ (it does compile c, though)
@X_Baron
@X_Baron 3 роки тому
Intel's compiler is a back-end designed to produce well optimized machine code for Intel's hardware specifically, similarly to the "embedded" back-ends Bjarne mentions.
@gregmantis
@gregmantis 3 роки тому
Zig CC is built on top of the clang libraries. Mingw64 is a GCC port. LLVM is essentially a set of libraries from which you can build a compiler from and is closely tied with clang which is a set of libraries under the umbrella of the LLVM project for parsing and otherwise manipulating C-family languages. ICC used to be built on EDG but I think they've been transitioning to Clang recently. Essentially, C++ is a language that is not designed to be easy to parse. Its not just a case of building a simple EBNF recursive descent parser. You sometimes have to finish parsing an entire statement before you know what the first few tokens refer to (look up the "most vexing parse" as an example). Because of that it's not worth considering writing your own front end unless you have a really good reason and a lot of resource. EDG is a good commercial option. GCC's aim is to provide a free software implementation and Clang was designed to be highly modular and open source without GPL restrictions. I'm not sure why Microsoft have their own frontend but I'm sure it's historical, and even they use EDG for Visual Studio's Intellisense feature, and Clang for a few other things. I'm not aware of any other frontends that are in any way complete/compliant. Typically any compiler you come across will be based on one of the above.
@uoweme5grand
@uoweme5grand 3 роки тому
At what point do you just say fuck it and cut it all off
@markcuello5
@markcuello5 Рік тому
PLEASE HELP ME.
@antwanwimberly1729
@antwanwimberly1729 4 місяці тому
#wan
@mavhunter8753
@mavhunter8753 4 роки тому
I disagree with his overly complex language design decisions, and his dubious motivations for creating c++, but I couldn't agree with him more on the dangers of mono culture. For that his has an ally in me.
@mannyw_
@mannyw_ 4 роки тому
Mav Hunter What were his dubious motivations?
@a-j.2002
@a-j.2002 4 роки тому
Why would you say it's an overly complex language? I'm curious.
@hikarii8758
@hikarii8758 4 роки тому
so what do you think is not overly complex then you Eva nerd?
@Artaxerxes.
@Artaxerxes. 3 роки тому
Better than that piece of garbage java
@bagzhansadvakassov1093
@bagzhansadvakassov1093 3 роки тому
@@Artaxerxes. the hell is wrong with java?
@coshvjicujmlqef6047
@coshvjicujmlqef6047 4 роки тому
Still GCC. LLVM/Clang is far from actually usable. Especially on windows.
@matthiasschuster9505
@matthiasschuster9505 4 роки тому
People on Windows most likely use Visual studio and projects like Kdevelop have switched to llvm/clang fully and not regretted it since. That being said, I dont know how usable llvm/clang is actually on Windows, so might be an issue with your system specifically
@coshvjicujmlqef6047
@coshvjicujmlqef6047 4 роки тому
@@matthiasschuster9505 Wrong. LLVM never fully supports windows. The stuff you are using is clang-cl, which is using partial of msvc toolchain. The only real alternative on windows is GCC, not clang. GCC has full support on windows, including libstdc++. Native C++ standard library support for GNU toolchain.
@coshvjicujmlqef6047
@coshvjicujmlqef6047 4 роки тому
@@matthiasschuster9505 This is GCC I built recently. bitbucket.org/ejsvifq_mabmip/mingw-gcc
@coshvjicujmlqef6047
@coshvjicujmlqef6047 4 роки тому
​@@matthiasschuster9505 LLVM is a terrible toolchain. Worst C++20 support.
@bored78612
@bored78612 3 роки тому
Lol the browser you are writing this on in Windows is most probably compiled on Clang.
@owlmostdead9492
@owlmostdead9492 Рік тому
C++ syntax is the worst part about C++
@mattr2238
@mattr2238 3 роки тому
Microsoft's version routinely breaks and fails to compile anything.
@dylankerler3409
@dylankerler3409 3 роки тому
Rust is proof that monoculture is better than competition. A single standard for package management, documentation, compiler errors etc. is better than multiple implementations of all of them. Because what ends up happening is a developer is forced to learn every single implementation in order to be able to integrate and work with others; A huge waste of time.
@rdstevens1
@rdstevens1 3 роки тому
Felipe Trzaskowski but they didn’t, because GCC wasn’t interested in that kind of thing. Until clang came along and made it sit up and take notice.
@michaelrosen6478
@michaelrosen6478 3 роки тому
Rust is proof that monoculture is shit. You can't run Rust on a bunch of embedded systems, arguably where Rust would be most useful, because they don't have LLVM support. You have "trusting trust" vulnerabilities, because there are no alternative frontends (that are anywhere near complete, at least). Cargo is shit - it makes build times slow because people statically link in like 50 different libraries because they think Cargo makes it 'so easy' to dependency manage, meaning that they feel like they don't have to dependency manage properly themselves. Also, Cargo doesn't work with anything else, and the worst part is that no one in the Rust team seems to care. Also, Bjarne mentions "compile time speed" as one of the reasons for wanting multiple implementations. This is the single best argument against your "implementation monoculture" - rustc is hideously fucking slow. You think highly templated C++ is bad? It complies in like one tenth of the speed of Rust. Maybe if we had other Rust compilers, rustc might be faster.
@TheJoKeR7
@TheJoKeR7 2 роки тому
You're confusing standardization and implementation, you don't need to learn every implementation of every compiler as long as you write c++ standard compliant code ! that's why the standard is there for !
@kylek.3689
@kylek.3689 Рік тому
@@michaelrosen6478 I'm leaving this comment here so I can come back after running a flamegraph on the Rust compiler and see where the greatest amount of time is spent during compiling.
@Cooldownman197
@Cooldownman197 Рік тому
@@kylek.3689 Yeah sure I am also waiting when Rust beats C++.
@abhyaskanaujia3862
@abhyaskanaujia3862 3 роки тому
The most uninterested interviewer ever
@mikhail5002
@mikhail5002 3 роки тому
you're a fool to think that.
@Lensr
@Lensr Рік тому
The most uninteresting comment ever :p Just because he doesn't do screaming UKpostsr nonsense doesn't mean he doesn't care. He clearly asks very intriguing and thoughtful questions. I don't like lex but I like bullshit UKposts comments like yours that do nothing except punch down even less
The Design of C++ , lecture by Bjarne Stroustrup
1:15:52
Computer History Museum
Переглядів 311 тис.
Самый большой бутер в столовке! @krus-kos
00:42
Кушать Хочу
Переглядів 5 млн
Мама и дневник Зомби 🧟 #shorts
00:47
INNA SERG
Переглядів 848 тис.
Повістки у Києві: «Яке право вони мають забирати всіх мужиків?» #війна #мобілізація #військові
00:41
Слідство.Інфо | Розслідування, репортажі, викриття
Переглядів 719 тис.
Linus Torvalds: We Don't Use Windows
2:58
TFiR
Переглядів 1,1 млн
C++ vs Rust: which is faster?
21:15
fasterthanlime
Переглядів 361 тис.
LLVM и GCC / Register allocation / IT-образование в вузах (часть 1)
57:44
Истовый Инженер
Переглядів 14 тис.
Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
1:47:13
Lex Fridman
Переглядів 1 млн
Is The Universe Just A Giant Brain? Some Scientists Think So.
15:33
Joe Scott
Переглядів 950 тис.
Full Interview With the Creator of C++
23:30
Honeypot
Переглядів 31 тис.
Bjarne Stroustrup: Learn More than One Programming Language
6:57
Lex Fridman
Переглядів 136 тис.
Bjarne Stroustrup - The Essence of C++
1:39:11
The University of Edinburgh
Переглядів 1,1 млн
Сомнительно... Ну Окэй... Распаковал Nothing Phone (2a)
16:19
РасПаковка ДваПаковка
Переглядів 54 тис.
The PA042 SAMSUNG S24 Ultra phone cage turns your phone into a pro camera!
0:24