Hacker News
points by gritzko 9 hours ago | 0 comments
If you don't allocate, why do you even need Go or Rust? LLMs handle less elegant syntax just as well. I use a zero-malloc C dialect with slices and bounds-checking.

Just recently I was sketching a smallish database in zero-malloc C. https://replicated.live/blog/db That was partly because most LSM data structures are read-only, so mmap was good enough and concurrent access was safe for the bulk of the data.

The "hot zone" (memtable) then requires some intricate engineering, but that is the case either way.

You can go quite far with zero-malloc C.

[–] steveklabnik 9 hours ago
Rust doesn't have heap allocation in the language at all. It still has useful features regardless.
[–] gritzko 9 hours ago
Technically, malloc() is a library function, not core C. My point is this: guarantees cost complexity, and you always have to keep in mind the assumptions and how much of it is theater. So, neither way is strictly better. It depends. For immutable data, lifetimes don't buy much, for example.