Is Zig safer than Unsafe Rust? #119
Replies: 1 comment
-
Thanks for share. For the array example, I think the author's main idea is we cannot have another reference beside a mutable reference. let values: &mut [Value] = std::slice::from_raw_parts_mut(values, len);
// I can use the ergonomics of iterators!
for val in values.iter_mut() {
// ...
// Perform actions on each `val` of type &mut Value
val.0 += 1;
}
let values2: &mut [Value] = std::slice::from_raw_parts_mut(values, len); When we define |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is Zig safer than Unsafe Rust?
Recently, a hotly debated post trending on Reddit: When Zig is safer and faster than Rust. Although the title says Rust, it's actually comparing with Unsafe Rust. Based on that post, I’d like to discu
https://rustmagazine.org/issue-3/is-zig-safer-than-unsafe-rust/
Beta Was this translation helpful? Give feedback.
All reactions