Remix.run Logo
tcfhgj 3 hours ago

what about non-io code?

messe 3 hours ago | parent [-]

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?

torginus 19 minutes ago | parent | next [-]

This creates the drill-down issue we see with React props where we have to pass objects around in the call chain just so that somewhere down the line we can use it.

React gets around this with the context hook and which you can access implicitly if it has been injected at a higher level.

Do you know if Zig supports something of the sort?

messe 13 minutes ago | parent [-]

It doesn't and likely never will.

This has been a non-issue for years with Allocator. I fail to see why it will be a problem with IO.

tcfhgj 3 hours ago | parent | prev [-]

> But surely you can see how that will lead to less of a split in the ecosystem compared to sync and async rust?

not yet