Hacker News new | ask | show | jobs
by iberator 263 days 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?

1 comments

Safe 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.