4 ms·
It arguably isn’t fully colorblind: https://gavinhoward.com/2022/04/i-believe-zig-has-function-colors/ https://gavinhoward.com/2022/04/i-believe-zig-has-functio
by layer8 5y ago
It arguably isn’t fully colorblind: https://gavinhoward.com/2022/04/i-believe-zig-has-function-colors/ https://gavinhoward.com/2022/04/i-believe-zig-has-function-c...
- kbd 5y agoThe mistake that article makes (imo) is that "colorblindness" means at compile-time. i.e. you don't have to define both a sync and an async version of a function. Obviously async vs sync have different representations at run time.
- layer8 5y agoDefinitions aside I’d say that it seems to be a leaky abstraction.
- throwawaymaths 5y agoAs someone who has used this (to enable a single function to be called either preemptively or cooperatively by a surrounding VM)... It's not leaky. To be frank, until you've actually done it, it's hard to see.
- layer8 5y agoSection 4 of the article I linked demonstrates how it’s leaky. Admittedly just in special scenarios, but it means that the mechanism isn’t fully transparent.
- a1369209993 5y agoActually, I think "colorblind" is good term for this: zig indisputably has function color (as the article demonstrates), but you can't see it.
- anonymoushn 5y agoHere's a working version of the program gavinhoward was trying to write: https://gist.github.com/sharpobject/49bd88416e68606d7812d609831cc8ae https://gist.github.com/sharpobject/49bd88416e68606d7812d609...