• Log in | Sign up@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    5 hours ago

    Garbage collection is pausing the main thread while you go searching the heap for memory to free up. It’s slow and unpredictable about when it’ll happen or how long it’ll take. That’s a very different process indeed and roc doesn’t do it.

    Whether you call it static reference counting or not, when roc chooses in-place mutation it’s because it would have satisfied the borrow checker. It can do a wider class of such things when stuff goes out of scope. There’s a webserver platform that does arena allocation, often swerving cache misses as a result, but crucially frees the entire arena in one step. Freeing up all the tiny little bits of memory for lots of individual stuff as you go along as rust would do would be far slower.

    Calling that kind of thing garbage collection is I think very misleading indeed.

    Optimising your memory management for each problem domain/platform actually give you memory management efficiencies.