Re:Old Zig compiler (in C++) was nuked today
by UncleEntity on Wednesday December 07, 2022 @10:48AM
(#33895704)
IDK, if you want a rock solid wasi implementation it makes a lot of sense to use it in a somewhat, but not really, critical part of the bootstrap process.
Compiling to wasi which is then translated to C (as it is more efficient than a wasm interpreter apparently) does seem like an extra, unnecessary, step but what do I know about bootstrapping a compiler.
I'm both surprised and, at least as regards my current understanding of the situation, disappointed.
Also, one of my toy Zig projects depends on async[0] functionality not currently available in the self-hosted compiler, so I hope the add that before ditching the current stage1.
[0] I used the suspend/resume primitives to build coroutines, which are significantly simpler and easier to follow than the state machines they replaced in that code.
PS: I did some more digging in the Zig Discord channels and discovered that this is a temporary plan, and that all this WASM/WASI nonsense should ultimately be replaced by a C implementation. Still finding the reasoning for it a bit dubious though.