3 ms·
Silly question: Let's say someone designed a C program that leaks memory for example in some unique way. Would RUST do the same? Would it happily auto transla
by iberator 1y ago
Silly question:
Let's say someone designed a C program that leaks memory for example in some unique way.
Would RUST do the same? Would it happily auto translate erroneous code too?
- correct_horse 1y agoSafe rust can leak memory, so a better question is "If someone wrote C code that made an invalid read or write, would rust do the same?" I can't answer the question, but ideally if the translated was safe, it would somehow eliminate the bug while keeping the desired behavior. That scenario seems a bit too optimistic though, so probably it'll have an unsafe block that does the invalid read/write and a human can come in and add runtime checks or refactor it further.