3 ms·
> In that case you would add in such library a line like this: That's certainly an approach to make sure libraries run in the correct environment. But it still
by Matthias247 6y ago
> In that case you would add in such library a line like this:
That's certainly an approach to make sure libraries run in the correct environment. But it still doesn't seem to enable use-cases where you run an eventloop on some threads and blocking IO (or just blocking on the eventloop) on other threads, which are often found in bigger programs that are made up of a lot of heterogenous libraries.
One could say "you might not need that - just run everything async". But since we are talking about a system programming language where libraries might be exported and used in different projects I'm not sure if that lack of flexbility won't hurt long term.
- kristoff_it 6y agoI think I understand what you're saying. In this introduction I just wanted to give a feeling to people about the biggest building blocks so I didn't have the opportunity of diving into the small details (the article is already fairly long as is). Zig doesn't take shortcuts when it comes to give people control over the machine so what you describe is expected to be possible. The async part of the language is still being worked on (Zig is at v0.6.0 as I write) and the top level API will be reworked if it turns out to be problematic (that's the superpower of being at a version < 1.0).