I switched from ASSEMBLY to C and it made my code better...

  Рет қаралды 16,924

Tsoding Daily

Tsoding Daily

Күн бұрын

Пікірлер: 86
@l4ppland
@l4ppland Күн бұрын
Welcome to yet another recreation of programming session with mistuh zozin
@desertfish74
@desertfish74 Күн бұрын
yessu yessu yessu
@ngodingrandom
@ngodingrandom Күн бұрын
how bout that
@lucyper8921
@lucyper8921 Күн бұрын
@@desertfish74 kawai kawai desu
@eckhardt092
@eckhardt092 Күн бұрын
Mistuh uuuh zozin
@seventhtenth
@seventhtenth 21 сағат бұрын
gucci gucci tomagoochi
@5ilkyYT
@5ilkyYT Күн бұрын
I like the "chat in subtitles" popup now, much better than finding it yourself
@artemiasalina1860
@artemiasalina1860 Күн бұрын
I wonder how many people know that they can grab the subtitles and drag them to a different position.
@doodocina
@doodocina Күн бұрын
@@artemiasalina1860doesn't work on phones btw
@Crimera137
@Crimera137 4 сағат бұрын
sunny working low wage
@sil3nt810
@sil3nt810 Күн бұрын
10:22 these are the callee saved registers. It's part of the System V ABI calling convention that these registers retain their value after a function call.
@bbq1423
@bbq1423 21 сағат бұрын
8:44 Reason for the pie errors is most likely since you were using instructions which operate on absolute addresses (any time you use addresses of static values), this is because of ASLR, which makes it so that the binary really can’t know what the label address will really be. Static labels are usually addressed relative to the instruction pointer instead (RIP relative addressing), so instead of using load label instructions, you’d use the LEA instruction (load effective address) first to get the actual address of the label and then do the load. With this, I think the pie errors would disappear.
@CacdayBirthdus
@CacdayBirthdus 16 сағат бұрын
Title goes hard
@paxdriver
@paxdriver 12 сағат бұрын
The guy who made the "hide your kids, hide your wife" remix simply MUST make an album from your video beat boxes and ballads. I vote for "let's fucking go" for the single.
@desertfish74
@desertfish74 Күн бұрын
The Commodore Amiga had one of the first preemptive multitasking operating systems running on home computers. On the original Amiga 1000, it was running on a 8 mhz M68000 CPU with 256Kb RAM. Can your C do that!? Huh!? Huh!?
@MythiPlayz
@MythiPlayz Күн бұрын
I studied that processor in the microprocessors course I took at university. That little Motorola demon was ahead of its time
@TheCommunistRabbit
@TheCommunistRabbit Күн бұрын
Well yes
@ezbody
@ezbody Күн бұрын
And so was Atari ST, it was surreal to watch everyone typing away in DOS while you had this graphic OS to play with.
@desertfish74
@desertfish74 22 сағат бұрын
@ The Atari ST didn't have preemptive multitasking, it was cooperative multitasking (as far as I am aware of how the ST worked.)
@georgerogers1166
@georgerogers1166 16 сағат бұрын
Yes. Unix was on even more crude hardware. PDP11 only had 64K of Ram.
@AeroSW
@AeroSW 12 сағат бұрын
@Tsoding Daily, just swap the dead context onto the end of the stack, then pop it off the stack. That is a way to release the data without corrupting the stack.
@naranyala_dev
@naranyala_dev 14 сағат бұрын
the stream is getting more interesting, awesome
@chaitanyadubakula
@chaitanyadubakula 11 сағат бұрын
Would it be possible to write the entire coroutines library in C3 only instead of depending on a dynamic C library? I saw that C3 also some inline ASM features, so I think yes.
@user1lyy
@user1lyy 4 сағат бұрын
Off topic but what's the name of the font hes using?
@kiosmallwood576
@kiosmallwood576 Күн бұрын
This one is very satisfying. So glad I caught it live.
@gsestream
@gsestream Күн бұрын
how about switching function call pointers in c. then the stack stuff would automatically switch internally by the compiler. then each thread function call only does small part of the thread work at a time. switching. then you only deal with stuff in memory, not in registers, those will be handled automatically, after the function call switches. in pure c. well, thread switching vs fully pipelined in single core. pipeline flow vs switch. function pointer call switching assumes each threading function has their own internal data in their own memory addresses. no manual thread management required. just c code. opencl c does not have malloc. static array allocations only. if you use c only, you only get to push and pop, not have to worry about the internals of the stack. c is for abstraction reasons. c is designed to avoid very low level stuff in asm. you are trying to do what a c compiler does with the environment switch code in asm. no function pointers in opencl c also. no assembler in opencl c c99. great, the program only can yield, back to os. partitioned workload would yield the better c-only definition and operation. so why did you make da_append as a macro, not a normal function. also why re-implement what is already native in c, the function call mechanism. pointless pointers. instead of yield function call in the partial functions, just make partial data processing in the functions. no need to mess with the stack. just use c function calls. so why not just code single core threads instead. then its not manually flow controlled but automatically by the single core threads. threads if you can specify that they dont run on a separate core specifically. on single core you are guaranteed to have sequential exec of instructions. in multi-core you are not. not cursed. *entrely.
@caffidev
@caffidev 20 сағат бұрын
New thumbnail 👍
@bruterasta
@bruterasta Күн бұрын
Having chat messages as a subtitles is great idea.
@yglyglya
@yglyglya Күн бұрын
1:19:00 let it leak, let it leak
@l4ppland
@l4ppland Сағат бұрын
@@yglyglya govnos in haskell when
@__gadonk__
@__gadonk__ Күн бұрын
Amista Azozin
@the_worst_coconut
@the_worst_coconut 22 сағат бұрын
"even though it's not supposed to segfault in my opinion"
@rasulseidagul
@rasulseidagul Күн бұрын
1:11:47 Do paging instead of malloc and the stack would be aligned to 16 bytes automatically.
@mbarrio
@mbarrio Күн бұрын
posix_memalign seems simpler than paging right?
@berndeckenfels
@berndeckenfels Күн бұрын
40:28 I think more reasons for malloc returning null nowadays are cgroup or ulimit or Container limits
@berndeckenfels
@berndeckenfels Күн бұрын
1:20:27 no need to swap, just copy (if not last)
@felipedilho
@felipedilho 19 сағат бұрын
I don't know if it would be quite so simple, but couldn't he use fasmg to code in a "high-level" assembly and just put the respective processor instructions file to make his code portable? I would like to learn more about this, could be a nice recreational programming live subject, ... just saying.
@Tezla0
@Tezla0 14 сағат бұрын
"High-level" assembly is called C
@rogo7330
@rogo7330 6 сағат бұрын
@@Tezla0 you're very wrong about C and its "close to assembly" features, my friend. C is just about working on things that can have addresses, "memory-oriented" design if you will. It does a lot of things that you would hope to just turn off but it's impossible by design, unless you make a compiler treat your C code way out of spec.
@Sitris-h7q
@Sitris-h7q Күн бұрын
Why not program in an IR instead? It can be similar to architecture agnostic assembly.
@alvinmiranda7574
@alvinmiranda7574 Күн бұрын
Do you mean like llvm ir?.Then the problem will be that your code can only be compiled by a single compiler.Also yes gcc also has a ir but an ir is not necessary to make a compiler to begin with I think tcc does not have a ir.
@ratchet1freak
@ratchet1freak Күн бұрын
because this kind of thing will not be abstracted away by an IR, the set of registers to save is very specific to the architecture and OS calling convention
@shrddr
@shrddr Күн бұрын
>makes lagrange-uxn video unlisted >references it in every subsequent video
@TEHNOTRAHER
@TEHNOTRAHER Күн бұрын
why did he unlisted it lol?
@berndeckenfels
@berndeckenfels 23 сағат бұрын
1:45:10 coroutine id moves around when you get swapped into a freed Slot (ah you talked about it later)
@berndeckenfels
@berndeckenfels 23 сағат бұрын
Hm Not sure if you can interrupt, but you can wrap io with a yield block
@uniers
@uniers Күн бұрын
What about LLVM IR ?
@BulletHeadPL
@BulletHeadPL Күн бұрын
what about it?
@TheCommunistRabbit
@TheCommunistRabbit Күн бұрын
He's saying you can write it in llvm IR to make It cross platform
@thartanian
@thartanian 15 сағат бұрын
good stuff
@sinom
@sinom Күн бұрын
"a language where you could += but also mod" That would be a ternary assignment operator which would be kinda weird. Like would it be written as "a +%= b, c" Or something like that? I think in c you can technically just do that with (a += b) %= c But that is definitely cursed
@colonthree
@colonthree Күн бұрын
Signed modulo (I use this for rotations from -360 to 360): x - x / y * y
@tylovset
@tylovset 11 сағат бұрын
For `a = (a + 1) % b`, it's much faster to do `a += 1; if (a == b) a = 0;` because a == b is unlikely and therefore near free. Btw, (a += b) returns an r-value, so it can't be assigned.
@rogo7330
@rogo7330 6 сағат бұрын
Just make it a function. Or drop the mathematics way of writing expressions and go back to stack monke: "operator arg arg arg", where each individual "arg" can be (or, in fact, is, if you treat each name access as "read-from-name" operation) another expression. If you really incist on a mathematical expressions with priorities and other crap (instead of just grouping things by parenthesies and position on the stack or by assigning to a new names), then just introduce a special syntax, like double-parenthesies-enclosed expressions in bash "((x + y/2))".
@nevokrien95
@nevokrien95 Күн бұрын
There is some stuff that the refrence code missed in long jump. Specifcly it forgot that simd registers exist
@AlguienMas555
@AlguienMas555 15 сағат бұрын
🤙
@namiflowers00
@namiflowers00 Күн бұрын
this is truly epic, meine freunde
@atxorsatti
@atxorsatti 3 сағат бұрын
WAITT how are you making money? I thought you stream _for_ money
@kselnaag2482
@kselnaag2482 Күн бұрын
Expecting to rewrite everything on C3 not only C, waiting C3 and preemptive concurrency =D
@meryplays8952
@meryplays8952 Күн бұрын
c-- is an interesting idea, currently it is unmaintained
@artemiasalina1860
@artemiasalina1860 Күн бұрын
With all the legalese in GCC documentation I guess they really believe that code is law.
@crino_enjoyer
@crino_enjoyer Күн бұрын
Mr zozin mr zozin I think the lagrange video got deleted .
@heavymetalmixer91
@heavymetalmixer91 Күн бұрын
That's why C was created in the first place :v
@seventhtenth
@seventhtenth 21 сағат бұрын
THUMBNAIL
@thanatosor
@thanatosor 6 сағат бұрын
ASM is like Meta of C 😂
@ahmadumar9387
@ahmadumar9387 Күн бұрын
bro, your YT-avatar looks more satisfied than you... something goes wrong😅
@ryzh6544
@ryzh6544 Күн бұрын
da_like
@RicardoValero95
@RicardoValero95 Күн бұрын
next time coroutines in wasm :p
@lolcat69
@lolcat69 Күн бұрын
hallo mista zozin!
@theboomerperspective2478
@theboomerperspective2478 Күн бұрын
The intro is stupid, I have no reason to watch the video now since I know how it ends
@RustIsWinning
@RustIsWinning Күн бұрын
It's about the journey, not the destination.
@theboomerperspective2478
@theboomerperspective2478 Күн бұрын
@@RustIsWinning Good for you. That's wildly subjective, it ruins it for me.
@MrMeltdown
@MrMeltdown Күн бұрын
@@theboomerperspective2478 You sure you are actually a boomer?
@Leonhart_93
@Leonhart_93 Күн бұрын
What do you think this is, TV entertainment so you don't want spoilers? 😂 Knowing bits of knowledge beforehand helps with easier understanding later.
@theboomerperspective2478
@theboomerperspective2478 23 сағат бұрын
@ If you are THAT slow then yes, maybe you shouldn't comment then
@matthartley6537
@matthartley6537 Күн бұрын
Hello memory_leaker69!
Intro to the Zig Programming Language • Andrew Kelley • GOTO 2022
50:14
I tried React and it Ruined My Life
1:19:10
Tsoding Daily
Рет қаралды 161 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Compiling Should NOT be This Slow
2:18:25
Tsoding Daily
Рет қаралды 34 М.
They Made a Sequel to C
1:53:24
Tsoding Daily
Рет қаралды 115 М.
Building wc tool from scratch - Part 2
1:20:29
Gaurav Gahlot
Рет қаралды 709
Forget WiFi AGAIN! This Wireless Method is WAY Better?
12:05
GreatScott!
Рет қаралды 75 М.
1 Atheist vs 25 Christians (feat. Alex O'Connor) | Surrounded
1:33:20
Why Are Threads Needed On Single Core Processors
16:07
Core Dumped
Рет қаралды 243 М.
Serral vs herO - GRAND FINALS - StarCraft 2
1:50:21
WinterStarcraft
Рет қаралды 121 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,5 МЛН
Simple Code, High Performance
2:50:14
Molly Rocket
Рет қаралды 280 М.
Pointers in C / C++ [Full Course]
3:47:23
freeCodeCamp.org
Рет қаралды 4,9 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН