Unofficial Hacker News companion — get notified on comment replies, and more.

The state of Rust allocators in 2026: stabilised (opens external site)

217 points by fanf2 4 days ago | cetra3.github.io | 90 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (6)

  1. And then I have to deal with writing tons of code to please the borrow checker myself. At which point I might as well go for a language that doesn't need so much ritual.
    Replies (2)
    1. Why not use an LLM to help with the actual syntax while you only need to worry about the data flow? I've found they're quite good with that.
      Replies (1)
      1. It's not just syntax. Depending on the allocation scheme used it can be very difficult to prove to the borrow checker that it's all safe, or even impossible (the same way some data structures in Rust can only be implemented with `unsafe`).
        Replies (2)
        1. If you stick to single ownership and stack tied or static lifetimes it's not too bad. If you're trying to pass parameters with lifetimes that extend beyond the stack frame and aren't static, then yes, that is painful. Callbacks or async style code in particular is challenging.
        2. Agreed, this is why I don't write kernels or things like that in Rust. The borrow checker will assume that your code is running in a parallel (multicore/multithreaded) capable environment, even if it isn't, and there is no way to explicitly tell the borrow checker to stfu, so you have to do a bunch of hack abstractions (Ref<T>, Rc<T>, ...) just to make it shut up.
    2. ...in what way is this related? Ownership is ownership, it's always a factor. Allocation is different because if you don't want any dynamic allocation, you don't want an allocator in the first place, ownership is an orthogonal concern