Zig Weekly #4
Hello everyone! I missed last week's zig weekly issue so this week it's a bigger one! Enjoy :) // Filip
Language & compiler
- compiler: some performance and peak RSS optimizations (#37624) - merged: in mlugg's benchmark of building the std tests, peak memory drops by 28% with the self-hosted x86_64 backend and by about 10% with LLVM.
- Sema: support concatenating vectors (#37606) - merged:
++now works on two vectors and lowers to a shuffle, for now both sides must be vectors so literals need a type annotation. - hexdump support in objdump, new Io.Terminal style API (#37680) - merged:
zig objdumpgains a hexdump mode, andstd.Io.Terminalgets a new API for colors and styles that avoids emitting redundant escape sequences. - Elf2: implement merge sections (#37648) - merged: the new ELF linker now handles merge sections, which shrinks a compiler statically linked to LLVM by 36M (10%). A follow-up, #37664, adds support for input objects with 0xff00 or more sections.
std.Target: renameArch.aarch64_betoaarch64be(#37677) - merged, so code that names the old enum field needs updating.std.Target: bump baseline Windows version towin10_rs5(#37705) - merged: the default minimum Windows version is now 1809, since Microsoft no longer supports basewin10.std.Target: require an explicit CPU model foramdgcnandavr(#37766) - merged: these targets have no meaningful baseline CPU, so target resolution now asks for one.- Dwarf2: restructure debug info (#37739) - merged: the self-hosted DWARF output now uses one compile unit per Zig compilation unit, fixing line info for inline calls across units.
- crypto.tls: only accept RSASSA-PSS for RSA signatures in TLS 1.3 (#37757) - merged: the TLS client used to accept RSA-PKCS#1-SHA1 even though TLS 1.3 removed it. In the same batch, #37755 makes
crypto.asn1struct decoding strict and fixes several decoder bugs. - crypto.ff: add batch modular inversion (#37716) - merged:
invertBatch()uses Montgomery's trick to replace all inversions but one with multiplications.
ZLS
- Rename
packedtobitpack(#3326) - ZLS follows the language change frompackedtobitpack, now that it has reached the master tarballs. - Add known error sets (#3319) - merging an unknown error set with known ones now keeps the known errors instead of resolving to unknown.
- Preserve pointer type attributes (#3321) - ZLS now keeps
allowzero,align,volatileandaddrspaceon pointer types. - Exclude coercible values from type resolution (#3325) -
noreturn,@compileErrorandundefinedare now ignored when other branches have a known type. - Fix completion crash on unknown tagged union payload type (#3320) - fixes a crash reported in #3317.
- Support zig 0.18.0-dev.1260+833623422 (#3337) - ZLS master keeps up with the latest Zig master.
Community projects
Compiled from public posts. Want something removed or credited differently? Open an issue or pull request or email [email protected].
From the Ziggit thread What's everybody working on? (November edition):
- lalinsky released zio 0.20 and dusty 0.6, with more flexible routing and middleware, plus a new TLS library based on AWS-LC.
- lohann is reimplementing Apple's libc in pure Zig as libxnu, Apple silicon only for now.
- fearedbliss released Cactus 5.8.0, a Diablo II Worldstone Manager, now on Zig 0.17.1 and the latest DVUI.
- guidoschmidt is turning their Advent of Code solutions into a reusable framework ahead of this year's event.
- ericlang now has four terrain generators in their random lemmings-style game and is working on trap placement.
- andyleclair got image textures working in their ray tracer using zstbi.
- lukeflo is finishing content filtering for plain text files in lui, a step toward using it for notes.
- zeptogon sped up the raymarcher in their terrain viewer for GIS data and hopes to release a beta with source soon (video).
- threeaccents wrote zancudo, an epoll-based MQTT 3.1.1 broker that now runs the automation on their farm.
- xuckless is optimizing Anole, a backend framework, and plans C bindings for other languages.
- diamondjubilee is building mola, a Navidrome music player with DVUI and their first Zig project.
- lhp has a pure Zig Wayland client with its own protocol scanner and xkbcommon implementation, aiming at a photo tool that decodes Nikon NEF files.
Also on Ziggit:
- Shinobi: A Ninja build to Zig build translator - mdavisprog released shinobi v0.1.0, a library that translates
build.ninjafiles into the Zig build system to make C and C++ libraries easier to build. - Should Zig have a dedicated syntax for union initialization? - IntegratedQuantum finds union initialization verbose and the thread compares alternative syntaxes.
- Aspect - nullclyze started Aspect, an early-stage retained-mode GUI library on top of raylib that aims to use resources only when needed.
- WINS - DannyBaanks is writing WINS, an experimental runtime for Windows binaries on Linux without Wine, tested with games such as Fallout: New Vegas and Cuphead.
- xxd - peterino2 shared a 300-line xxd they use for debugging serialization.
- Zig IDE - kritarkri introduced Zig IDE, a Monaco-based desktop IDE dedicated to Zig.
New repositories:
- zean - translates Zig's AIR into executable Lean models so you can write contracts and proofs about Zig functions.
- juno - a modal terminal text editor with fuzzy finding, a project tree and multi-file search built in.
Articles & videos
Compiled from public posts. Want something removed or credited differently? Open an issue or pull request or email [email protected].
- How Not to Build a Music Player - Ali Cheraghi on building AMP, an offline music player written in Zig with its own UI and shaders, after internet shutdowns made online players unreliable.
- Why Zig Over C for Systems Programming - Mihalis Tsoukalos follows up his Zig versus Rust post by looking at the parts of C that cost him time and how Zig handles them.
- Typed indices in Zig - Louis Vignoli shows how to enforce the newtype index pattern at call sites with a getter helper, so indices for different arrays cannot be mixed up.
Call for participation
Add calls for participation, testing and good first issues by pull request.
Upcoming events
- Saturday 5 December - Zig Day Los Angeles #1, Peninsula Center Library, Rolling Hills Estates, CA.
- Sunday 6 December - Zig Day Portland #6, McMenamins Broadway Pub, Portland, OR.
- Saturday 12 December - Zig Day Vancouver #1, 220 Cambie St, Vancouver, BC.
- Sunday 13 December - Full-stack web development in Zig with Ziex!, Nurul Huda at Zig Maven, online, 10:00 UTC+2.
- Tuesday 29 December - A Developer-First Shell Built in Zig, Damilare Osibanjo on Wolysh at Zig Maven, online, 10:00 UTC+2.
Jobs
- Add open Zig jobs by pull request.
Contribute
Send a pull request with one link per change. Thanks to everyone who contributed this week.