Compilers, How They Work, And Writing Them From Scratch

preview_player
Показать описание
Here's my compiler discussed in the video:

And the web-demo:

Finally, check out my website and my blog!

If you're interested, check out my shell, too!

This is a reupload with better audio mixing!
Рекомендации по теме
Комментарии
Автор

ITS MY SLEEPOVER AND I GET TO PICK THE MOVIE

Conman
Автор

Opened with Brainfuck, compared caveman speak to the x64 instruction set, and created a language even simpler than Python. My god, the steel balls and genius of this man are insane. Good things ahead for you. As an aspiring 17 year old programmer this vid makes me so happy.

dragonfiregaming
Автор

This dude casually demonstrates how he programmed a language, a compiler and a OS. He has Terry Davis levels of genius (Strictly talking about programming of course).

tomful
Автор

Yooo, you were my TA. Quality content and super clear way of explaining!

ethanly
Автор

As a fellow programming language and compiler/program analysis enthusiast, I find your work very inspiring. I've only recently discovered that this is one of my favourite areas of swdev, and I'm very pleased to see someone else out there with the same passion!

divy
Автор

The breadth and depth of this video is blowing my mind. I work in storage, and I find working on the data path challenging. I envy you Adam. Very nice video!

Neel
Автор

A cool way I've found to visualise what a compiler does goes as follows:

When I tell you "the apple fell from the tree", we both imagine the same thing. However, our brain learned each of those concepts - apple, fall, origin, tree - and the relationships between them - "from" is synonymous with "origin" - through different ways. Therefore, no two brains are the same, even if they hear the same words and imagine the same concepts.

Two computers with different architectures are like two different brains: the words (source code) are the same, and so are the results (the concepts and the relationships between them, the machine code is the neurons interacting to make what the end user sees), but the interpretation of the words into those concepts is different for every one (compiler).

JackieJKENVtuber
Автор

Nice video. I do have to mention that not every compiler needs an IR. In fact, many early C compilers translated directly to machine code. IR does make value tracking much easier which is very important to modern optimizations. Also, not every compiler compiles to machine code. Some compilers compile to bytecode, and others compile to different source code.

I would like to see you go over the frontend of a compiler more indepth. Parsing and building the AST and IR is something that can be very interesting.

gottagofast
Автор

I love people like you who delve into the fundamentals and build actually cool things. <3

More power to you ma g!

psibarpsi
Автор

1:51 "...very few grunts and gestures"
x86-84 Instruction Set: Am I a joke to you?

Turalcar
Автор

Great (albeit super abstract) overview of compilers.

90% of the time will be spent on optimizations, so it's not just important that you get the optimization sequencing correct, but also the AST transformations without losing the original meaning of the tree while still making good use of co-processors in the final binary executable/library output.

Although languages like Rust, Haskell, and Idris make this task simpler via structured pattern matching, writing the optimizations themselves and seeing if they break other optimizations will still be a very hard task. Forgot to mention that on some hardware platforms, some very specific optimizations will turn out to be "slow downs", so be wary of that before customizing the optimizations that go into each target CPU/Co-processor.

SimGunther
Автор

I have 7 years of software development experience and recently get exposed to compiler, low level representation and type inference 😊. Your demo is clear and easy to follow!

Stella-selg
Автор

this was such a good video, you explained these concepts really well and I think you made great choices about what to include/not include. I hope to see more videos in the future but for now I will check out your blog!

vanadium
Автор

Top-notch presentation. I look forward to seeing the subs. rise up.

devbites
Автор

I thought this video had like 1249124 views the first 2 minutes watching, how'd I just come across this randomly? Great stuff!

archive-underground
Автор

The video is really high quality.
Keep making more.

kamalacharya
Автор

The thumbnail attracts me immediately when I saw it, great stuff!

OWOacnight
Автор

This video is basically about your personal abstract understanding of intermediate representations with a bit of Turing machines sprinkled in, and not about compilers.
1) Your definition of compilers is too restrictive - the IR is not a necessary step during compilation (if you included it, what about other (more significant than IR in my opinion) aspects of compilation such as lexing, building ATS, parsing, type checking, optimization, etc.) and the result of compilation doesn't have to be an executable binary (for example Cfront, the original compiler for C++, translated C++ source code to C source code, javac translates from Java SC to Java bytecode, and if you make a transpiler from brainfuck SC to C SC without generating an executable, it would still be considered a compiler)
2) The caveman analogy is unhelpful and misleading for programmers who don't know anything about compilers, and for those who do it will look as an unnecessary gross oversimplification
3) The part about translating high level languages to IR doesn't explain anything about compilers, and programmers who aren't familiar with compilers and Rust won't be able to understand it

The video production is good though, would be great to see an indepth explanation of all compilation stages for a real language with actual code (tcc for example)

ЕгорКолов-чс
Автор

Where were you when I was in school? Real talk, huge respect for your work and your way of presenting and explaining stuff :) Keep up the good work!

oli
Автор

This is actually insane! Puts my little scripting language pet project to shame haha

_simoncurtis