Live data from Hacker News

rg3d: Rust 3D game engine with an FPS demo game and scene editor

github.com

101–110 of 143 posts

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#101
post #59

Earlier quoted context omitted.

Using C alongside static analysis like Frama-C is also quite safe, one could say.

Frama-C's analysis is neither sound nor complete and it's way way harder to set up and use than Rust.

As someone that has enough C and C++ experience going back to 1992, worked at CERN and Nokia in very complicated C++ codebases and still has issues with the borrow checker and when to annotate what, I beg to differ how easy it is to use Rust, although I do conceed it has gotten much better.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#102
post #49

Quite cool! This is the kind of stuff that might drive adoption among game devs.

I doubt projects like this would help. For big developers, 99.99% of the time they are already riding on existing codebases (even when they call it by different names for marketing reasons) - the last two AAA games i worked at have codebases more than a decade old, one actually two decades old. While technically they could add rust as an extra language, in practice this wont happen both because the vast majority of g…

You are seeing this from the wrong perspective, and yes although I do like Rust very much, C++ is my native tool alongside the managed languages I regularly use (reasons for other time).

Since the Assembly days it has been like this, some high level language keeps being disdained until it gets enough momentum for adoption by game developers.

Back when I started coding graphics, Basic, Pascal, Modula-2 and C were seen as the Unity for home computers, good enough for simple games, but professionals were only using Assembly.

Professionals with deep pockets would eventually manage to buy an UNIX or VMS based computer, make use of C or BLISS and cross-compile to arcade machines and 8 home computers.

While on 16 bit home computers, C, Pascal with lots of inline assembly started gaining adoption, but no one in perfect mind would make use of either C++ or Object Pascal (even with MPW most Apple games were coded in Assembly).

With Windows, OS/2, BeOS, Watcom C++ with DOS/4GW, Pentium/Abrash books, Sony Playstation C++ SDK, C++ finally started to get enough industry support to be taken seriously .

Same with Java and C# adoption, while not at the same level as C++, they have found their way as programming languages to write engine tools, or be the scripting language on top of the performance critical C++ code. Also here it was a long path to adoption driven by J2ME ecosystem, Sun's JavaGamming failed efforts, Java3D, Android, Visualization industry (JViews, VTK), while C# had initially indies writing their own C++/CLI bindings to DirectX, followed by Managed DirectX, XNA (specially it being a must have on WindowsPhone 7), MonoGame, Unity, UWP/HoloLens.

So Rust is still at the begining of this long road, if enough engines like this start poping up, eventually some well known studios or platform owners will pay attention and give it a place at the table. Microsoft is already prototyping with Rust/WinRT, who knows what plans they have for it.

As for D, the community is great, but they don't push a proper roadmap for the language and all the cool features that D might have offered 10 years ago, have slowly been added to .NET, Java and C++, additionally Swift, Rust, Go, Kotlin/Native, Nim, Zig also arrived to the party of AOT compiled languages with low level capabilities.

When one wants to go everywhere, and discusses where to go next at each crossing, it is impossible to reach the momentum we are discussing here.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#103

Earlier quoted context omitted.

I doubt projects like this would help. For big developers, 99.99% of the time they are already riding on existing codebases (even when they call it by different names for marketing reasons) - the last two AAA games i worked at have codebases more than a decade old, one actually two decades old. While technically they could add rust as an extra language, in practice this wont happen both because the vast majority of g…

How would it not help? Someone might see this and realize that Rust is a viable game dev option and adopt it for their next game. In my experience, Rust is relatively fast on recompilation, possibly faster than C++. Rust is a much younger language so you have to wait.

Rust build times are definitly slower than C++ ones, specially when compared against Windows compilers.

However I do conceed that some of it comes down to workflow and out of the box experience (no customizations).

In C++ the only code I compile from source is my own, all third party dependencies are available as binaries.

Then not only do I do incremental compilation, Visual C++ also does incremental linking, and I do take the effort of using external templates for common types.

And modules are just aroud the corner.

C++ Builder also is quite fast, due to its Delphi like extensions, it offers a fast compilation mode for debugging workflows.

So while the compilation time for my Gtk-rs toy app has improved quite a lot during the last 3 years, the Gtkmm version of it still builds in a fraction of the time.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#104
post #101

Earlier quoted context omitted.

Frama-C's analysis is neither sound nor complete and it's way way harder to set up and use than Rust.

As someone that has enough C and C++ experience going back to 1992, worked at CERN and Nokia in very complicated C++ codebases and still has issues with the borrow checker and when to annotate what, I beg to differ how easy it is to use Rust, although I do conceed it has gotten much better.

