Live data from Hacker News

Leaving Rust gamedev after 3 years

loglog.games

791–800 of 996 posts

Re: Leaving Rust gamedev after 3 years

#791

As a game developer for about two decades, I've never considered Rust to be a good programming language choice. My priorities are reasonable performances and the fastest iteration time possible. Gameplay code should be flexible, we have tons and tons of edge cases _by design_ because this is the best way to create interesting games. Compilation time is very important, but also a flexible enough programming structure,…

> Also, ECS is, IMHO, a useful pattern for some systems, but it is a pain in the butt to use with gameplay or UI code.

I'd love to see a language built around ECS. I wonder how nice it can be in a language syntax where ECS is the easiest thing you can do.

Re: Leaving Rust gamedev after 3 years

#792
post #714

Earlier quoted context omitted.

When is Java getting value types? It has been talked about forever now.

And it will still take time to come, the whole engineering problem is how to introduce value types, make classes that are clearly value types like Optional, turn into value types, while at the same time not breaking the endless amount of JAR files in production, when upgrading to a JVM with value types support enabled. They would get it sooner by breaking the ecosystem, and as Python 3, Java 9, .NET Core have shown,…

As a java dev, please break backwards compatibility. Almost all of us are willing to spend time fixing a few lines and recompiling.

Re: Leaving Rust gamedev after 3 years

#793
post #358

Earlier quoted context omitted.

> My impression is that this is due to their non-robust programming style. It's been 50+ years. I don't think that it's worthwhile just telling the programmer to do a better job. > They do not add fallback behavior when e.g. receiving a null object. It would still be a bug, but could be a log entry instead of crash. This is a pretty big feedback loop: * The programmer puts the null into the code * The code is release…

50+ years and people still fail to grasp this. You have to put something (an optional, or a default constructed object in a useless state) and all you did was to skip the null check. In case of optional, you introduced a stack rewind or a panic. Everything else stayed the same. Maybe that default even deleted the hard drive instead of crashing. Coding is hard. "just don't code" is not the answer. You can avoid someth…

> You have to put something (an optional, or a default constructed object in a useless state)

No, you really don't. There is no default number, no default string, no default piece of legislation, no default function.

Re: Leaving Rust gamedev after 3 years

#794

Earlier quoted context omitted.

As a non-game dev who uses Rust and Elixir, Rust wouldn't be my first pick for a large gamedev studio for multiple reasons. As for alternatives worth evaluating: Crystal, Cython (compiled Python), or Nim could result in increased gamedev productivity over C++ or C#. Maybe even Go because the iteration and compile times are very fast, and the learning curve is very low.

Does Crystal support Hot Reloading? The slow compilation speed is a non-starter for me.

Crystal doesn't support parallelism[1], which is a dealbreaker in this context (and for performance sensitive programs in general).

[1]=production grade; additionally, it seems that no work has been done on it for years.

Re: Leaving Rust gamedev after 3 years

#795
post #19

As much as I love Rust I sometimes wonder if I'd be more productive in a simpler language. If I wrote it every day I'm not sure that would be true, but as a hobbyist coming back to Rust sometimes takes me a bit to get back in the zone. Also, still not a fan of async, as it is woefully incomplete and fairly complicated in some use cases. That said, I just can't go back to Go with nil pointers and lack of decent enums/…

Yeah I long for a language that has rust enums and pattern matching but none of the async or borrow checker.

Maybe I should just unsafe rust and see how I go....

Re: Leaving Rust gamedev after 3 years

#796
post #507

Earlier quoted context omitted.

Sony requires that you use their tooling, which you can only get under NDA.

If there was significant pressure from developers Sony would allow Rust. I doubt there is any.

It's a catch 22 - you can't deploy Rust so no one uses Rust for anything, no one uses Rust for anything so there is no reason for Sony to work on Rust deployment.

I think it would be a really good fit for certain parts of the engine - serialization code especially. We have massively complicated C++ code parsing network packets and all sorts of similar sketchy things, always scares me when I see it.

Re: Leaving Rust gamedev after 3 years

#797
post #13
post #6

> Making a fun & interesting games is about rapid prototyping and iteration, Rust's values are everything but that I feel like this is the core of the author's frustration. Rust is a systems language. It's for writing tight fast C-like code but safely and with a much more powerful type system. The facilities you need to do this are somewhat at odds with what you want for rapid iteration. Seems like Rust was the wrong…

Yeah, I rather like the pattern of embedding a more rapid iteration scripting language on top for game stuff like Lua or stripped down Python variants, using Rust as the core and hot loop code. That said, there is a lot of folks wanting to do it all in Rust, and the article touches pretty well on that not being the pleasant case for a lot of valid gamedev approaches.

Lua is often used for this in gaming.

Re: Leaving Rust gamedev after 3 years

#798
post #782

Earlier quoted context omitted.

> stdlib changes is what most of "modern C++" is about). the last good version was basically C++11. I can only comment this like: tell me you have no idea about current state of C++ without telling me you have no idea about current state of C++.

Then let's hear some counter examples please. As far as I'm aware the last important language change since C++11 was designated init in C++20, and that's been butchered so much compared to C99 that it is essentially useless for real world code.

There a whole bunch of features and fixes that each new version of the standard proclaimed, which severely affected usability, expressibility and convenience of the language. Describing many of them could easily take an hour. I'm sorry, I can only highlight a few of my particular favourites that I regularly use and let you study the rest changes.

https://en.cppreference.com/w/cpp/14

- fixed constexpr, which in C++11 was basically unusable

- great improvements for metaprogramming, which made such gems as `boost::hana` possible, such as variable templates and generic lambdas.

- function return type deduction

https://en.cppreference.com/w/cpp/17

- inline variables finally fixes the biggest pain of developing header-only libraries

- useful noexcept fix

- if constexpr + constexpr lambdas

- structured bindings

- guaranteed copy elision

- fold expressions

I'm at automotive where due to safety requirements we just barely started to work with C++17, so I don't have much practical experience of the standards past it, though I'm aware there are great updates too. Overall - C++11 is as horrible compared to C++17, as C++98 and roughly 03 were compared to ground breaking back then C++11. Personally, when I skim though job vacancies and see they are stuck at C++11, I pass it. Even C++14 makes me very sceptical, even though I used it really a lot. All due to new nice improvements of C++17.

https://en.cppreference.com/w/cpp/20

https://en.cppreference.com/w/cpp/23

Re: Leaving Rust gamedev after 3 years

#799
This is a fantastic article.

Personally, I found using Godot with some parts in Rust via gdext quite enjoyable.

You can avoid dealing with GDScript for important parts of the code and have access to OS threads if you want them, etc. - but can also prototype features in GDScript and write the UI, etc. there for fast testing, and keep a good separation of UI and graphics presentation vs. the actual game logic.

Re: Leaving Rust gamedev after 3 years

#800
post #792
post #714

Earlier quoted context omitted.

And it will still take time to come, the whole engineering problem is how to introduce value types, make classes that are clearly value types like Optional, turn into value types, while at the same time not breaking the endless amount of JAR files in production, when upgrading to a JVM with value types support enabled. They would get it sooner by breaking the ecosystem, and as Python 3, Java 9, .NET Core have shown,…

As a java dev, please break backwards compatibility. Almost all of us are willing to spend time fixing a few lines and recompiling.

As polyglot dev that also does Java, I hope not, last January I deployed yet another Java 8 workload into production.
Post reply on HN