Zig v0.17.0
Zig v0.17.0
0.17.0 Release Notes Download & Documentation Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. Zig development is funded via Zig Software Foundation, a 501(c)(3) non-profit organization. Please consider a recurring donation so that we can offer more billable hours to our core team members. This is the most straightforward way to accelerate the project along the Roadmap to 1.0. If you need donation receipts or are looking to migrate away from GitHub Sponsors, we recommend donating via Every.org.
0.17.0 版本发布说明、下载与文档。Zig 是一门通用编程语言和工具链,旨在维护健壮、高效且可重用的软件。Zig 的开发由 501(c)(3) 非营利组织 Zig 软件基金会(Zig Software Foundation)资助。请考虑进行定期捐赠,以便我们能为核心团队成员提供更多可计费工时。这是加速项目迈向 1.0 路线图最直接的方式。如果您需要捐赠收据或希望从 GitHub Sponsors 迁移,我们建议通过 Every.org 进行捐赠。
This release features 5 months of work: changes from 206 different contributors, spread among 925 commits. Originally predicted to be shorter, this release cycle ended up substantial, with the Build System reworked, including the introduction of the Build Server Protocol, and the ELF Linker enhanced to the point where we expect Incremental Compilation to work for everyone on x86_64-linux.
本次发布汇集了 5 个月的工作成果:来自 206 位不同贡献者的代码变更,共计 925 次提交。最初预计周期会更短,但最终这一发布周期内容相当充实,包括对构建系统的重构(引入了构建服务器协议 Build Server Protocol),以及对 ELF 链接器的增强——我们预期该增强将使 x86_64-linux 平台上的增量编译功能对所有用户可用。
Target Support §
目标平台支持 §
Zig supports a wide range of architectures and operating systems. The Support Table and Additional Platforms sections cover the targets that Zig can build programs for, while the zig-bootstrap README covers the targets that the Zig Compiler itself can be easily cross-compiled to run on.
Zig 支持广泛的架构和操作系统。“支持列表”和“额外平台”部分涵盖了 Zig 可以构建程序的各种目标,而 zig-bootstrap 的 README 则涵盖了 Zig 编译器自身可以轻松交叉编译并运行的目标平台。
Notable changes: aarch64-openbsd is now tested natively in Zig’s CI, ensuring high-quality support going forward. aarch64-freebsd and aarch64-netbsd CI jobs now run on pull requests too, in addition to master pushes. An LLVM bug that broke most aarch64-windows binaries, including the Zig Compiler, has been worked around. The Zig Compiler now applies mandatory code hardening techniques when targeting aarch64-openbsd so that the resulting binaries actually work.
值得注意的变更:aarch64-openbsd 现在已在 Zig 的 CI 中进行原生测试,确保了未来高质量的支持。aarch64-freebsd 和 aarch64-netbsd 的 CI 任务现在除了在 master 分支推送时运行外,也会在 Pull Request 中运行。我们绕过了一个导致大多数 aarch64-windows 二进制文件(包括 Zig 编译器本身)损坏的 LLVM Bug。Zig 编译器现在在针对 aarch64-openbsd 进行编译时,会强制应用代码加固技术,以确保生成的二进制文件能够正常运行。
Zig now provides stack traces on crashes and failed assertions on 32-bit ARM. Some work still remains for Thumb-only targets. Zig now provides stack traces on crashes and failed assertions on SPARC. Zig now handles pointer authentication opcodes when doing stack unwinding on AArch64. Support for the loongarch32-linux-gnu[sf] targets has been added. Zig now has generally usable support for 64-bit SPARC, and especially sparc64-linux. This is largely thanks to Zig’s new ELF linker which now has better support for this target than LLD.
Zig 现在在 32 位 ARM 架构上提供崩溃和断言失败时的堆栈跟踪。针对仅支持 Thumb 指令集的目标平台仍有一些工作要做。Zig 现在在 SPARC 架构上也提供崩溃和断言失败时的堆栈跟踪。Zig 现在在 AArch64 上进行堆栈回溯时能够处理指针认证操作码。增加了对 loongarch32-linux-gnu[sf] 目标的支持。Zig 现在对 64 位 SPARC(特别是 sparc64-linux)有了普遍可用的支持。这主要归功于 Zig 新的 ELF 链接器,它目前对该目标的支持比 LLD 更好。
The Zig Standard Library has been ported to the x32 and N32 ABIs on x86-64 and 64-bit MIPS, respectively. These are niche ILP32 ABIs that allow using the 64-bit instruction set while only having 32-bit pointers - the idea being to trade available address space for lower memory usage and better cache utilization. Target information has been added for some game consoles: aarch64-switch, arm-gba, mipsel-psx, and powerpc-wiiu.
Zig 标准库已分别移植到 x86-64 的 x32 ABI 和 64 位 MIPS 的 N32 ABI 上。这些是小众的 ILP32 ABI,允许在使用 64 位指令集的同时仅使用 32 位指针——其核心思想是用可用的地址空间换取更低的内存占用和更好的缓存利用率。此外,还增加了对一些游戏主机的目标信息支持:aarch64-switch、arm-gba、mipsel-psx 和 powerpc-wiiu。