3 ms·
Interesting. Last I recall from working with Zig the plan was to run the self-hosted compiler against itself to produce a C file that would, itself, be the boot
by AnIdiotOnTheNet 4y ago
Interesting. Last I recall from working with Zig the plan was to run the self-hosted compiler against itself to produce a C file that would, itself, be the bootstrap compiler. Now it looks like there's an extra step involving a WASM blob and a WASI implementation, and the only explanation I could find is in a 50 minute video with no transcript.
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.
- UncleEntity 4y agoIDK, 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.
- deleted 4y ago[deleted]