He said it quite clearly on his last Twitch stream: "There's no magical book or course that will make you a programmer. Just endure the pain." That's the only way you can learn programming.
For me as a late boomer / early gen X this feels like coming home from a long journey. No dependency hell, can be debugged with pen and paper. Thank you!
Dude, I really appreciate what you are doing, it is rare to have such of deep content (at least to me who is a junior myself) but yet entertaining. I really love to see and learn how things work under the hood, not just using them, and most of your video just fit that.
1:32:20 You can use the `goto out` pattern used in the linux kernel here, as in for each error branch you'd do `jl out_x` where x is an incrementing number, then at the end of the function you have the labels in reverse.
I watched and followed everything in the entire video. Oh man, it was so satisfying to see hello world. I even parsed the name myself. Thank you thank you.
Sockets automatically close on program exit Backlog defines the queue of waiting-to-connect sockets and already-connected sockets. If your backlog is 100, you have at maximum 50 connected sockets and 50 awaiting sockets
The size argument to bind() is also needed for copy_from_user to know how much to copy, without knowing the exact subspecies of the polymorphism. (BTW: the overlaid "struct sockaddr" construct is often named a "smart union")
I love how you explained syscalls so fast. I do know that you don't make tutorials but maybe you would like to do one about Assembly etc. because you're explaining everything in very easy way without unnecessary theory while doing real-life examples :P.
all his videos are already tutorials, you can follow along and learn exactly what he's doing by googling the parts you don't understand I've been watching since 2019 and learned a ton anything more trimmed down than this would lose a bunch of important information
Well, x86_64 has it, however if you were dealing with x86 amd and intel have different ways of calling syscalls and you'd have to use the vDSO. That's the original reason vDSO was created so you don't have to different syscalls for the different architecture. However, nowadays the vDSO also contains stuff that just shouldn't require kernel access like get_time() and stuff like that.
1:23:43 It is really easy to implement htons in assembly using XCHG instruction. And for htonl, there is the BSWAP instruction. And for information, in C, you can use __builtin_bswap16/__builtin_bswap32 under gcc and _byteswap_ushort/_byteswap_ulong under msvc.
> interpreter that outputs binary No way I had a similar idea a couple days ago for my own programming language and now I'm seeing an example of that x)
I had a similar issue with not having names in the debugger. I looked into the specs needed. In the end I used porth (yes porth!!) to read the custom debug file fasm to create some more asm (and maybe C?) files so that the debugger knew the names!
This is cool. And btw I also had a similar idea before. Basically its not an assembler. Its all macros. Even the "instructions" are just macros. That way you should be able to use different instruction sets with it by only changing the definitions.
This language seems so cool. For me, It is weird thinking about code being OS dependent. The OS they built for example in in theory either be written in Windows fasm or Linux fasm or possibly even written in fasmOS fasm and only compile-able on itself a different kind of self hosting.
ASM is "hard" because people treat CS like the "how to draw an owl" joke: we have machine code, then we have assembly, then we have React. What is in-between? Who cares! I just LOVED the concept of "fasm" - I might try it sometime on my old asm repos.
This might be why I used nasm instead, but I've been trying to figure out if you can do variadic macros and none of the examples from the fasm website are working with fasm itself. So supposedly you can do variadic macros, but either the examples are out of date or my copy of fasm is. Maybe I'll write my own assembler so it's not annoying.
@@__christopher__bro was invoking the "arch, btw" meme so people wouldn't think he was just saying that to highlight his use of arch. I'm using Arch rn, btw
I also did a very similar thing back in the oughts by writing go functions that when called, looked like G-Code and output gcode to stdout. So then I have all the power of golang, but then my main was this go-gcode hybrid that output gcode when run. Yeah.
IPX is dead. I remembering fixing aircrack-ng's driver for TP-Link USB WiFi dongle and it would not compile because there was some shit in code about IPX, and at the time IPX was already purged from Linux code base. I least I remember it when I was searching for it in git logs in kernel sources.
1:56:29 This whole bit has been my experience whenever I'm searching for answers/ examples and makes me question the legitimacy of "I just google the answers, bro" memes.
Does bind really determine the type based on the size? Looks more like a validation thing to me, the actual type is probably deduced using a union-type approach where they check the address family, since that's always the first field of the struct. At least that's what i'd expect. Good video :3
First of all: A really great video! I learned a few basics about fasm. But one more thing: What desktop environment is here in use? I never had seen something like this before. But i like it :)
From what I remember fasm has wasm as a target so future stream where the response payload is fasm compiled to wasm from fasm is the next logical step :)
Only like an hour in, but it kinda feels like using an assembler with such powerful macros ends up sorta defeating the point, because if you're generating the bulk of your code through macros like this... well, it's basically serving as a compiler that does no optimization. You lose out on the ability to skip unnecessary operations and very tightly pack things and whatever. At that point it's just like... why not write C?
@@TsodingDaily I don't think it's cheating, and I think it's a very neat. Obviously the objective of this video was not to create the best or easiest website and it's not a criticism of the video. I'm just wondering if assembly with this many macros serves any practical purpose or if using so many macros ends up defeating what limited practical function assembly still has with compilers as smart as they are.
@@Winnetou17 Okay but by that token, you may as well just write C and inline assembly the parts you need to super-duper optimize. Optimizing or doing crazy stuff is the only practical purpose assembly really _has._ Outside that, it's just a fun gimmick. Or perhaps I'm missing something, which is what I was asking about.
lol it reminds my of my own assembly transpiler it also has compile time generatoed code but mine does not have compiler directives like %for or something you can write you own compile time generators in the language itself
Why in ASM takes 30-50ms to load, from binary content and in Rust (tokio + axum + tower-http) loading a file then presenting takes only 1-2ms to load Why ASM binary that is 1KB is slower then 60MB Rust binary Please explain why is that slow and how you can make-it faster!
@@aqfj5zy There is no compiler involved when generating the *binary* that is serving the data to the browser in the video. I know that tsoding says "And it compiles!" but that is not actually what is happening. The time it takes from the browser making its request to the page being counted as loaded is pretty much bounded by the browser in this case.
Because Tsoding didn't include any of the optimisations you can do to make it serve responses as quickly as possible. You're comparing the most basic webserver to a well developed framework. Also, webservers aren't CPU bound, IO is the thing that takes the most time. If webservers were CPU bound, then this most basic example would outspeed every framework
Just following along for fun, my gf2 does not show the instructions after i try `run` even though the program runs fine (at 47:00)... anyone know why? Btw thanks for this great video. +1 sub
my man wrote his owns language, applications using that language, is doing a video about web development with assembly and says "I'm not a low level person"
Protect this geek at all costs. He is a gem in modern world where people find even python a difficult language.
yesss, I am so grateful to find deep content in the surface of the web
Sadly, his government will snatch him and force him to be a part of their military programs.
Python is difficult as it hides so many things behind the wrapper 😫
He said it quite clearly on his last Twitch stream: "There's no magical book or course that will make you a programmer. Just endure the pain."
That's the only way you can learn programming.
@@shedontlove84901:02:38
For me as a late boomer / early gen X this feels like coming home from a long journey. No dependency hell, can be debugged with pen and paper. Thank you!
oh my gosh he did webdev in the language the memes tell me not to learn because it is hard oh my.
But what a beautiful video he assembled here today for you!
The best way to do web dev is without the tools that have been made specifically for web dev
too true@@nikkehtine
Best Web Dev Tutorial for beginners.
Hahaahah
Tsoding is a freaking genius!!! I love the way he decomposed problems and solves them one by one. He is a real OG programmer.
Dude, I really appreciate what you are doing, it is rare to have such of deep content (at least to me who is a junior myself) but yet entertaining.
I really love to see and learn how things work under the hood, not just using them, and most of your video just fit that.
the cubicle bound webdev fears the recreational assembler
1:32:20 You can use the `goto out` pattern used in the linux kernel here, as in for each error branch you'd do `jl out_x` where x is an incrementing number, then at the end of the function you have the labels in reverse.
this is what i thought WebAssembly was at first.
lmao
same
I watched and followed everything in the entire video. Oh man, it was so satisfying to see hello world. I even parsed the name myself. Thank you thank you.
Watching this taught me a lot, on top of you explaining how things work, reading some docs and following along in c is super fun. Thank you mr Tsoding
wow, the development screencast by anyone who is not indian on youtube in 2023! instant subscription
This is the first video that I've fully watched on your channel, and now I want to try fasm in gamedev
Yesterday, I didn't even know this guy. Now, he is one of the best ppl I know.
If you ever feel neglected, just remember the EXIT_SUCCESS and EXIT_FAILURE he defined at 59:40 and then ignored for the rest of the stream.
i can literally watch you coding for hours
Sockets automatically close on program exit
Backlog defines the queue of waiting-to-connect sockets and already-connected sockets. If your backlog is 100, you have at maximum 50 connected sockets and 50 awaiting sockets
The size argument to bind() is also needed for copy_from_user to know how much to copy, without knowing the exact subspecies of the polymorphism. (BTW: the overlaid "struct sockaddr" construct is often named a "smart union")
"struct sockaddr" hopefully doesn't want to get raised pay
I love how you explained syscalls so fast. I do know that you don't make tutorials but maybe you would like to do one about Assembly etc. because you're explaining everything in very easy way without unnecessary theory while doing real-life examples :P.
this IS a tutorial for everyone who wants to learn
all his videos are already tutorials, you can follow along and learn exactly what he's doing by googling the parts you don't understand
I've been watching since 2019 and learned a ton
anything more trimmed down than this would lose a bunch of important information
1:56:35 In my experience you can also always just open the network tools and capture one request.
That already shows enough about http to be useful.
I like you find all that fun.
That is the way to learn. If one can't enjoy learning it is torture.
watched the whole thing, actually cool
Well, x86_64 has it, however if you were dealing with x86 amd and intel have different ways of calling syscalls and you'd have to use the vDSO. That's the original reason vDSO was created so you don't have to different syscalls for the different architecture. However, nowadays the vDSO also contains stuff that just shouldn't require kernel access like get_time() and stuff like that.
On x86 you can just use INT 0x80, that works on both architectures.
13:15 I downloaded the fasm executable directly from their website and it is, in fact, statically linked
1:23:43 It is really easy to implement htons in assembly using XCHG instruction.
And for htonl, there is the BSWAP instruction.
And for information, in C, you can use __builtin_bswap16/__builtin_bswap32 under gcc and _byteswap_ushort/_byteswap_ulong under msvc.
1:45:20 The size field is calculated the wrong way around
yeah it's "$ - .sin_family"
@@julesl2087 Or as written in the documentation also just $ - .
What a madlad!!
There is a pretty neat clang built in that lets you dump structs in a formatted way (__builtin_dump_struct)
That's what I thought of when I first heard the word "Webassembly"
jajajaja, same bro
That was really fun you made me watch the whole thing!
Starcraft used IPX by default for networking
i've done my share of assembly, but never thought about it as a web app, wild and cool idea :)N
You forgot close connfd, maybe if browser get close or content-length, it would be faster because browser will know that content is over
And will not wait new content
This channel is amazing.
So when can we expect a developer bootcamp for beginners using this stack?
> interpreter that outputs binary
No way I had a similar idea a couple days ago for my own programming language and now I'm seeing an example of that x)
1:02:49 -- now that's my favorite way to tell user that everything is ok
"Oking service"
I had a similar issue with not having names in the debugger. I looked into the specs needed. In the end I used porth (yes porth!!) to read the custom debug file fasm to create some more asm (and maybe C?) files so that the debugger knew the names!
I just had a crash course on syscals and I am mad how I understood them in under 12 mins
Bro which course can you tell me ?
@@krenilraj4180this video lol
@@krenilraj4180I assume he meant this video
this video 😂
@@andy_lamaxLOL
estamos viendo a un programador de la puta madre con excelentes formas de comunicar, te amo!!
This is cool. And btw I also had a similar idea before. Basically its not an assembler. Its all macros. Even the "instructions" are just macros. That way you should be able to use different instruction sets with it by only changing the definitions.
it's called a compiler
more like LLVM IR@@huistelefoon5375
this whole video reminded me of the time you did basically the same thing but in porth
1:28:20 this made me smile
Hello, 'not a low level person', nice to meet you.
This language seems so cool.
For me, It is weird thinking about code being OS dependent. The OS they built for example in in theory either be written in Windows fasm or Linux fasm or possibly even written in fasmOS fasm and only compile-able on itself a different kind of self hosting.
Great video ... took my attention from the beginin..
It does seem that fasm not being static is a debian thing, in the arch repos it's static.
since i am learning technology from tsoding, and tsoding is a meme lord, does that not mean i am learning technology from memes?
ASM is "hard" because people treat CS like the "how to draw an owl" joke: we have machine code, then we have assembly, then we have React. What is in-between? Who cares! I just LOVED the concept of "fasm" - I might try it sometime on my old asm repos.
This might be why I used nasm instead, but I've been trying to figure out if you can do variadic macros and none of the examples from the fasm website are working with fasm itself. So supposedly you can do variadic macros, but either the examples are out of date or my copy of fasm is. Maybe I'll write my own assembler so it's not annoying.
cant wait for the cobol web development video 🙏
On my Arch install fasm is static. I use Arch, btw.
Your second sentence is redundant. Well, technically I guess you could have an Arch install without using it ...
@@__christopher__bro was invoking the "arch, btw" meme so people wouldn't think he was just saying that to highlight his use of arch. I'm using Arch rn, btw
fasm: I'm a bit of a webdev myself
I also did a very similar thing back in the oughts by writing go functions that when called, looked like G-Code and output gcode to stdout. So then I have all the power of golang, but then my main was this go-gcode hybrid that output gcode when run. Yeah.
Ah, so this is the Web Assembly my colleagues have been talking about..
I watched this stream and it was amazing 💪🏻
это слишком офигенно
IPX is dead. I remembering fixing aircrack-ng's driver for TP-Link USB WiFi dongle and it would not compile because there was some shit in code about IPX, and at the time IPX was already purged from Linux code base. I least I remember it when I was searching for it in git logs in kernel sources.
words are hard bruh
Visual studio is on the market since 97!
And it still keeps getting worse!
1:56:29
This whole bit has been my experience whenever I'm searching for answers/ examples and makes me question the legitimacy of "I just google the answers, bro" memes.
i love your videos
Gdb has a command that starts and automatically stops at the entry, it's 'starti'.
Next up, "Implementing our own C in fasm" 😅
Tremendous. Please do more fasm vids.
Does bind really determine the type based on the size? Looks more like a validation thing to me, the actual type is probably deduced using a union-type approach where they check the address family, since that's always the first field of the struct. At least that's what i'd expect. Good video :3
First of all: A really great video! I learned a few basics about fasm.
But one more thing: What desktop environment is here in use? I never had seen something like this before. But i like it :)
I think it's i3wm🙂
1:45:00 it didn't work because you switched the operators for computing size.
I think I'll prefer to code in fasm over cpp
Very interesting
in my opinion fasm competes with food
Great 👏👏👏
Huh, when I use fasm locally the output elf files are executable by default. Weird
Are you john_found who wrote article on habr about this?
26:31 writing a simple TCP server in fasm
1:08:57 This is the art of grepping
Hi.Can you implement Eventbus Publish/Subscribe system in c please.Thank you for videos
Why do i need stdlib if syscall(1, 1, "Hello world", 14) ?
There was int 80h for syscalls in 32bit Linux.
why I have read the title as dev in webassembly...
I changed the title. Hopefully it's easier to read now.
From what I remember fasm has wasm as a target so future stream where the response payload is fasm compiled to wasm from fasm is the next logical step :)
@@PopescuAlexandruCristian So you could have a fullstack framework in assemby. Finally gone full circle from javascript.
What is the pretty font in your emacs?
Iosevka
Chromium syscall table 🗿
It's webdev after all...
Try nasm assembly too please 🙏
Nasm 32 bits
tsoding after explaining something for like 10 mins. Then says "I don't fully understand it"
Only like an hour in, but it kinda feels like using an assembler with such powerful macros ends up sorta defeating the point, because if you're generating the bulk of your code through macros like this... well, it's basically serving as a compiler that does no optimization. You lose out on the ability to skip unnecessary operations and very tightly pack things and whatever.
At that point it's just like... why not write C?
twitter.com/tsoding/status/1704206555594264984
@@TsodingDaily I don't think it's cheating, and I think it's a very neat. Obviously the objective of this video was not to create the best or easiest website and it's not a criticism of the video.
I'm just wondering if assembly with this many macros serves any practical purpose or if using so many macros ends up defeating what limited practical function assembly still has with compilers as smart as they are.
> I'm just wondering if assembly with this many macros serves any practical purpose
urmom said it does
@@yaksher Whenever you want/need to optimize or do crazy stuff, you can simply not use macros or whatever.
@@Winnetou17 Okay but by that token, you may as well just write C and inline assembly the parts you need to super-duper optimize. Optimizing or doing crazy stuff is the only practical purpose assembly really _has._ Outside that, it's just a fun gimmick.
Or perhaps I'm missing something, which is what I was asking about.
lol it reminds my of my own assembly transpiler it also has compile time generatoed code
but mine does not have compiler directives like %for or something you can write you own compile time generators in the language itself
How long until you're writing your own os in fasm?
I need programming classes from you
Why in ASM takes 30-50ms to load, from binary content and in Rust (tokio + axum + tower-http) loading a file then presenting takes only 1-2ms to load
Why ASM binary that is 1KB is slower then 60MB Rust binary
Please explain why is that slow and how you can make-it faster!
@@aqfj5zy There is no compiler involved when generating the *binary* that is serving the data to the browser in the video. I know that tsoding says "And it compiles!" but that is not actually what is happening. The time it takes from the browser making its request to the page being counted as loaded is pretty much bounded by the browser in this case.
Because Tsoding didn't include any of the optimisations you can do to make it serve responses as quickly as possible. You're comparing the most basic webserver to a well developed framework. Also, webservers aren't CPU bound, IO is the thing that takes the most time. If webservers were CPU bound, then this most basic example would outspeed every framework
Because I forgot to close the connection
Now i realizate that you need to flush or close the connection!
And what is this guys real name . He is soo good
Can you share with me the discord link?
This evil :fear:
Couldn't he use coogle?
Damn, I had been programming all morning. I forgot how to English.
Couldn't he have used coogle?*
@@cj1296 It happens to the best of us. But... wouldn't it be better to simply edit the post ?
Do you use evil mode
bro i will make celebrate if you respond i want your opinion about problem solving website
Is the source code for this on github?
Just following along for fun, my gf2 does not show the instructions after i try `run` even though the program runs fine (at 47:00)... anyone know why?
Btw thanks for this great video. +1 sub
What kind of assembly language is this?
Its fasm assembler
my man wrote his owns language, applications using that language, is doing a video about web development with assembly and says "I'm not a low level person"
So Fasm is Forth with a slightly more advanced parser.
25:35 🐰
How does he get this gdb "gui" ?
it's a built-in feature of gdb, you can do this with `tui enable` as he did in the video