Get the latest tech news
Examples of quick hash tables and dynamic arrays in C
gram.com/blog/2025/01/19/ This article durably captures my reddit comment showing techniques for std::unordered_map and std::vector equivalents in C programs. The core, important features of these data structures require only a dozen or so lines of code apiece.
I don’t think it fits our problem as well as the next option, particularly because it puts a hard limit on unique keys, but it’s worth evaluating. Alternative to this, and as discussed in the original hash trie article, we could instead add a next field to Env as an intrusive linked list that chains the nodes together in insertion order. However, we can leverage an existing security mechanism, gaining this feature at basically no cost: Address Space Layout Randomization (ASLR).
Or read this on Hacker News