Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores

r/rust

members
online

Hey Rustaceans! Got a question? Ask here (21/2024)!
MOD

Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The official Rust Programming Language Discord: https://discord.gg/rust-lang

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.



"What software shouldn't you write in Rust?" - a recap and follow-up "What software shouldn't you write in Rust?" - a recap and follow-up
🎙️ discussion

yesterday this post by u/Thereareways had a lot of traffic, and I think it deserves a part 2:

I have read through all 243 comments and gained a whole new perspective on rust in the process. I think the one key point, which was touched on in a lot of comments, but IMO never sufficiently isolated, is this: Rust is bad at imperfection.

Code quality (rigor, correctness, efficiency, speed, etc) always comes at the cost of time/effort. The better you want your code to be, the more time/effort you need to invest. And the closer to perfection you get, the more it takes to push even further. That much should be pretty agreeable, regardless of the language. One might argue that Rust has a much better "quality-per-time/effort" curve than other languages (whether this is actually true is beside the point), but it also has a much higher minimum that needs to be reached to get anything to work at all. And if that minimum is already more than what you want/need, then rust becomes counter-productive. It doesn't matter whether its because your time is limited, your requirements dynamic, your skills lacking, just plain laziness, or whatever other reason might have for aiming low, it remains fact that, in a scenario like this, rust forces you to do more than you want to, and more importantly: would have to in other languages.

There were also plenty of comments going in the direction of "don't use rust in an environment that is already biased towards another language" (again, that bias can be anything, like your team being particularly proficient in a certain language/paradigm, or having to interface with existing code, etc). While obviously being very valid points, they're equally applicable to any other language, and thus (at least IMO) not very relevant.

Another very common argument was lots of variations of "its just not there yet". Be it UI libraries, wasm DOM access, machine learning, or any other of the many examples that were given. These too are absolutely valid, but again not as relevant, because they're only temporary. The libraries will evolve, wasm will eventually get DOM access, and the shortcomings will decline with time.

The first point however will never change, because Rust is designed to be so. Lots of clean code principles being enforced simply via language design is a feature, and probably THE reason why I love this language so much. It tickles my perfectionism in just the right way. But it's not a universally good feature, and it shouldn't be, because perfection isn't always practical.