I Believe Zig Has Function Colors [HN] - Shows that Zig has two colors of functions, async and not, that are distinguished by calling conventions. The color can usually be statically determined and the correct calling convention assigned, except when used as dynamic function pointers. Concludes that structured concurrency (as in Swift) is better.
There are also many bugs that do not exist in self-hosted, that only exist in the C++ implementation, so that will be very nice—especially for everybody who likes to go into crazy town with
comptime
, you can start to do all your fancycomptime
regex stuff with or whatever with this implementation.
Is there more written on how the self-hosted compiler enables further
comptime
expressivity?
The C backend allows the stage1 codebase to be retired.
Goodbye to the C++ Implementation of Zig [HN]
The Zig compiler in C++ was removed (80,000 lines), leaving only the self-hosted compiler (250,000 lines). To facilitate the new bootstrapping process, a stage1 compiler build is periodically checked into the repo and a minimal WebAssembly-to-C converter (4,000 lines of C) was added.
Bootstrapping process before:
zig1
.zig1
to compile the self-hosted Zig compiler into zig2
.Bootstrapping process now:
zig1.wasm
, with only the C backend enabled.zig1.wasm.zst
and check it into the repo.zig-wasm2c
to zstd-decompress and convert zig1.wasm.zst
to
zig1.c
.zig1.c
to zig1
. This has incorrect
logic (only C backend).zig1
to compile the Zig compiler into zig2.c
.zig2.c
to zig2
. This has correct
logic, but with the optimizations of the C compiler.zig2
to compile the Zig compiler into zig3
. This has correct logic
and optimizations.zig3
to compile the Zig compiler into zig4
. This is binary-wise
identical to zig3
.Zig ported to SerenityOS [talk] [PR] [HN]