[–] eatonphil 9 hours ago
[–] MrBuddyCasino 6 hours ago
[–] eatonphil 6 hours ago
[–] dlahoda 5 hours ago
[–] andrewla 10 hours ago
I think we can learn something here.
[–] vatsachak 10 hours ago
[–] ted_dunning 9 hours ago
The OP article here is nice because it allows selective enforcement of allocation free code. If you have code that has some discipline about heap allocation such as having all small allocations then you are OK on the fragmentation front.
[–] bootsmann 8 hours ago
[–] Groxx 6 hours ago
[–] pjmlp 8 hours ago
[–] fpoling 6 hours ago
[–] pjmlp 4 hours ago
Yet one still needs to account with processes like MISRA to account for safety.
[–] fpoling 6 hours ago
[–] treyd 10 hours ago
After a few rounds of this though it might end up seeming like it's not worth the hassle and it's easier to build the whole application in Rust.
[–] vatsachak 9 hours ago
[–] treyd 9 hours ago
[–] vatsachak 9 hours ago
For example,
- A field in a struct cannot borrow another field so now you'd have to create two structs. I guess you could write an impl to borrow that field instead of storing the borrow.
- In simulation software I wrote I found that mimalloc does just as good as bumpalo (within 5%) so carrying a bump everywhere was useless. Not really a rust issue but rather a loss of faith in manual memory management for me.
- Eventually over time you start adding Arc<Fn(Blah)->Foo> everywhere and Box, Arc and friends start coming in. But you can't have cyclical references there so you have to use Weak. And you have to use OnceCell or LazyCell or LazyLock for things that should run at start time.
Rust is really great for the crates, but ...
For applications which are not absolutely performance critical and cannot* be stated pretty easily in linear logic + clone + drop you can get away with Haskell
[–] Mawr 8 hours ago
[–] hoppp 10 hours ago
I don't see much point in choosing a language just to bypass it's features.
[–] cpgxiii 9 hours ago
Given the issues involved in mixing languages, there can be cases where sticking with one "good enough" GC'd language and having to write a few performance-sensitive parts in very unidiomatic form to minimize/eliminate GC work is preferable.
[–] revengerwizard 9 hours ago
[–] cpgxiii 4 hours ago
[–] eptcyka 8 hours ago
[–] kvemkon 10 hours ago
[–] iguessthislldo 9 hours ago
[–] pjmlp 8 hours ago
"Why we chose Java for our High-Frequency Trading application"
https://medium.com/@jadsarmo/why-we-chose-java-for-our-high-...
[–] jcelerier 8 hours ago
[–] prophet_margin 9 hours ago
[–] bayindirh 7 hours ago
Also, I also agree that people optimize without proper testing and profiling. If there's a real bottleneck here, trying to optimize it is the right call. OTOH, optimizing without profiling opens a lot of unnecessary cans.
Lastly, Go doesn't like constant allocation and deallocation of variables, that's true, but I believe knowing this and optimizing hot-loops for that goes a very long way as a start.
[–] legulere 7 hours ago
[–] pjmlp 8 hours ago
Like everything else in Go, its designers have decided to ignore learnings in GC systems languages.
[–] raggi 9 hours ago
Go/GC are mostly fine for medium frequency medium scale mid stack problems.
It’s bad for high frequency computing. It’s bad for very small targets, for very large targets, and by association software that lives at the very bottom of the stack.
Go is a high efficiency framework for writing mid sized servers, not a systems language. The runtimes hard opinions and closed interface are the reason for this enclosing definition and the GC is one part of that.
[–] kristianp 4 hours ago
[–] Gys 10 hours ago
[–] gritzko 9 hours ago
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
[–] gritzko 8 hours ago
[–] kristianp 4 hours ago
[–] kvemkon 10 hours ago
[–] eatonphil 9 hours ago
[–] kvemkon 8 hours ago
https://github.com/theconsensuslabs/noalloc#the-compilers-ou...
[–] raggi 9 hours ago
Tides have shifted somewhat, but I suspect this may still be rejected.
Unfortunately a lot of people’s experience with such proposals was also historically getting gaslit by a brigade, so a lot of folks moved on and won’t bother trying again.
[–] ted_dunning 9 hours ago
That might be changing (slightly) because of the Tamago work on NOOS.
[–] wahern 8 hours ago
Go does a great job of making these impose minimal cost, both technically and cognitively, on typical platforms, from server (including many "embedded" server environments) to desktop to smartphone. That's why it has such a sophisticated yet largely transparent user space threading layer. But it's very difficult and usually impractical for Go to target extremely resource constrained environments without exposing and crippling it's core abstractions. Some people are willing to contort Go to fit that space, but perhaps that's because their vision of what makes Go, Go, differs from the creators' and core maintainers' understanding of Go.
It's an extremely early project but it's been helping me out a bunch already. Would love to hear your bug reports or requests if you try running it on your codebase.
[0] https://theconsensus.dev/p/2026/06/27/the-feature-in-oxcaml-...
* I think you can get this in Clang and maybe GCC with `__attribute__((nonallocating))` though.