|
|
|
|
|
by jwarden
57 days ago
|
|
I think this is right. More specifically, the problem is JavaScript function colors mean Sync/Async, whereas Zig's mean Non-IO/IO. Using function colors for async is fundamentally unnecessary, whereas for I/O it is fundamentally necessary. You should be able to define a synchronous function that calls an asynchronous function. But it makes no sense to define a non-IO function that calls a function that does IO. EDIT: with the exception of doing IO on a freshly allocated, in-memory buffer that doesn't escape the function call. |
|
(it's what I'm planning for my own lang, having `trace` be "blessed" to not make a function unpure despite I/O)