How does a compiler work?
Vložit
- čas přidán 3. 06. 2024
- In this video we'll take a look at how compilers work and the process they take to turn code into something a computer can execute
0:00 Intro
1:04 Stage 1
1:42 Stage 2
2:22 Stage 3
2:40 Stage 4
Links
========================================================
Lexer output:
- clang++ -fsyntax-only -Xclang -dump-tokens code.cpp
- godbolt.org/z/zTTrYs189
Parser output:
- clang++ -fsyntax-only -Xclang -ast-dump code.cpp
- godbolt.org/z/Td71dcKzP
Code gen output:
- clang++- -S -masm=intel code.cpp && cat code.s
- godbolt.org/z/acrsGqxKM
💭 All views are my own 💭
Kit
========================================================
🎥- DJI Pocket 2 Creator Combo - amzn.to/3kxQeZh
🎙️- Blue Yeti - amzn.to/3EE1Wsm
💡- Govee Floor Lamp - amzn.to/3ZisN4Y
⌨️- Corsair K70 RGB MK.2 - amzn.to/3EDIonM
Books
========================================================
📖 - Effective Modern C++ - amzn.to/3EDIonM
📖 - A Tour of C++ - amzn.to/41pI1qH
📖 - C++ Templates: The Complete Guide - amzn.to/3Zmi0ql
Music
========================================================
Get Summer's Shadow by Max Brodie and over 1M + mainstream tracks here go.lickd.co/Music
License ID: ab7ZXzLZ4lX
Got it, compilers are black magic.
Your production and editing is getting better! Honestly your videos deserve a lot more views. Thanks a lot for teaching us how a compiler works!
Thanks for the kind words, glad you enjoyed it (:
I love the production value!!! The sound effects and random bits and bobs flying around are meme-worthy.
Glad you enjoyed it!
Dude, I am so happy I came across your channel. I am equally impressed between your depth of knowledge, presentation and pedagogy. Subbed & liked!
You hand movements are very distracting. But I learn a lot from your videos. Thanks for the videos!
2nd this
@@mattko his avatar in the middle of the screen making fast movements adds no value
Well, I fiddled around with TCC, modifying it, and that helps you understand how it works(tokens, optimization and assembly)
Thank you for this very useful video!
Glad it was helpful!
A visualisation of the AST would be nice (not used by clang but ANTLR has nice tools for this) as would you moving your arms slightly less - it's a little distracting.
Overall another great video.
Thanks for the suggestions, unfortunately that's just how I talk/teach as it helps me keep pace. Glad you enjoyed it (:
Hilarious Anamorphs thumbnail! 10/10 made me lol
great video
Love your presentation. Can you make a video on full bootstrapping too? The first time I have heard about the trusting trust issue it blew my mind. Its the elephant in the room that nobody ever talks about. I think everyone should at least know about it.
Hello , i have a question i know how computer add and substract by binary but i don't know how it convert the results to things that i can read and understand for an example comuter added 2 and 5 the result is 7 how computer shows me specific pixels on 7 shape which i can read ?
Good video!
Thanks!
noice!
That Animorphs thumbnail tho!
I spent longer on that thumbnail than I care to admit...
thanks!!
You’re welcome (:
Yeah that’s cool but the actual magic happens where the assembly turns into binary right? Where does this happen?
For me the compiling process is:
Syntax scanning
Semantic analysis
Code optimization
Code generation
Is correct?
Pretty much, I omitted optimisation for brevity, but did include the linker stage.
amazing well explain just subscribe ,though i will recomend to increase the volume
Please, can you tell me what is the stage4?
Sorry I'm not sure I understand, I covered the four stages in the video?
Sorry@@nathanbaggs in the video, the last box is named "stage 4". Which will be the name to replace it?
Ah I see what you mean. Last stage is linker
the hand gestures are way too fast and your avatar is in the middle of the screen which adds no value, please edit that out to make your video more effective.
You probably are British or my listening skills are so pity... (English is not my native)