logoalt Hacker News

fookertoday at 11:47 AM1 replyview on HN

None of these have anything to do to do with memory layout or how data is formatted in the memory. You are arguing a different point than the one being discussed here.

These are fundamentally hacks around the compiler’s inability to understand ownership and lifetimes, at least the way Rust (and C++) are designed.

These exist in Rust because otherwise you would have to use unsafe blocks all the time to write any reasonable code.


Replies

timschmidttoday at 11:54 AM

Safe threading seems like fully exploiting hardware features to me. That's the biggest thing smart pointers and Rc, Arc, and Cell types enable. Perhaps I could have been clearer.

The comment about memory layout was an additional point that dealing with hardware requires that you format, align, and position information in memory as the hardware expects, which requires either exposing those details, or encoding them in a runtime.

show 1 reply