logoalt Hacker News

tcfhgjyesterday at 7:22 PM1 replyview on HN

what about non-io code?


Replies

messeyesterday at 7:33 PM

What about it? It gets called without an Io parameter. Same way that a function that doesn't allocate doesn't get an allocator.

I feel like you're trying to set me up for a gotcha "see, zig does color functions because it distinguishes functions that do io and those that don't!".

And yes, that's true. Zig, at least Zig code using std, will mark functions that do Io with an Io parameter. But surely you can see how that will lead to less of a split in the ecosystem compared to sync and async rust?

show 2 replies