TopicTracker
From danielchasehooper.comView original
TranslationTranslation

Type Safe Generic Data Structures in C

The author presents a technique for implementing type-safe generic data structures in C using unions to associate type information. The approach is demonstrated through a basic linked list implementation and can be applied to various data structures like maps, arrays, and binary trees.

Related stories

  • The article reflects on the XMPP era of the internet when open protocols enabled decentralized communication across different messaging platforms. It describes how users could connect with friends regardless of which service they used, creating an interoperable ecosystem before today's walled gardens.

  • Early video cards with bank-switched memory required programmers to manually switch memory banks to access different parts of the video buffer. This was necessary because the cards had more memory than could be addressed at once through the available address space. Developers had to write code that explicitly managed these bank switches to handle 24-bit color formats and other graphics operations.

  • Badvibes is a linting tool designed for Vibe Coders that helps identify and fix code issues. The package provides automated code quality checks to maintain coding standards and improve development workflows.

  • The author describes their personal default approach to error reporting, focusing on showing users useful error messages. This follows their previous discussion about Zig's strongly-typed error codes solving error handling.