tagged-unions

Tag

Cards List
#tagged-unions

Memory Safety's Hardest Problem

matklad ↗ · 2026-07-20 Cached

This article discusses a fundamental memory safety challenge involving tagged unions where a pointer to one variant is used after the union is overwritten with a different variant, leading to type confusion. The author also argues that buffer overflows are the most exploitable memory error and could have been mitigated with better array syntax.

0 favorites 0 likes
#tagged-unions

Even More Tagged Union Subsets with Comptime

Lobsters Hottest ↗ · 2026-05-19 Cached

This article explores using Zig's comptime to create tagged union subsets, inspired by Mitchell Hashimoto's work, and applies the technique to a MyST parser's AST traversal.

0 favorites 0 likes
#tagged-unions

Tagged Union Subsets with Comptime in Zig

Mitchell Hashimoto ↗ · 2024-09-23 Cached

Mitchell Hashimoto demonstrates how to use Zig's comptime to create subset types of tagged unions, enabling compile-time safety without exhaustive case handling.

0 favorites 0 likes
← Back to home

Submit Feedback