Hacker News new | past | comments | ask | show | jobs | submit login

I think calling lua style coroutines async is muddying the waters. Then even pthread could be called async.

I think async should be reserved specifically for stackless coroutines runtimes.




Zig has many similarities stackful coroutine runtimes though, and I suspect that our pre-existing notions of stackful and stackless coroutine libraries may not apply well to it. The compiler has to statically know the maximum depth from which a function or its callees can suspend, then this whole maximum-sized stack is saved in the resulting frame type. This is distinct from e.g. Rust, where each stack frame of the async parts of your async call stack has separate storage.

Edit: I guess I mean to say that Zig could in the future remove the async calling convention (but keep the fact that each function is either async or not) and switch to a model like libco without breaking very much code. If this does happen, I don't think it's necessary to rename the keywords at that time.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: