4 ms·
I’m curious when not allocating things dynamically, does that just get around all memory safety (other than temporal with array bounds checking). Essentially a
by mr_00ff00 4y ago
I’m curious when not allocating things dynamically, does that just get around all memory safety (other than temporal with array bounds checking).
Essentially any language that does array bounds checking would be as safe as rust? Or am I missing anything?
C does not technically do that, so rust is still safer. But zig would be the same in the embedded space as rust? Or is there anything I am missing?
- pdimitar 4y agoRust's compiler also makes sure you never modify a place in memory from more than one place.
- mr_00ff00 4y agoThat’s true, but that would be fairly trivial to do in a C program with only stack variables. Just always have only 1 mutable reference. Something like C++ or Zig could enforce those rules even more easily.
- pdimitar 4y agoYeah, I don't disagree. Shame they never went direction and instead were like "REAL MEN DON'T PROTECT AGAINST BUGS! WE DON'T WRITE BUGS!". But oh well. That's why we have the more modern languages these days.