Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by iso8859-1 on Friday October 30, 2015 @06:08AM
(#10476970)
Do you think it would be possible to write the original game in mostly safe Rust with no performance hit?
[ Parent
| on HN ]
Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by lispit on Friday October 30, 2015 @07:58AM
(#10477272)
No perceptible performance hit on a modern machine? Absolutely. I'm sure you can run 100 copies of Doom simultaneously in Javascript or whatever.
No perceptible performance hit on a 486? Somehow, I don't think that the 486 is an especially important target for the LLVM or Rust developers (though such chips are used in embedded applications to this day).
But the real reason that the comparison makes no sense is that the bulk of the processing time (but not the bulk of the code, mind you) is spent in those tightly optimized assembly loops. Either you keep it as such and it's not really much of a battle between C and Rust any more, or you rewrite the critical sections in Rust and you'd lose as hard or more as if you wrote them in C.
Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by Gankro on Friday October 30, 2015 @09:26AM
(#10477609)
Weirdly the i586 is the problematic one. 3, 4, 6, 7, and 8 all apparently work fine.
https://users.rust-lang.org/t/i586-support-illegal-hardware-...
Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by ajross on Friday October 30, 2015 @11:34AM
(#10478430)
That bug just looks like a glitch with ISA support in the generated code. It's trivially fixable I'm sure, and not really relevant to the subject of optimized assembly.
Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by markild on Friday October 30, 2015 @06:27AM
(#10477037)
There would most definitely be a performance hit, but you would notice.
Re:Rust-Doom: A Doom renderer in Rust, with no unsafe code
by Dylan16807 on Friday October 30, 2015 @07:25AM
(#10477190)
Even if the new code made itself amenable to those nice vector units in modern CPUs?