3 ms·
I guess I'm using "memory safety" very broadly and not literally, which I admit is not good. But, the borrow-checker seems to be significantly safer than anyth
by VikingCoder 4y ago
I guess I'm using "memory safety" very broadly and not literally, which I admit is not good.
But, the borrow-checker seems to be significantly safer than anything else I've read about. Having no null pointer sounds very smart...
- andai 4y agoFair enough. I think Rust is the only language on that list which solves the "billion dollar mistake" (null pointers).
- kaba0 4y agoNull pointers are not a memory safety issue in most managed languages. It is completely well-defined behavior in Java for example, you can safely catch any NPE and go on as if nothing happened. This is not true of C, where dereferencing a nullptr is incredibly unsafe.
- 3a2d29 4y agoExcept Rust can still have serious memory safety errors like double-frees and memory leaks. All those other languages cannot. Rust is much less safe than a GC language in terms of memory.
- VikingCoder 4y agoC# cannot have a memory leak? We're using very different definitions of those words, I guess. https://slashdot.org/story/07/11/17/0552247/c-memory-leak-torpedoed-princetons-darpa-chances https://slashdot.org/story/07/11/17/0552247/c-memory-leak-to...
- 3a2d29 4y agoC# allows you to tune the GC, which I believe was the cause of that issue. Keep in mind by turning off the GC, how have now made C# just as safe as rust, not unsafer.
- VikingCoder 4y agoI think that one was actually circular references in event handlers...
- 3a2d29 4y agoI don’t think so, but I can’t find the answer. Either way, rust 100% does that. Way easier in C# to avoid that issue. Just don’t use reference counters and use GC. No way to avoid that in Rust. If you need many references, you must use ARC.