this post was submitted on 27 Apr 2024
105 points (96.5% liked)

Rust

6142 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 2 years 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

you are viewing a single comment's thread
view the rest of the comments
[–] sus@programming.dev 12 points 8 months ago* (last edited 8 months ago) (2 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.

[–] farcaster@lemmy.world 5 points 8 months ago (1 children)

It is a general purpose language for me. I wrote lots of little (or not so little) scripts in Rust. I wrote high performance GPU kernels in Rust. I wrote web services in Rust. It's less hard to read and write Rust than is often claimed. Imo.

[–] sus@programming.dev 2 points 8 months ago (1 children)

You can, of course. And if you're good enough at it, and focus on keeping it simple, you can keep the complexity down to a minimum, at least with most straightforward programs.

Buut you can say the same about other complicated languages like c++. And things like writing quick "shell script" type things are going to be pretty simple in almost every decent language. Even if the result is slightly more verbose it won't really matter.

[–] farcaster@lemmy.world 4 points 8 months ago (1 children)

For me the biggest difference between Rust and C++, for things like scripting, is cargo. Being able to just add an awesome parser, or support for a particular file-format, to my "script" with a single line in cargo.toml is awesome. In this particular way cargo is better than Python even. The amount of time spent on acquiring, setting up, and linking libraries in other languages cannot be understated.

[–] sus@programming.dev 3 points 8 months ago

yeah rust along other new languages takes package management (and some other "hard learned lessons") seriously, which gives it an advantage over most older languages (and it's ahead other newer languages in that there is a serious amount of adoption for rust.. a package manager that has no packages to manage is not very useful)

[–] sugar_in_your_tea@sh.itjust.works 0 points 8 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 2 points 8 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 2 points 8 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 1 points 8 months ago (1 children)

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

I'm just a hobbyist myself as well, but i've talked to actual professionals in the field, so i'm pretty sure that's general wisdom.