News for hackers. Stuff that matters.
Re:Boehm-Demers-Weiser conservative C/C++ Garbage Collector by mike_hearn on Sunday January 21, 2024 @09:41AM (#39078836)
I read it in an old HN comment by pcwalton. Algolia to the rescue! Actually it's even worse, he said it was 19% of the binary size:

https://news.ycombinator.com/item?id=5691684

The Rust compiler does this. Even so, 19% of the binary size in rustc is adjusting reference counts.

I am not exaggerating this. One-fifth of the code in the binary is sitting there wasted adjusting reference counts. This is much of the reason we're moving to tracing garbage collection.

It's interesting how many strategies Rust tried before settling on linear types.

Re:Boehm-Demers-Weiser conservative C/C++ Garbage Collector by klodolph on Sunday January 21, 2024 @12:39PM (#39080597)
> It's interesting how many strategies Rust tried before settling on linear types.

Rust doesn’t actually have linear types. I’m not sure what Rust’s types are called (affine?), but linear types are the “must be consumed” (can’t leak) types, and Rust doesn’t have any support for this.

Rust’s guarantee is that you MUST NOT use an object after dropping it. Linear types would add the additional requirement that you MUST drop the object.

Re:Boehm-Demers-Weiser conservative C/C++ Garbage Collector by steveklabnik on Sunday January 21, 2024 @03:53PM (#39082940)
Rust's types are affine, yes. Sometimes some people don't draw the distinction between the two and call both "linear." But "affine" is more precise.
Re:Boehm-Demers-Weiser conservative C/C++ Garbage Collector by steveklabnik on Sunday January 21, 2024 @10:27AM (#39079272)
Thank you!!!
Re:Boehm-Demers-Weiser conservative C/C++ Garbage Collector by pcwalton on Sunday January 21, 2024 @01:36PM (#39081310)
Fascinating, thank you!

(I completely forgot I wrote that and also I'm mildly embarrassed at how I used to write back then.) :)