Hacker News new | ask | show | jobs
by uluyol 878 days ago
Not sure early versions of rust is the best example of refcounting overhead. There are a bunch of tricks you can use to decrease that, and it usually doesn't make sense to invest too much time into that type of thing while there is so much flux in the language.

Swift is probably a better baseline.

1 comments

Yeah I was thinking the same thing. "10 years ago the Rust compiler couldn't produce a binary without significant size coming from reference counts after spending minimal effort to try and optimize it" doesn't seem like an especially damning indictment of the overall strategy. Rust is a language which is sensitive to binary size, so they probably just saw a lower-effort, higher-reward way to get that size back and made the decision to abandon reference counts instead of sinking time into optimizing them.

It was probably right for that language at that time, but I don't see it as being a generalizable decision.

Swift and ObjC have plenty of optimizations for reference counting that go beyond "Elide unless there's an ownership change".