• HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    3 months ago

    What’s the benefit of having everything be refcounted memory over Go-style garbage collection? If you have hundreds or thousands of allocations wouldn’t it eventually become slower than a full GC?

    Either way this is really cool. Nice to see a language that compiles to C, which is still fairly readable compared to assembly or LLVM, and can take advantage of C’s much more mature optimization toolchain. Flattening out recursion is a neat trick for having your readability cake and performance too.

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOPM
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      It’s a trade off, with ref counting you get more predictable behavior since you don’t have GC pauses, but you have to manually ensure you keep allocations in check. Apple has been using this approach on iOS for a while as I recall, and seems like keeping memory allocation at reasonable level hasn’t been a problem in practice. I do find GC is more ergonomic overall myself, but I can see the appeal of having the control that refcounting gives you for system level stuff.