Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Now backed by the Zig Software Foundation, the project is not only financially sustainable, but offers paid contracting hours for 4 people, soon to be more.
This release features 7 months of work and changes from 187 different contributors, spread among 2666 commits.
Zig uses a Tier System to communicate the level of support for different targets. Notably, in this release:
|free standing||Linux 3.16+||macOS 10.13+||Windows 8.1+||FreeBSD 12.0+||NetBSD 8.0+||UEFI|
|x86_64||Tier 1||Tier 1||Tier 2||Tier 2||Tier 2||Tier 2||Tier 2|
|arm64||Tier 1||Tier 2||N/A||Tier 3||Tier 3||Tier 3||Tier 3|
|arm32||Tier 1||Tier 2||N/A||Tier 3||Tier 3||Tier 3||Tier 3|
|mips32 LE||Tier 1||Tier 2||N/A||N/A||Tier 3||Tier 3||N/A|
|i386||Tier 1||Tier 2||Tier 4||Tier 2||Tier 3||Tier 3||Tier 2|
|riscv64||Tier 1||Tier 2||N/A||N/A||Tier 3||Tier 3||Tier 3|
|bpf||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|hexagon||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|mips32 BE||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|mips64||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|amdgcn||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|sparc||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|s390x||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|lanai||Tier 3||Tier 3||N/A||N/A||Tier 3||Tier 3||N/A|
|powerpc32||Tier 3||Tier 3||Tier 4||N/A||Tier 3||Tier 3||N/A|
|powerpc64||Tier 3||Tier 3||Tier 4||N/A||Tier 3||Tier 3||N/A|
|avr||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|riscv32||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||Tier 4|
|xcore||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|nvptx||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|msp430||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|r600||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|arc||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|tce||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|le||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|amdil||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|hsail||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|spir||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|kalimba||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|shave||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|renderscript||Tier 4||Tier 4||N/A||N/A||Tier 4||Tier 4||N/A|
|wasm32||Tier 2||Tier 3||Tier 2|
|wasm64||Tier 4||Tier 4||Tier 4|
zig targetsis guaranteed to include this target.
zig targetswill display the target if it is available.
-femit-asmand cannot emit object files.
I apologize - due to personal life events, I have not had the time to complete these release notes. My plan is to do a 0.7.1 bug fix release in 1-3 weeks (when the issues in the milestone are resolved) and have the 0.7.0 release notes completed by that time (it takes more than one week just to type up the release notes).
This release of Zig upgrades to LLVM 11.
This release of LLVM promotes AVR to a non-experimental backend, and therefore the AVR backend of Zig is now widely available with this release.
Thanks to LemonBoy for submitting several patches to LLVM and Clang to fix zig-related bugs.
Because cross-compiling is a first-class use case, Zig provides libc whenever possible, rather than depending on the host libc.
Zig now provides libc headers for macOS, and therefore it is possible to cross-compile C code, targeting macOS. Additionally, for native macOS builds, there is one less dependency on xcode when compiling C code.
Note that linking on macOS is still problematic due to deficiencies in LLD, however two things are happening on that front:
Zig ships with the source code to musl. When the musl C ABI is selected, Zig builds musl from source for the selected target.
This release updates the bundled musl source code to v1.2.1.
Zig gains the ability to target glibc 2.32 in addition to the other 42 glibc versions.
In this release, Zig's glibc support is improved to gracefully handle when the native-detected glibc version is newer than glibc 2.32. In this case Zig will build the newest version that it can.
Zig ships with the source code to mingw-w64. When targeting *-windows-gnu and linking against libc, Zig builds mingw-w64 from source for the selected target.
This release updates the bundled mingw-w64 source code to v8.0.0.
The main focus of this release cycle was the self-hosted compiler. There is a lot to talk about here:
macOS development in the past 6 months has been tumultuous, with the major breaking changes of Big Sur and the announcement of the upcoming aarch64 hardware.
Jakub Konka has purchased an Apple dev kit and has been working on Zig support for this system. Zig programs work for this system however they require a workaround to utilize the system linker rather than LLD. The next step here is LLD improvements for this system, as well as the Zig self-hosted linker code that Jakub has been working on.
Note: many bugs were both introduced and resolved within this release cycle.
Zig is immature. Even with Zig 0.7.0, working on a non-trivial project using Zig will likely require participating in the development process.
The first release to ship with no known bugs will be 1.0.0.
A 0.7.1 release is planned.
Alex is the main developer behind ZLS. He quit his civil engineering job and is looking to transition his career into programming. Alex contributed the PE/COFF (Windows) Self-Hosted Compiler code and is next in the queue for paid contracting hours.
Check out Alex's SHOWTIME talk titled A Practical Guide to Compile Time Evaluation.
Check out Jakub's SHOWTIME talk titled Introduction to MachO linking in Zig.
You might recognize SpexGuy from hanging out in
#zig-help discord channel
and patiently answering questions in great detail.
I am pleased to announce that he is now our newest paid contributor, and his main focus is working on the first draft of the official Zig language specification.
This is a new development, and so he has not had time to make significant progress yet.
According to the 0.6.0 Roadmap, the major theme of the 0.7.0 release was supposed to be stabilizing the language, creating a first draft of the language specification, and self-hosting the compiler.
We have made great strides towards this goal, which you can see with Self-Hosted Compiler and Martin "SpexGuy" Wickham Working on the Language Specification. However, there is still much to do.
The major goal of the 0.8.0 release cycle is to finish the self-hosted compiler and ship it, deleting the C++ implementation of Zig. If you are concerned about bootstrapping, see this issue: #6378: Allow the feature of O(1) bootstrapping to temporarily regress
Having a package manager built into the Zig compiler is a long-anticipated feature. Zig 0.7.0 does not have this feature.
If the package manager works well, people will use it, which means building Zig projects will involve compiling more lines of Zig code, which means the Zig compiler must get faster, better at incremental compilation, and better at resource management.
Therefore, the package manager depends on finishing the Self-Hosted Compiler, since it is planned to have these improved performance characteristics, while stage1 is not planned to have them.
This release of Zig intentionally regresses the C header file generation feature. It got deleted along with 19,216 other lines of C++ (good riddance!) and the feature will be added back, but only to the Self-Hosted Compiler.
If you want more of a sense of the direction Zig is heading, you can look at the set of accepted proposals.
Special thanks to Ave and Luna of LavaTech, who are hosting an instance of SourceHut for our Continuous Integration pipeline, but with more RAM than the main sr.ht service allows. Thanks to this, FreeBSD now has significantly more test coverage, most notably all the standard library tests.
Special thanks to those who sponsor Zig. Because of you, Zig is driven by the open source community, rather than the goal of making profit. In particular, these fine folks sponsor Zig for $50/month or more: