4 ms·
I'm obviously not the author, but I can think of a good reason not to use rust. The project works exactly as the original and recreates the memory state byte f
by mrfredward 7y ago
I'm obviously not the author, but I can think of a good reason not to use rust.
The project works exactly as the original and recreates the memory state byte for byte, so like the original it has different tasks running at once that are reading and writing to shared memory. Rust's borrow check exists to prevent this sort of thing, because it is so hard to do it correctly or prove it is correct once you have done it. So to use rust, the author would have needed to either totally re-architect Space Invaders, or write the whole thing in ugly, non-idiomatic rust.
Rust simply doesn't let you do the things assembly and C programmers did all the time in 1978 (and with the complexity of our software now and the extra computing power, that's usually for the better). C, on the other hand, has at times been described as "portable assembly," which makes it a good choice for someone wanting to stay true to the original program flow.
- loadzero 7y agoThis is a good answer, and does reflect a good chunk of the reason for picking C. Dealing with such low level tasks is what the language was made for. The other big reason I used C, is that it is more of a lingua franca than something more modern, and will make the code more accessible to a wider audience.
- pcwalton 7y ago> Rust simply doesn't let you do the things assembly and C programmers did all the time in 1978 (and with the complexity of our software now and the extra computing power, that's usually for the better). Rust does let you do those things. You could run this repo through c2rust and get a working Rust program. It'll be ugly Rust code, though.