2 ms·
Oh yeah, I know about that. But that is commonly called "colored functions" not "multi colored functions" no? So I thought there was a difference.
by valenterry 3y ago
Oh yeah, I know about that. But that is commonly called "colored functions" not "multi colored functions" no? So I thought there was a difference.
- littlestymaar 3y agoZig aims to solve this “problem” by having functions that can be either async or not.
- wtetzner 3y agoRight, colored functions are e.g. async or not async. In Zig, you can write a single function that works as both, which I assume is what multicolored means here.
- valenterry 3y agoThat doesn't seem to make any sense to me - it should be then called uncolored functions no? Because they all look the same. But maybe that's what they ment to say.
- kps 3y agoThey're generic over ‘color’ at compile time; the compiler generates code for normal and/or async contexts as necessary.
- valenterry 3y agoRight - so to the developer they all look the same, which means they are uncolored. If they are colored it means they look different (e.g. async vs sync).