News for hackers. Stuff that matters.
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by ninkendo on Saturday February 21, 2026 @03:14PM (#47104236)
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...
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by klaussilveira on Saturday February 21, 2026 @04:03PM (#47104731)
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!

Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by DauntingPear7 on Saturday February 21, 2026 @11:36PM (#47108212)
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
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by derwiki on Saturday February 21, 2026 @04:10PM (#47104794)
Sounds like something an LLM agent might be good at?
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by ragnaroekX on Sunday February 22, 2026 @02:55AM (#47109190)
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.
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by ragnaroekX on Saturday February 21, 2026 @04:48PM (#47105165)
Yes, the code is _very, very_ close to the C-Code. All over the place.
Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by MaulingMonkey on Saturday February 21, 2026 @10:15PM (#47107765)
(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...

Re:Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust by yndoendo on Sunday February 22, 2026 @11:27AM (#47112319)
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 => ....);