How do computers read code?

preview_player
Показать описание
When you first learned to write code, you probably realized that computers don't really have any common sense. You need to tell a computer exactly what you want. But do you know about all the work the computer does to understand what you mean?

0:00 Intro - Where You've Seen Compilers
1:25 Source Code vs. Machine Code
3:38 Translating Source Code to Machine Code
9:05 How Compilers Make Things Easier
10:39 Outro - The Story of Automation

Video links:

Crash Course Computer Science:

Building the Bits and Qubits

Tools used:
gdb
gcc

Monospaced font:
Menlo-Regular

Images and other visuals:

The IDE in the intro:
Eclipse

Python scripting:
IDLE

Source code distribution example:
Apache httpd on GitHub

Executable distribution examples:
Audacity
VLC media player
Blender

Punch cards:

Early computers:

Complex history of computer languages:

Montage:
Sublime Text
IntelliJ IDEA
IntelliJ IDEA again...

Print "Hello, world!" command:
Python shell

Music:

YouTube audio library:
Sunflower

Incompetech:
Call to Adventure
If I Had a Chicken

Premium Beat:
Cutting Edge Technology
Second Time Around

Swoosh 1 sound effect came from here:
...and is under this license:
Рекомендации по теме
Комментарии
Автор

Whoever writes the compilers are absolute beasts

burntpotatoes
Автор

I remember this quote from the programming classes I took while getting my EE degree. I don't remember who it was attributed to, but...

"Computers always do what you tell them to do, and rarely what you want them to do."

theonionpirate
Автор

When I started to learn how to write code years ago I was told "the computer is one of the dumbest machines, it only follows orders even if they are wrong", it really helped me shape my mind to understand the logic of many programs

SergioEduP
Автор

Mad respect to all the engineers behind compilers.

Insignia_
Автор

"So our program is pretty boring right now, let's add a line to increment x by 1"

Hold up dude, you can't go that fast to such levels of complexity

coffeedude
Автор

When you know how computers work exactly, how the internet works and all that stuff, you get fascinated a lot.

Cyber_One
Автор

"Source code is made only to be understandable to humans"


My brain cells: Ight imma head out

hamadmohammed
Автор

my man just quit after making the best video about compilers, what a legend

janek
Автор

"How do computers read code?"
_by running code_

OonHan
Автор

In a push of a button...
no.. nope..

-Programmer life story

momomi
Автор

When I was teen (15 years ago), I was fascinated in programming. I remember spend a lot of hours on the computer trying to figure out how it works and why a code like "print("Hello world")" works in a machine level, but in that time internet didn't have this kind of videos (in fact, youtube was just beginning).

Nowadays with this kind of videos it's really easy learning about everything and I am still fascinated with computer (but now approaching it from neuroscience) and your skills to transmit this information, however are awesome.

Thanks a lot !

Neurofilia
Автор

How tf did humans figure out how to do this lmao

IAmNumber
Автор

"What you've only done python scripting!?"

*started on C++ and moved to java*
*sweating bullets from dodging a bullet*

quack
Автор

This video managed to take a complex idea and compile it down in a form understandable to our human brains. Funny that :)

exquisite
Автор

lol that python 2/3 joke at the end

edit: didnt realize this is just released 18 minutes ago, nice

uprprsn
Автор

I think my university did it pretty well, first semester you take a class called "Computer Systems, Architecture, Networking and Security", and in that class you work with manually compiling written code to objects and then linking them in assembly then you also covert them to binary aswell, you also cover logic gates and in it some optimization compilers do to your code. It cover os architecture and network protocols and cryptography but I think it's important to understand object linking and compiling otherwise you'll get very confused when you start trying to use cmake and get 20 linking errora haha.

jadedplover
Автор

Imagine doing all the holes for old computer programs and then you realize you forgot a semicolon....

tremon
Автор

Bootstrapping (pull yourself up by your bootstraps / an impossible action) is to compile a compiler from its own source.
It's a chicken and egg situation. Which came first? The compiler? Or its self source? The compiler, born from another language.
The first C++ compiler originated from C. (Bjarne used C to create a C with Classes preprocessor. He used his C with classes language extension to create Cfront. Cfront compiled his C++ language into C. And that's why C and C++ mix together.)

The first C compiler originated from B. (B was first written for the PDP-7 minicomputer. (Programmed Data Processor) It evolved into NB (New B) to support the PDP-11. C was written in NB.)

The first B compiler was written in TMG. (TransMoGrifier)
The first TMG compiler was written in PDP-7 assembly language.

Assembly is machine code made readable. (directly from the opcodes. (operation codes))
Before Assembly, people would've likely used some form of custom assembly code on paper to translate into machine code.

DlcEnergy
Автор

I know you probably won't read this but still, I want to say this is my favourite computer science video on youtube. You explained things in such a clear manner and also not boring one bit. What's really special about your video is how you explain some of the concepts lecturers and others never teach. for eg the part where you talked about how compilers themselves are created.
Thank You for the video <3

ranijoy
Автор

Honestly, the most interesting part was your description of how machine codd works. From the machine code to the output felt always like magic to me, and this starts to give meaning to what is really happening

JonathanMandrake