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

Rust

5999 readers
4 users here now

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

Wormhole

[email protected]

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 50 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 6 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.

[–] [email protected] 0 points 6 months ago (1 children)

The hacker news comments are as usual very good too

lol

[–] [email protected] 0 points 6 months ago

Lols what... :) Maybe it's just me but I like them. :)

[–] [email protected] 0 points 6 months ago* (last edited 6 months ago) (3 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.

[–] [email protected] 0 points 6 months ago (3 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.

[–] [email protected] 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.

[–] [email protected] 0 points 6 months ago

It's also worth noting that before bevy, there was a rust game engine called Amethyst, which was planning on using a scripting language for gameplay code. Not having to use a scripting language, but getting to use rust instead, was one of the big selling points of Bevy overr Amethyst.

[–] [email protected] 0 points 6 months ago

Completely agree with all those points.

The author seems to be a enthusiastic coder and made several game engines in Rust. I'm not sure why they didn't hook up some hot-reloadable scripting to their engine, call it good, and build games. Probably less work than writing this very long article :)

Yeah I would probably not use Bevy either if the only option is to write all gameplay code in Rust. It doesn't seem like the best tool for the job.

[–] [email protected] 0 points 6 months ago (1 children)

As a software engineer who has worked in games, I disagree with you. Using a systems programming language like C, C++,Java or C# would all be much better for writing games from scratch than Rust. Rust really does have some unique issues. It's still a great language, just bad for quick iteration

[–] [email protected] 0 points 6 months ago* (last edited 6 months ago) (1 children)

I’ll grant C# is easier to iterate with. But C/C++, i don’t think so. You still have to carefully consider ownership with those, just like Rust, and refactoring can be laborious. Except with Rust once it compiles your code is probably correct, ownership-wise, which iterates considerably faster than running C++ code and getting segfaults (or data races)…

I helped ship multiple games. All of them used scripting languages, like Lua or in-house, for gameplay code. It makes sense for iteration.

Oh and C# and Java come at a cost, of course. It’s easy to write them, I’m a big fan of C#’s design, but its overuse is also how we ended up with so many relatively simple indie games which consume gigabytes of memory and constantly drop frames stalling for GC. Nothing is without tradeoffs.

[–] [email protected] 0 points 6 months ago

I agree with you about the tradeoffs that C# and Java make to gain ease of use at the cost of memory use. In a lot of cases that's a fine tradeoff. It doesn't matter much too me whether an indy game needs a little more memory. I'll also agree that C is going to be less safe than Rust (and Java, C#). But I still think it's an easy language to iterate in. It's a very simple language.

[–] [email protected] 0 points 6 months ago

Yup, that was my impression as well.

Write the part you're interested in, and find a solid project to handle the rest. If your want to write a game, use a popular game engine. If you want to write a game engine, use a popular scripting language to test it out. And so on.

load more comments
view more: next ›