alt.hn

2/21/2026 at 3:52:20 PM

Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust

https://github.com/Ragnaroek/iron-wolf

by ragnaroekX

2/21/2026 at 8:14:47 PM

Was this translated automatically from C? I picked a spot totally at random and saw in https://github.com/Ragnaroek/iron-wolf/blob/main/src/act1.rs in place_item_type:

    let mut found_info = None;
    for info in &STAT_INFO {
        if info.kind == item_type {
            found_info = Some(info);
            break;
        }
    }
When typically in rust this is just:

    let found_info = STAT_INFO.iter().find(|info| info.kind() == item_type);
Now I want to go through and feng shui all the code to look more like idiomatic rust just to waste some time on a saturday...

by ninkendo

2/22/2026 at 3:15:47 AM

(equivalent C file: https://github.com/id-Software/wolf3d/blob/master/WOLFSRC/WL... )

> Was this translated automatically from C?

I'll note that when I convert code between languages, I often go out of my way to minimize on-the-fly refactoring, instead relying on a much more mechanical, 1:1 style. The result might not be idiomatic in the target language, but the bugs tend to be a bit fewer and shallower, and it assists with debugging the unfamiliar code when there are bugs - careful side-by-side comparison will make the mistakes clear even when I don't actually yet grok what the code is doing.

That's not to say that the code should be left in such a state permanently, but I'll note there's significantly more changes in function structure than I'd personally put into an initial C-to-Rust rewrite.

The author of this rewrite appears to be taking a different approach, understanding the codebase in detail and porting it bit by bit, refactoring at least some along the way. Here's the commit that introduced that fn, doesn't look like automatic translation to me: https://github.com/Ragnaroek/iron-wolf/commit/9014fcd6eb7b10...

by MaulingMonkey

2/22/2026 at 4:27:34 PM

I actually find 1:1 to be helpful when learning a language.

How debug-able is the internals of the rust lambda version?

I will often write the code so I can simply insert a break point for debugging versus pure anonymous and flow-style functions.

C# example:

    #if DEBUG
    const string TestPoint = "xxxx";
    #endif

    var filtered = items.Where(x =>
    {
        #if DEBUG
        if (x.Name == TestPoint)
            x.ToString()
        #endif
        .....
    });
vs

    var filtered = items.Where(x => ....);

by yndoendo

2/21/2026 at 9:03:58 PM

As a non-Rust guy, I keep writing the example above. I didn't even know about the second option!

If you do that, please share a link so I can learn from you! This is awesome!

by klaussilveira

2/22/2026 at 4:36:28 AM

Look into rust iterators and their associated functions for rust specific implementation. Additionally look into functional programming à la lambda calculus and Haskell for the extreme end of this type of programming if you’d like to learn more about it

by DauntingPear7

2/21/2026 at 9:48:07 PM

Yes, the code is _very, very_ close to the C-Code. All over the place.

by ragnaroekX

2/21/2026 at 9:10:10 PM

Sounds like something an LLM agent might be good at?

by derwiki

2/22/2026 at 7:55:13 AM

It probably would. But this port was mostly done to understand Wolfenstein 3D in detail, not for the source port itself. I could have generated big parts of the code. But I would have learning by doing that.

by ragnaroekX

2/21/2026 at 5:28:07 PM

Wolfenstein is peanuts compared to writing your own doubly linked list.

by amelius

2/23/2026 at 3:51:18 AM

Not sure about that, but these are an awesome tutorials on linked list and related exercise problems [1],[2].

It's an old website for C programming from Stanford Uni by Nick Parlante [3].

For full blown treatment on linked list and doubly linked list please check this an excellent book Pointers on C by Kenneth Reek (1998) [4].

[1] Linked List Basics

http://cslibrary.stanford.edu/103/

[2] Linked List Problems:

http://cslibrary.stanford.edu/105/

[3] Essential C:

http://cslibrary.stanford.edu/101/

[4] Pointers on C:

https://archive.org/details/pointersonc0000reek

by teleforce

2/21/2026 at 7:01:46 PM

This is cool! Wolfenstein will always have a place in my heart.

You should add it to https://hnarcade.com

by yuppiepuppie

2/21/2026 at 8:25:32 PM

Cool! I did an incomplete version in Rust a while back as well. Not a source port, tried to recreate the game from scratch myself, without looking at the C src code

https://github.com/hamzaq2000/wolf3d-reimpl-rs

by hamza_q_

2/21/2026 at 6:25:29 PM

Game would be considered too politically incendiary if released today.

by xeonmc

2/21/2026 at 7:28:55 PM

Wolfenstein 3D was pretty squarely a WWII fantasy shooter. Only later does it get into the alternate history post-war stuff which does get somewhat more squarely political.

I think it cuts both ways. The Wolfenstein franchise has obviously relished in violence against Nazis, but also inadvertently is part of the trend of glorifying them.

by legitster

2/21/2026 at 8:13:34 PM

The first game has zombies with guns in their chest and a mecha hitler.

by TehCorwiz

2/21/2026 at 10:59:11 PM

Someone's not up to date on the History Channel documentaries about WWII!

by bombcar

2/22/2026 at 1:08:01 PM

Stein means rock. Wolfenstein is something like Wolf’s rock.

Eisen means Iron. You could name it Wolfeneisen?

by karhuton

2/22/2026 at 12:38:55 AM

Oh man for a second i though ironwolf, the vr game, was about to see some love.

by Grimblewald

2/21/2026 at 4:34:15 PM

Nice job. Couple notes for the web version:

- Once started the shareware game on Chromium browsers seems to flicker like crazy which displays the "B.J. Blazkowicz" face.

- You missed adding the classic code that everyone knows, M-L-I!

by vunderba

2/21/2026 at 5:21:13 PM

The flickering happens in Firefox too.

by Freak_NL

2/22/2026 at 7:53:47 AM

Flickering is fixed now. It was introduced with the late feature of animating BJ face on the start...

by ragnaroekX

2/21/2026 at 11:26:30 PM

is it faster than original?

Port it to 286, and then claim RUST victory

by iberator

2/21/2026 at 6:44:17 PM

Sweet memories...

by beemboy

2/21/2026 at 7:16:12 PM

again?

by hexo