Type Safe Generic Data Structures in C

·Hacker News··

See my follow-up article: “A Fast, Growable Array With Stable Pointers in C” I write type safe generic data structures in C using a technique that I haven’t seen elsewhere1. It uses unions to associate type information with a generic data structure, but we’ll get to that. My approach works for any type of data structure: maps, arrays, binary trees… but for this article I illustrate the ideas by implementing a basic linked list.

Read full article →

Related Articles

Improper redaction reveals Google Data Center water and electricity usage
sensanaty · Hacker News · 18h ago
Run Qwen 3.8 Flash Next (125B) on consumer hardware (RTX 4090) at 100T/s
snehesht · Hacker News · 1d ago
A 40ms Go garbage collector pause caused by swap
shellpipe · Hacker News · 13h ago
Car is a smartphone on wheels. Here's who's listening
longhaul · Hacker News · 22h ago
Federal judge calls Flock 'indiscriminate mass surveillance'
sbulaev · Hacker News · 1d ago