Zig Weekly #3
Hi everyone, issue #3 is here! So far it's mostly driven by discovery and compiling public sources, I encourage you to add your own items here, thank you in advance! Quite a few interesting discussions about the language, a great video from Pokelego Dev, and oh! libghostty 1.0 is here! Enjoy :)
Language & compiler
- Sema: clean up comptime deref logic (#37524) - merged: slice special casing moves out of the main load path into a new
analyzeRefDereffunction, resolving #37148 and #37101. - Elf2: init/fini array priority (#37539) - merged: the new ELF linker now supports init and fini array priorities, resolving #37233.
- SPIR-V: fix layout variant selection in buffer blocks (#37502) - merged. Also merged is #37468, where
@intFromPtrnow emitsOpConvertPtrToUinstead of a fallback that did not validate (its Codeberg page returns an error at the moment, so no link). crypto.ff: public modular inversion (#37512) - merged: addsinvertPublic(), adapted from BoringSSL and Fiat Crypto, intended for uses such as RSA blinding.
Under discussion:
- Syntax at the top of file to choose the kind of namespace (#37373) - accepted proposal by andrewrk that lets a file be an enum, union, opaque or packed struct by starting with e.g.
struct;orpacked struct(T);, still collecting comments (26 so far) including alternatives such as a file-levelreturn. - Require fields to be at the top (#37375) - accepted, breaking proposal by andrewrk that fields of structs, enums and unions must come before any declarations, with 36 comments and the debate still going.
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):
- ata-sesli released Zova v1.4.0, an embedded database on top of SQLite for records, objects, vectors and graphs.
- nidemidovich wrote micpin, a macOS daemon that keeps a preferred microphone selected as the default input.
- tranzystorekk updated the
cdhelper zioom to Zig 0.17 and replaced libvaxis with dabeob. - Southporter added on-request image loading to the toy browser Hush.
- IntegratedQuantum estimates the Vulkan rewrite of Cubyz is about 75% done.
- mattnite is working on Gauntlet, a hardware-in-the-loop CI system for MicroZig.
- codegasm added a frame timing graph to Flint.
- nour added editable live strokes to the painting app slap.
- Epydi is building Virexon, a WebAssembly runtime compiler.
Also on Ziggit:
- Halloween Challenge: Cursed Zig - Calder-Ty asked for the most cursed Zig people have written, and tholmes's reply is a
whileloop whose condition retries starting a concurrent task, awaiting the group on failure.
Articles & videos
Compiled from public posts. Want something removed or credited differently? Open an issue or pull request or email [email protected].
- Making a Zig HTTP Server Absurdly Fast - Pokelego Dev video on scaling the performance of a Zig HTTP server.
- Shlemiel the Painter Is Back: How Zig's libc Rewrite Made SQLite 12,000x Slower - Dennis Forbes traces minutes-long SQLite inserts in a Rust chess analysis service to a performance problem in Zig's libc, with a Ziggit thread pointing to a work-in-progress PR (#37417) that stops string functions like
strchrfrom looping over the string more than needed. - Integer addition is not associative, or should we put constants to the right? - Olvilock argues that because overflow is observed per operation, omitting parentheses in a chain of additions changes behavior, prompted by the operator precedence example in the release notes.
- Libghostty 1.0 - Mitchell Hashimoto announces that libghostty-vt, the terminal emulation C library extracted from Ghostty, now has a stable library and C ABI.
Call for participation
Add calls for participation, testing and good first issues by pull request.
Upcoming events
- Tuesday 29 December - A Developer-First Shell Built in Zig, Damilare Osibanjo on Wolysh at Zig Maven, online, 10:00 UTC+2.
- Saturday 21 November - Zig Day Bristol #5, Parallel Wireless, Prologue Works, 25 Marsh St, Bristol.
- 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.
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.