We pre-allocate a bunch of static buffers and re-use them. But that leads to a ton of ownership issues, like the append footgun mentioned in the article. We've even had to re-implement portions of the standard library because they allocate. And I get that we have a non-standard use case, and most programmers don't need to be this anal about memory usage. But we do, and it would be really nice to not feel like we're fighting the language.
What I would absolutely love is a compacting garbage collector, but my understanding is Go can’t add that without breaking backwards compatibility, and so likely will never do that.
I've heard the term "beaten path" used for these languages, or languages that an organization chooses to use and forbids the use of others.
I don't completely get this. If you are memory requirements are strict, this makes little to no sense to me. I was programming J2ME games 20 years ago for Nokia devices. We were trying to fit games into 50-128kb RAM and all of this with Java of all the languages. No sane Java developer would have looked at that code without fainting - no dynamic allocations, everything was static, byte and char were the most common data types used. Images in the games were shaved, no headers, nothing. You really have to think it through if you got memory constraints on your target device.
You made a poor choice of language for the problem. It'd be a good fit for C/C++/Rust/Zig.
So it’s not like we’re running on a machine with only kilobytes of RAM, but we do want to minimize our usage.
If you use vanilla rust with global alloc everywhere then you will get fragmentation
You have to use nightly for custom allocators and implementing allocators and using them is super annoying still.