3 ms·
I am still in awe that I could write an entire emulator in Rust without encountering heap corruption, use-after-frees or segfaults in host code (as opposed to g
by TazeTSchnitzel 4y ago
I am still in awe that I could write an entire emulator in Rust without encountering heap corruption, use-after-frees or segfaults in host code (as opposed to guest code, the code under emulation). It's a truly amazing language.
- zozbot234 4y ago> I am still in awe that I could write an entire emulator in Rust without encountering heap corruption, use-after-frees or segfaults in host code Or you could just write it in Java, which has been around since the 1990s. Even Go is memory safe if you don't touch concurrency.
- TazeTSchnitzel 4y agoJava makes it a lot more painful to interact with native code (which I have to do often), while offering much worse performance characteristics and no memory safety while doing so. I also wouldn't enjoy dealing with NullPointerExceptions all the time — not a memory safety issue, but also something Rust deals with better.
- goodpoint 4y agoNot to mention Ada.
- touisteur 4y agoFor an emulator, just go with SPARK :-) Ada didn't bring lots of memory safety until the recent work on ownership, but yes it's all getting there. If you have to manage registers, bitmasks, complex bit-precise data structures, and weird non power of 2 bit sizes or even specific bounds constraints, you'll be in paradise.