News for hackers. Stuff that matters.
Re:Show HN: How to program in Rust as if it was old school C... by scotty79 on Tuesday December 20, 2022 @05:02PM (#34073331)
I wonder how much difference there would be if I used shared_ptr in C++ instead of the bare one.

EDIT:

As far as I can tell less than 190 lines of asm but I don't know shared_ptr enough to produce exactly the same code.

Re:Show HN: How to program in Rust as if it was old school C... by steveklabnik on Tuesday December 20, 2022 @05:45PM (#34073869)
Yeah, that gets closer for sure. refcell is still going to add a bit of state to the value inside of the allocation, but at least the shared_ptr and Rc/Arc bits are the same semantic, so it'll be closer!