What’s new:
switchimprovements:packed structandpacked unioncan now be used as switch prong items, compared solely via their backing integer. Decl literals and@enumFromIntmay now also appear as switch prong items, and union tag captures are now allowed for all prongs, not justinlineones.@cImportdeprecated: C translation is moving to the build system. The@cImportbuiltin is now deprecated; the recommended path is to useb.addTranslateC(...)inbuild.zigwith a header file, or use the officialtranslate-cpackage for more customization.@Typereplaced with individual builtins: The@Typebuiltin has been removed and replaced with 8 dedicated type-creating builtins:@EnumLiteral,@Int,@Tuple,@Pointer,@Fn,@Struct,@Union, and@Enum. For example,@Type(.{ .int = .{ .signedness = .unsigned, .bits = 10 } })is now simply@Int(.unsigned, 10).- I/O as an Interface: The headline stdlib change. This debut makes I/O abstracted through an interface, enabling
Future,Group,Batch, andCancelationprimitives, along with reworkedFile System,Networking,Process,Time,Entropy, andSync Primitives.GenericReader,AnyReader, andFixedBufferStreamare removed in favor of this model. heap.ArenaAllocatoris now thread-safe and lock-free.heap.ThreadSafeAllocatoris removed since it’s no longer necessary.- Deflate compression added: alongside simplified decompression APIs, with a zlib performance comparison provided in the notes.
- “Juicy Main”: a new pattern for the
mainfunction that takes anioargument, enabling more flexible I/O abstraction at the program entry point. - Containers migrated to “Unmanaged” style.
Thread.Poolremoved.PriorityDequeueadded. memchanges: newcutfunctions added, andindexOf-style functions renamed tofind.- Windows improvements: networking without
ws2_32.dll, completed migration to NtDll, and inter-process progress reporting. - Crypto additions: AES-SIV, AES-GCM-SIV, Ascon-AEAD, Ascon-Hash, Ascon-CHash.
- Environment variables and process args are no longer global state.
- Local package overrides: you can now override dependencies with local paths, useful during development.
- Project-local package fetching: packages can be fetched into the project directory rather than a global cache.
- Unit test timeouts, new
--error-styleand--multiline-errorsflags, and a Temporary Files API. - Incremental compilation continues to advance. x86, aarch64, and WebAssembly backends all received improvements. Import libraries can now be generated from
.deffiles without LLVM. C translation was also improved. - New ELF linker: a rewritten ELF linker replaces the old one.
- Smith: an AST-based structure-aware fuzzer. It helped find and fix numerous compiler bugs. Multiprocess fuzzing, infinite fuzzing mode, and crash dumps were also added.
- LLVM 21 (with loop vectorization temporarily disabled due to a regression). Updated bundled libraries: musl 1.2.5, glibc 2.43, Linux 6.19 headers, macOS 26.4 headers, FreeBSD 15.0 libc.
- Solaris, AIX, and z/OS support dropped: the Zig project cannot support proprietary OSes that make it unreasonably difficult to obtain system headers. illumos remains supported as an open-source OpenSolaris fork.
- Other language changes include small integer > float coercion, forbidding runtime vector indexes, forbidding trivial local addresses being returned from functions, pointers to comptime-only types no longer being comptime-only, and tighter rules on packed unions (no unused bits, no pointers inside).
AdP