Join Nostr
2026-03-23 17:21:07 UTC
in reply to

pixx on Nostr: Something fascinating here: this is a codebase in C. It's not doing anything crazy by ...

Something fascinating here: this is a codebase in C. It's not doing anything crazy by the rules of C. C is my preferred language, the one I'm best at. I understand every single line of code, on its own.

But a lot of the high level logic feels weirdly foreign, moreso than typical Go code even.

I can read the code and go "oh that's a hash table" pretty easily, and i get using a hash table to quickly identify cached blocks

But the table is, implicit? Sorta?

The heads of each "bucket" are stored in the cache, but there's no real bucket. Each block just has a doubly linked list to follow prev/next pointers which, sure, but then it also multiple other unrelated lists.

Okay, not too crazy.

But they're sorted by a fake ticker clock, except not entirely, only sorta quadratically? Which seems to just be a way to maintain a LRU in *yet another list* sorting the *exact same set* of *statically allocated blocks*.

And, i can untangle all of this. It requires pen and paper ( or a .tex file), but it's a fascinating experience reading something, understanding what it means, but having no clue what it's doing