Pretty massive effort today to actually rustify the Doom rust code a bit more - most of this was restricting access to raw pointers by putting them behind a typical ref/mut set of functions.

This highlighted lots of problem areas real quick and since rust is so damned good with errors and info (seriously, massive selling point) it was trivial to refactor everything.

By trivial I mean:

30 files changed, 1035 insertions(+), 947 deletions(-)

in approx 2 hours of work.

In C/C++? Fuck no!

It is really difficult to state how much power rust gives you to refactor a codebase without worry becuase it *helps* you so much. And when it's done, it works.

I would have lost days to this in C or C++ (and I have, if not weeks), and still probably would have had UB somewhere.

Follow

((Doom is a mess of intertwined pointers, casts relying on a specific struct layout, and this rust rewrite is a transliteration first and where possible, then rustify later))

Sign in to participate in the conversation
Gamedev Mastodon

Mastodon server focused on game development and related topics.