this post was submitted on 27 Apr 2024
2 points (100.0% liked)

Rust

5915 readers
56 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
 

This was a really good summary of what Rust feels like in my opinion. I'm still a beginner myself but I recognize what this article is saying very much.

The hacker news comments are as usual very good too:

https://news.ycombinator.com/item?id=40172033

top 14 comments
sorted by: hot top controversial new old
[–] BB_C@programming.dev 1 points 6 months ago

The hacker news comments are as usual very good too

lol

[–] Meansalladknifehands@lemm.ee 1 points 5 months ago

I'm only saying this because I've seen this posted on several boards , and there's to much negative attitude towards the blogger.

I don't understand people being defensive, it's not like the author hates rust, as a matter of fact he loves rust and chose to write a game in it for 3 years. He's just sharing his experience with the language, and some one might find it useful, even the language devs might appreciate feedback from the community.

How is the language going to improve, if all we do I show hostility towards those who critiques some parts of the language, it's going to be C++ all over again, if people stop doing that because being afraid of getting community backlash. The elitist attitude isn't helpful and has never been.

[–] tatterdemalion@programming.dev 0 points 6 months ago* (last edited 6 months ago) (1 children)

So... dev blames skill issues on language? Classic.

EDIT: For the record, I'm not saying the author is bad at Rust. I'm saying they're bad at making games and balancing tradeoffs. They keep saying that they don't like rust because they just want to worry about making a game, not fighting the language. And yet, they seem to continually make decisions that favor performance over ergonomics. Then they whine about how the Rust community is supposedly pressuring them to make bad decisions.

[–] FizzyOrange@programming.dev 1 points 6 months ago (1 children)

Ha they literally said about 5 times in this page that people often say "it's just a skill issue"... and here you are.

I love Rust but the author's points are 100% valid.

[–] anlumo@feddit.de 0 points 6 months ago

OP is talking about a different kind of skill issue than the article. The article is about skill issues in writing Rust code, while OP is about skill issues in choosing the right technology for the right task.

Not picking Rust for code that has to be prototyped quickly and iterated a lot is kinda obvious. The solution would be to use Rust for the core engine where the requirements are clear and something else (lua? Python?) for the gameplay code. Even the engine the author wants to switch to does the same with with the divide between C++ and C#.

[–] magic_lobster_party@kbin.run 0 points 6 months ago (1 children)

By this article it sounds like Rust is a case of “perfect is the enemy of good”.

[–] sus@programming.dev 0 points 6 months ago* (last edited 6 months ago) (1 children)

eh, I'd say rust's problem is more that it's marketed as a general-purpose language, when in reality it is rare for software to need a language that is both very highly performant and memory safe, and rust makes heavy sacrifices in terms of complexity to achieve that. Most popular languages are garbage collected which can cause performance problems, but makes code much simpler to read and write.

[–] sugar_in_your_tea@sh.itjust.works 0 points 6 months ago (1 children)

I don't think there's a problem whatsoever. Rust just isn't a great choice for projects that need to iterate quickly. People online claiming that's not the case doesn't change that fact.

If you need fast iteration time and can sacrifice memory safety, use a scripting language. I like using Lua within Rust for this reason, I can iterate quickly and move expensive logic that's not going to change much to a Rust lib.

OP should've known this, they had experience already writing games, they just ignored the truth because some neck beards told them to. It's okay to ignore people on the Internet when they're wrong.

[–] crispy_kilt@feddit.de 0 points 6 months ago (1 children)

Sounds to me like people are using the term "iterate quickly" to really mean "we don't understand the problem space and we have little usable requirements"

I agree, for "exploratory programming" Rust takes more time. To hack out quick prototypes I'd use Python.

[–] sugar_in_your_tea@sh.itjust.works 0 points 6 months ago (1 children)

And in game dev, a lot of what you're doing is exploratory:

  • not sure what heuristic to use for pathfinding
  • balancing game mechanics
  • tuning enemy AI
  • tweaking shaders

Requiring a rebuild for each of those would take too much time.

[–] crispy_kilt@feddit.de 0 points 6 months ago

Makes sense! I must admit I have zero experience in that area.

[–] farcaster@lemmy.world -1 points 6 months ago* (last edited 6 months ago) (1 children)

TLDR: "I picked a systems programming language to write and iterate on a bunch of gameplay scripting. Why does Rust not meet the needs of a gameplay scripting language like <every link in the article which either refers to dedicated game-programming scripting languages, or Unity which is whole goddamn commercial game engine>. Hmm yes, the problem must lie with Rust, not with the choices I made in my project."

Just try to write a complete game with nothing but open source libraries in C++, or C#, or Java. Good luck with that. The author is switching to Unity for a very good reason. It turns out a commercial product made by 6000 people delivers value...

You use a systems programming language to write your engine. And then a scripting language to write your game. Everybody in gamedev knows this, I thought.

[–] Phoenix3875@lemmy.world 0 points 6 months ago (1 children)

It's not that the author picked Rust for scripting. All Rust game engines (e.g. Bevy) use Rust as the scripting language.

Compare this with Godot, which is implemented in C++, but supports GDScript and many other languages for scripting.

Also, only supporting Rust is not considered a limitation, but a feature here. Bevy's ECS is tied up with Rust's trait system, therefore it's impossible to use a different language.

So if Rust as a system programming language should not be used for game scripting, then projects like Bevy are fundamentally flawed. The author is willing to go there, but I don't know if many people would go that far.

There could be a Godot-like engine written in Rust that supports easier scripting languages, but I think that space is not explored due to the fact that Godot already exists.

[–] anlumo@feddit.de 0 points 6 months ago

Bevy's ECS is tied up with Rust's trait system, therefore it's impossible to use a different language.

Bevy has added runtime-defined systems and components to enable scripting integration in recent updates.