News for hackers. Stuff that matters.
Re:Tree Borrows by gronpi on Thursday July 10, 2025 @12:54AM (#44517331)
And TBAA is much easier for programmers to wrangle than the aliasing of Rust, right? The corresponding aliasing feature for C would be _restrict_, which is rarely used.

Though Linus and Linux turns off even strict aliasing/TBAA.

Re:Tree Borrows by simonask on Thursday July 10, 2025 @03:46AM (#44518406)
I don't think TBAA is easier to wrangle at all, or rather, it's almost never relevant except for allowing the compiler to make obviously, trivially true assumptions. Without it (all pointers could alias all the time), any C function taking more than one pointer argument would compile to a very surprising series of instructions, reloading from memory every single time any pointer is dereferenced.

Rust's rules are very simple and easy to get right - not least because breaking them is a compiler error.

Re:Tree Borrows by hamcocar on Thursday July 10, 2025 @04:08AM (#44518543)
Hmmm.

How is your comment consistent with some C compilers enabling users to disable TBAA/strict aliasing? Like the Linux kernel does. Do those codebases fit "compile to a very surprising series of instructions,"?