I made JIT Compiler for Brainf*ck lol

preview_player
Показать описание
References:

Chapters:
- 00:00:00 - Announcement
- 00:00:42 - Intro
- 00:06:00 - Hello, World
- 00:09:36 - Intermediate Representation
- 00:52:09 - Interpreter
- 01:02:03 - Flat Assembler
- 01:14:24 - Raw Binary Image
- 01:18:41 - runbin
- 01:36:08 - JIT compiler
- 03:02:45 - Outro
Рекомендации по теме
Комментарии
Автор

"Your scientists were so preoccupied with whether or not they could, they didn't start to think if they should"

jayshartzer
Автор

You should do more low level programming like compilers and vm's. Very entertaining and great learning experience.

lane
Автор

Never seen any of your videos but this is right up my alley. Laughed out loud when you said "Was ist das für ein Haufen Scheiße meine Freunde?"
I had to rewind to make sure my brain wasn't playing me

anonymousanon
Автор

I haven't watched the video yet, but I read the Computer Enhance article in the description and already implemented byte-aware diagnostic messages as an option in my compiler. Very good idea, very easy to implement, I will be part of the change.

nashiora
Автор

C++ developers be like: Is this operator overloading?

aniket-biswas
Автор

Awesome video, what you made is way too cool for only three hours

bassguitarbill
Автор

Mate, I watched this whole thing on YT to the end. Awesome stuff. If you ever feel the inclination to go mega deep into obscure lexer/parser methodology, I'll be well up for watching. Awesome video as always.

PeterJepson
Автор

Around 3:00:30 it's nice to see other people have the weird feeling, when you have mental list of tasks that need to be written to be "done" with the problem, and you write the last part and it works, there is the weird disconnect of the mind of being in a - write what you thought of - state. And it refuses to leave that and run it for a bit, expecting there to be more on the todo list.
It's hard to describe that state of mind, leaving writing mode and going into testing mode - which sometimes might show a bug and back to writing mode but when it doesn't, there is a weird void for a bit.

Beesman
Автор

Minor nitpick: you can just do "TEST al, al"; (which is a two byte instruction) no need to zero out the higher bits with "XOR ax, ax"

JamesSjaalman
Автор

Those null bytes in the opcode strings are making me ANSI

Also heads-up, signed overflow is UB in C (but unsigned overflow is not)

valshaped
Автор

Similar to your convenient use of increment/decrement in this video, you can shorten your while loops by a line by using assignment as an expression, from:

char s = lexer_next(&l);
while (s == c) {
++count;
s = lexer_next(&l);
}

to

char s;
while ((s = lexer_next(&l)) == c) ++count;

starup
Автор

That reminded me the joy when I did BF run in constexpr in C++.

ecosta
Автор

Brainf*ck was originally designed in an attempt to write the simplest and smallest compiler. It's a fascinating programming language that is surprisingly slow to write and slow to run. But it IS Turing-complete.
And I think it is a lot of fun!

lorensims
Автор

Love your thumbnails. And the content too of course :)

vxenda
Автор

i scream every time zozin writes % 255 instead of % 256

you can kind of intuitively get modulo if you think about it like decimal
7 + 255 = 6 if 8 bits
same way
7 + 9 = 6 if 1 "bit" (decimal)
BUT
7 + 256 = 7 if 8 bits
and
7 + 10 = 7 if 1 "bit" (decimal)
which is the same as (7 + 10) % 10 = 7
and the same rule applies to binary

an easy to remember rule is to modulo with value that causes an "overflow" (9 + 1 = 10, we overflow to using two digits, so we modulo with 10, 0xFF + 0x01 = 0x100 = 256, so we modulo with 256)

sorry for a wall of text, i hope my schizo explanation helped someone 🙏🙏🙏

RedstonekPL
Автор

43:03 You don’t have to apologise to us, we find it hilarious (at least I do)

PinkStreet
Автор

"Haufen scheiße, meine Freunde" :D You know some German!? wtf :D Привет из Германии.

michael_
Автор

my actual instant reaction "YOU MADE WHAT??"

rizkiaprita
Автор

This is how programming content should be,
unlike others wasting 80% of time talking, 10% watching mems and sometimes coding.

Awesome content.

krellin
Автор

It'd be amazing if Mr. Tsoding handled memory bounds checking, not by checking the pointers, but by letting the OS check the pointers. Aka, handling the segmentation fault.

Mozartenhimer