I am well aware of your opinions on this matter. None of what you just said has anything to do with Frama-C. You can't throw that out there as a Rust alternative (which, as I noted, it is not, or at least not a complete one) and then compare how easy "vanilla C++" is compared to Rust (like I said, I disagree with you on that, but it's not even relevant here).

The truth is that for people who care about safety (as I know you and I do), want to use an unmanaged language (for whatever reason), and don't want to use Ada (no accounting for taste, I guess), the "correct" comparison is C and C++ with a load of static analysis tools that don't quite work, miss plenty of bugs, enable dynamic protection that slows down your program, are not easy to install, and can be terribly noisy when not configured extensively for your project... vs. Rust which works out of the box, has the analysis integrated into the typechecker, has a simple installation and upgrade process, and catches everything. In that competition, Rust wins every time.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#105
post #100

Earlier quoted context omitted.

It's also not nearly as prevalent as people from outside the ecosystem seem to think it is. I read a lot of "any non-trivial Rust code will have to use unsafe" and I guess that means that all of the code I've worked on is trivial.

The work being continuously done to improve the state of unsafe on crates.io proves otherwise. That is my point, people continue to use "C with Classes" because they don't know better or were poorly taught, likewise many reach out to unsafe as they cannot make it work otherwise and leave the code like that. In a world with a very thin standard library and an npm like dependency tree, every crate might be full of unsa…

Only about 1% of Rust code is unsafe. We can still expect that 1% to be just as full of memory safety bugs as C++, so it's obviously important to clean those crates up, but that's a pretty huge improvement. It's also much easier (actually tractable, in many cases) to completely review a dependency's uses of unsafe, compared to doing a thorough code review of an entire dependency as you would have to do in C or C++ to get the same guarantees.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#107
post #101

Earlier quoted context omitted.

As someone that has enough C and C++ experience going back to 1992, worked at CERN and Nokia in very complicated C++ codebases and still has issues with the borrow checker and when to annotate what, I beg to differ how easy it is to use Rust, although I do conceed it has gotten much better.

I am well aware of your opinions on this matter. None of what you just said has anything to do with Frama-C. You can't throw that out there as a Rust alternative (which, as I noted, it is not, or at least not a complete one) and then compare how easy "vanilla C++" is compared to Rust (like I said, I disagree with you on that, but it's not even relevant here). The truth is that for people who care about safety (as I k…

Almost fully agree, just the ergonomics are fully there and while static analysis tools aren't fully there, nor ever will, as you well point out, the likes of Google and Microsoft seem quite minded to bring Rust into C++, despite their ongoing adoption of Rust.

As the latest posts from Visual C++ seem to imply,

https://devblogs.microsoft.com/cppblog/new-safety-rules-in-c...

https://cppcon2020.sched.com/event/e7C0/introducing-microsof...

Because the language alone isn't enough, the existing eco-system and tooling also plays a big role.

Since we are speaking about games here, C++ just hit the jackpot with GPGPU programming, even though other languages are also supported in PTX and SPIR-V.

So I am actually curious how far the companies with seat at ISO C++ are actually going to adopt Rust on their platforms, versus briging Rust learnings into C++.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#108
post #81
post #73

Earlier quoted context omitted.

C++ has structured destruction now.

Structured bindings work for simple cases, but Rust's are much simpler and more powerful.

Until ISO C++23 papers for pattern matching get accepted.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#109
post #53
post #30

Earlier quoted context omitted.

I don't see why Rust would be cleaner than modern C++ codebase.

C++ is incredibly verbose (STL) and carries a lot of baggage and mental overhead. Rust has improved ergonomics in nearly every area except lifetime handling, which is a concern you want to think about and make explicit. I predict in ten years the gravitas for new projects will have shifted entirely to Rust. C++ is just too much of a burden to write and verify. C++ will still have plenty of healthy projects, but I thi…

For that to really take off, the OS SDKs need to give tier 1 support to Rust.

If Apple, Google, Sony, Nintendo and Microsoft do that, instead of the internal projects where they use Rust today, then it might happen.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#110

This project is what I would call data oriented, as discussed yesterday on hn https://news.ycombinator.com/item?id=24506744 . It takes some parts of ECS but the UI is OOP-ish. I wonder if there is a good ECS UI architecture. I have been exploring this lately in Rust, and right now I have settled on jquery style selectors (don't laugh) where you have a generic entity builder and associate a selector (id + class list)…

ECS is also OOP.

I guess someone needs to provide examples in Objective-C, Eiffel and CLOS to settle it up.

Post reply on HN