This was a very helpful video!! However, I didn't know who I was doin' this recreational programming session with which makes me very sad. I hope Mista Zozin comes back one day sigh.
1. Undefined variable (undefined: varName) "Oh, sweetie, did you forget to introduce your variable to the compiler? It's not psychic, you know." 2. Missing return statement "Leaving early? The compiler isn’t done with you yet-return what you promised, darling." 3. Syntax error (unexpected token) "Syntax is not your playground; the Go compiler plays by strict rules. Try again, rebel." 4. Type mismatch (cannot use X as Y) "Oil and water don’t mix, sugar. Neither do incompatible types. Fix it or stay mismatched forever." 5. No package found (cannot find package) "You didn’t RSVP to the package party? No wonder Go can’t find it." 6. Declared and not used "Why declare something and then ghost it? Go is all about commitment, honey." 7. Import declared and not used "Inviting libraries you don’t intend to use? Rude. Clean up your imports, superstar." 8. Function redeclared "Two functions with the same name? Drama queen alert! Pick one and let it shine." 9. Non-exported field accessed "You can't just waltz into private fields like you own the place. Be respectful and export them first." 10. Circular imports "Round and round you go. This import circus has no end. Time to break the loop, darling."
This was an amazing stream. So many random CS/programming concepts randomly kept coming up in the most natural way. Not only that but the classic Zozin humor mixed with the actually meaty project reignited my passion for my own side project that needs some love.
@@Zipperheaddttl are you aware of his cynical rants? if not, maybe that explains your nightmares :D (jk, i love his rants, even though i don't usually agree but he does not take them seriously himself so that's that...)
Not sure if you care now that you got it working, but you don't actually need to do the thing for Rejects where you set the excuse later. The problem was that you were using the question mark operator after the WOULD_BLOCK when you were constructing the Reject, which was trying to propagate the error when you just wanted to create an instance of IoError.
i love the enthusiasm & and the simplicity even tho i don't understand the concept that much nor much C, i wanted to implement this on my own but i couldn't get it well; but i loved the vid; made me wanna pursue some of my side projects
Is this not just writing a Promise that "looks like" a future, and because of that, won't work at all. A future still needs an execution context (i.e. some thread that manages it, that gets signalled when it can awaken and start polling). This is just... i don't even know what this is?
i would say this stream is more like the library interface design (API) ... once we come to a proper `runtime` for these futures .. we will worry about execution
In js async, await make function behave like synchronised, then why we need async,await in other language like c#,rust,dart what are synchronised by default?
@andreffrosa my actual question is,does js serve different purpose from other synchronise language? Because by default js doesn't block thread like c#,rust,dart.
@@naive_algorithm js has an execution loop, when calling [async function] fn() you dont execute it directly, you push it to a list of functions to be executed and the execution of the current block continues, this is fundamentally different to other common langs
1:17:40 - To be honest, I wasn't confident on the cleanness of the result until those macros were introduced. Damn, that is neat AF. I can't wait to watch the remaining of the video...
Have to look at the assembly in order to know for sure if something is only temporary on the stack. Also, something like a logical OR (!a | b!) is necessary to execute both where boolean OR || skips if first is satisfactory.
I get why you went the javascript promises route instead of rust futures. The rust ones are state of the art tho, I guess it could be a fun little project to reimplement say smol in something like zig (or heck - C11 maybe)
4:00 that's an awfully complicated explanation of "it's a loop that does nothing until condition happens and then it calls registered callback functions once"
you might have been interested in the fact that macros can take a trailing block of code as an argument. that would get rid of the })}) hell at the end, and turn it into fut(...).@then(...) { ... }.@then( ... ) { ... }; the trade-off is that you can't return a value from such a block.
One of the things I don't like about C3 is also something I don't like about C++. Introducing a new double character token where they didn't exist to express a slightly different form of the singular character token is cancer. As far as references in my own language, I opted to use @ to represent them and for taking the address of something. I really dislike the r-value reference versus l-value reference dichotomy in C++. I get why the committee thinks they need to be manually differentiated by the user, but they're wrong. You just need to be more aggressive with scanning the parse tree, especially when you consider that they only really make sense when the compiler can see what you're referencing. I am curious though, why no one seems to ever engage with the discussions I try to have.
Your concerns about the use of double character tokens in languages like C++ and C# are quite valid and resonate with many developers who prefer simplicity and clarity in syntax. The introduction of new tokens to differentiate between similar concepts can indeed lead to confusion and a steeper learning curve, especially for those new to the language. Using a single character, like @, to represent references in your own language is an interesting approach. It simplifies the syntax and reduces the cognitive load on the programmer. The distinction between l-value and r-value references in C++ can feel unnecessarily complex, especially when the underlying concepts could potentially be inferred by the compiler through more sophisticated analysis of the parse tree. Your point about the compiler's ability to understand context is crucial. If the compiler can accurately determine the nature of the references based on the surrounding code, it could eliminate the need for developers to manually specify these distinctions. This could lead to cleaner, more intuitive code, allowing developers to focus on logic rather than syntax. As for the lack of engagement in discussions around these topics, it can be frustrating. The programming community often gravitates towards established norms and practices, which can make it challenging for new ideas to gain traction. Additionally, discussions about language design can become quite technical and abstract, which might deter some from participating. It might help to share your thoughts in more focused forums or communities that prioritize language design and syntax discussions. Engaging with like-minded individuals who share your passion for language simplicity could lead to more fruitful conversations. Keep pushing for clarity and simplicity in programming languages-it's a conversation worth having! I hope you did not reach this line.
What if we want to call a javascript fetch function from this fetch while working with wasm. The javascript fetch will call the callback, but how can we poll for that, without blocking the thread.
i feel like java-style interfaces result in a lot of code bloat. why not just use struct with pointers as an interface object and then embed it into other structs like this: ```C typedef struct Fut Fut; struct Fut { uint8_t (*poll)(void*data); void *result; char *err_msg; Fut*next; }; // usage: typedef struct {Fut fut; uint8_t pos; uint8_t stop; } Counter; uint8_t Counter_poll(Counter *self) {...}; int main(){ Counter c= {{(void*) Counter_poll}, 0, 10}; while (c.fut.poll(&c)); } ```
You don't need to clone a github repo just to view it... Just go to the root of the repo and press dot '.' and it will open in an online vscode instance.... I know I know 'brother ewwww' it's not emacs but you can click/scroll /search/expand the file tree etc
no "hello everyone and welcome to yet another recreational programming session with mista zozin" at the beginning?
i demand a reupload.
Bro fell off
I second
i too demand a reupload.
++
how about that????
At first I read title as "I made Futures in Scratch"
Deez nuts
Would be funny to see Tsoding programming in Scratch. But aslong as it not compatible with Raylib, I don't think he will😅
Me too, hehe
Hey hey you, calm down now don't give him ideas
Bro, he changed the title
This was a very helpful video!! However, I didn't know who I was doin' this recreational programming session with which makes me very sad. I hope Mista Zozin comes back one day sigh.
those c3 compiler error messages are so good lmao. they are straight to the point of what the issue was and suggestion on how to solve it
Can we implement 'Sassy C' compiler where all the errors are sarcastic and grumpy?
1. Undefined variable (undefined: varName) "Oh, sweetie, did you forget to introduce your variable to the compiler? It's not psychic, you know."
2. Missing return statement "Leaving early? The compiler isn’t done with you yet-return what you promised, darling."
3. Syntax error (unexpected token) "Syntax is not your playground; the Go compiler plays by strict rules. Try again, rebel."
4. Type mismatch (cannot use X as Y) "Oil and water don’t mix, sugar. Neither do incompatible types. Fix it or stay mismatched forever."
5. No package found (cannot find package) "You didn’t RSVP to the package party? No wonder Go can’t find it."
6. Declared and not used "Why declare something and then ghost it? Go is all about commitment, honey."
7. Import declared and not used "Inviting libraries you don’t intend to use? Rude. Clean up your imports, superstar."
8. Function redeclared "Two functions with the same name? Drama queen alert! Pick one and let it shine."
9. Non-exported field accessed "You can't just waltz into private fields like you own the place. Be respectful and export them first."
10. Circular imports "Round and round you go. This import circus has no end. Time to break the loop, darling."
I want to see a compiler that will compliment me if things go well and will support me if something doesn't
@@RustIsWinning cargo-mommy, you're welcome
This was an amazing stream. So many random CS/programming concepts randomly kept coming up in the most natural way.
Not only that but the classic Zozin humor mixed with the actually meaty project reignited my passion for my own side project that needs some love.
It's actually Ryan Dahl (the creator of node and deno) who made the get back javascript petetion
And it’s not just a petition to convince oracle, they are trying to free the mark by alleging trademark abandonment
Anything in the universe of structural programming, including futures, coroutines, and continuations, is just a fancy way of hiding gotos
yeah, make gotos great again!
_Anything_ in programming is a fancy way of hiding something lower-level. It's the whole point of the concept of abstraction.
@@hedlundand yet goto is like way fucking simpler lmao
Coroutines don't use goto at all though.
For loops and while loops are just goto as well, but it is a common enough pattern that giving it a name and abstracting it out is useful
6:00 It's called "cooperative multitasking". Cooperative because the program is not interrupted by the kernel but gives up control voluntarily.
Bro i can watch this guy all day ngl❤️ Keep it up
I can't, I use his videos to go to sleep. And now his voice makes me doozy
@@Zipperheaddttl are you aware of his cynical rants? if not, maybe that explains your nightmares :D
(jk, i love his rants, even though i don't usually agree but he does not take them seriously himself so that's that...)
Not sure if you care now that you got it working, but you don't actually need to do the thing for Rejects where you set the excuse later. The problem was that you were using the question mark operator after the WOULD_BLOCK when you were constructing the Reject, which was trying to propagate the error when you just wanted to create an instance of IoError.
Amazing you are in fact showing to us all the time what you’ve said: learn programming instead of programming langs
i love the enthusiasm & and the simplicity even tho i don't understand the concept that much nor much C, i wanted to implement this on my own but i couldn't get it well; but i loved the vid; made me wanna pursue some of my side projects
Is this not just writing a Promise that "looks like" a future, and because of that, won't work at all. A future still needs an execution context (i.e. some thread that manages it, that gets signalled when it can awaken and start polling). This is just... i don't even know what this is?
5 minutes in, and I'm already seeing Mr. Streamer doing a big sin in asynchronous programming, executing a promise using a spin-lock.
You need to start from somewhere
@@TsodingDailyValid
He is an evil man (just like Oracle)
i would say this stream is more like the library interface design (API) ... once we come to a proper `runtime` for these futures .. we will worry about execution
The fact that this guy doesn't have millions of subs is truly sad. What a chad of a programmer, truly elite in communication as well
In js async, await make function behave like synchronised, then why we need async,await in other language like c#,rust,dart what are synchronised by default?
Because the functions marked as async in those languages run in separate threads and thus you need wait to coordinate
@andreffrosa my actual question is,does js serve different purpose from other synchronise language? Because by default js doesn't block thread like c#,rust,dart.
@@naive_algorithm js has an execution loop, when calling [async function] fn() you dont execute it directly, you push it to a list of functions to be executed and the execution of the current block continues, this is fundamentally different to other common langs
Is `&self` as the first argument the same as `Future* self` (for the Future struct)?
1:17:40 - To be honest, I wasn't confident on the cleanness of the result until those macros were introduced. Damn, that is neat AF. I can't wait to watch the remaining of the video...
Have to look at the assembly in order to know for sure if something is only temporary on the stack.
Also, something like a logical OR (!a | b!) is necessary to execute both where boolean OR || skips if first is satisfactory.
I really like your videos. Keep it up and stay penger!
panim in c3 ??
I get why you went the javascript promises route instead of rust futures. The rust ones are state of the art tho, I guess it could be a fun little project to reimplement say smol in something like zig (or heck - C11 maybe)
brb
is there any lsp for c3?
Not interested in C3, but I realy like the idea of recreating async primitives from scratch.
Next goroutine + go runtime?
4:00 that's an awfully complicated explanation of "it's a loop that does nothing until condition happens and then it calls registered callback functions once"
you might have been interested in the fact that macros can take a trailing block of code as an argument.
that would get rid of the })}) hell at the end, and turn it into
fut(...).@then(...) { ... }.@then( ... ) { ... };
the trade-off is that you can't return a value from such a block.
He did this in the video but didn't like how it looks. I think you should watch the video before commenting something like this.
@ peculiar
did i accidentally skip something and not notice?
@@chri-k maybe. He did it towards the end when he finished his then implementation
1:44:00 it's probably because the C3 webpage uses TLS ECH which is banned in Russia.
Is asynchronous behaviour possible on a system with single processor?
As long as you have an operating system that runs on 1 processor then yes. The OS is more important than the core count.
What is that bar at the top of the screen? I also use i3wm and I really need this.
it's a Tab layout, usually its mapped to Mod+w
@@NexushasTaken thanks
The nicest thing about i3wm compared to its competition is its way superior documentation. If you're not reading it, you're missing out.
you should try Clay, its an ui library built in c, supports raylib
in functional programming its closures to the rescue
what font do you use?
iosevka
One of the things I don't like about C3 is also something I don't like about C++. Introducing a new double character token where they didn't exist to express a slightly different form of the singular character token is cancer. As far as references in my own language, I opted to use @ to represent them and for taking the address of something. I really dislike the r-value reference versus l-value reference dichotomy in C++. I get why the committee thinks they need to be manually differentiated by the user, but they're wrong. You just need to be more aggressive with scanning the parse tree, especially when you consider that they only really make sense when the compiler can see what you're referencing. I am curious though, why no one seems to ever engage with the discussions I try to have.
Your concerns about the use of double character tokens in languages like C++ and C# are quite valid and resonate with many developers who prefer simplicity and clarity in syntax. The introduction of new tokens to differentiate between similar concepts can indeed lead to confusion and a steeper learning curve, especially for those new to the language.
Using a single character, like @, to represent references in your own language is an interesting approach. It simplifies the syntax and reduces the cognitive load on the programmer. The distinction between l-value and r-value references in C++ can feel unnecessarily complex, especially when the underlying concepts could potentially be inferred by the compiler through more sophisticated analysis of the parse tree.
Your point about the compiler's ability to understand context is crucial. If the compiler can accurately determine the nature of the references based on the surrounding code, it could eliminate the need for developers to manually specify these distinctions. This could lead to cleaner, more intuitive code, allowing developers to focus on logic rather than syntax.
As for the lack of engagement in discussions around these topics, it can be frustrating. The programming community often gravitates towards established norms and practices, which can make it challenging for new ideas to gain traction. Additionally, discussions about language design can become quite technical and abstract, which might deter some from participating.
It might help to share your thoughts in more focused forums or communities that prioritize language design and syntax discussions. Engaging with like-minded individuals who share your passion for language simplicity could lead to more fruitful conversations. Keep pushing for clarity and simplicity in programming languages-it's a conversation worth having!
I hope you did not reach this line.
From my whole ~4 hour experience in C3, fault == enum, and we only question mark when we wanna "throw".
Someone could have given you futures as Christmas presents. 😅
Anyways, love your content, would definitely get time to see it on Christmas.
WOOD_BLOCK
I'd like to see zozin elaborate on the callbag standard by andré staltz
Isn't Oracle a bunch of layers and zero devs?
Pointers to literals should be safe, it's not like the data segments of the executable go away while it runs.
Unless it's all on the stack. The compiler could potentially just insert a sub from the stack then push a bunch of immediate values into that space.
@@anon_y_mousse Surely, not with the operator && in front of it. Although I doubt that C3 compiler does anything like that probable pessimization.
amazing show, thank you
What's wrong with subtitles?
just works in 8 months, just have to give birth
"**any**ways"
I swear there was a stream on same topic before and it was great. Alright time to learn about promises again I guess!
What if we want to call a javascript fetch function from this fetch while working with wasm.
The javascript fetch will call the callback, but how can we poll for that, without blocking the thread.
dynamic dispatching
Discovering Monad
What an intro!
Can u try vulkan with c??? Pls pls pls man I request
Vulkan with C is just vulkan
Thank you....
bikeshedding alert - 4:30 I like then() over chain an isFinished() over poll()
Maybe I'm weird, but I think ergonomics actually matter. To me, this isn't really bikeshedding.
Can you plz do genesis physics simulator next
i feel like java-style interfaces result in a lot of code bloat. why not just use struct with pointers as an interface object and then embed it into other structs like this:
```C
typedef struct Fut Fut;
struct Fut {
uint8_t (*poll)(void*data);
void *result; char *err_msg; Fut*next;
};
// usage:
typedef struct {Fut fut; uint8_t pos; uint8_t stop; } Counter;
uint8_t Counter_poll(Counter *self) {...};
int main(){
Counter c= {{(void*) Counter_poll}, 0, 10};
while (c.fut.poll(&c));
}
```
JS replacement incoming
You don't need to clone a github repo just to view it... Just go to the root of the repo and press dot '.' and it will open in an online vscode instance.... I know I know 'brother ewwww' it's not emacs but you can click/scroll /search/expand the file tree etc
C3 feels like Rust but without bullshit and cult stuff
We are not a cult and there is no bs!! 😠
Cult stuff is when you can't write UB code
love how simple the macros are in c3
Erm but is it safe??
@@aadilshabierliterally 1984 (and you still can)
pollable doesn't sounds very good in spanish 😂
First
Losing what have you done with your life?