Hacker News new | ask | show | jobs
by quelsolaar 871 days ago
Provenance In C and Rust, essentially mean that each object, lives in its own memory space, and you cant travel between them. You cant use a pointer to one object, add an offset and get a valid pointer to another object.

This is key to a lot of compiler optimizations. It is de facto in C compilers, and therefor in a lot of compiler infrastructure used by other languages. There is an attempt to make it more clearly defined in the C standard:

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3005.pdf

1 comments

It's not just per-object. When you consider things like `restrict` pointers in C, and the aliasing model in Rust (e.g. Stacked Borrows), you have provenance distinctions even within a single allocated object.