Most active commenters
  • j-pb(4)

←back to thread

205 points michidk | 17 comments | | HN request time: 0.002s | source | bottom
Show context
dazzawazza ◴[] No.41835253[source]
Access to competant Rust developers can be a challenge even for large companies.

I recently finished a contract at a (very large game dev) company where some tools were written in Rust. The tools were a re-write of python scripts and added no new functionality but were slightly faster in Rust.

The reality was that these tools were unmaintainable by the rest of the company. Only the author "knew" Rust and it was hard to justify a new hire Rust developer to maintain this small set of tools.

The only reason these tools were written in Rust was because the dev wanted to learn Rust (a big but common mistake). I pointed out to the Technical Director that this was a big mistake and the teams had taken on a large amount of technical debt for no reason other than the ego of the wanna-be-rust-developer. Since I "knew" Rust he wanted me to maintain it. My advice was to go back to the Python scripts and I left.

replies(21): >>41835266 #>>41835268 #>>41835305 #>>41835386 #>>41835427 #>>41835460 #>>41835522 #>>41835570 #>>41835607 #>>41835745 #>>41835838 #>>41836318 #>>41836384 #>>41836673 #>>41836742 #>>41837344 #>>41839371 #>>41840322 #>>41840444 #>>41846616 #>>41848063 #
1. meindnoch ◴[] No.41835266[source]
>Only the author "knew" Rust [...] because the dev wanted to learn Rust

Many such cases. Recipe for disaster.

replies(2): >>41835352 #>>41835378 #
2. rob74 ◴[] No.41835352[source]
a.k.a. "resume-driven development"
replies(1): >>41835558 #
3. ahoka ◴[] No.41835378[source]
I think the rule of thumb should be that if you wouldn’t write aomething in C++, then you shouldn’t use Rust.
replies(2): >>41836000 #>>41846984 #
4. makeitdouble ◴[] No.41835558[source]
Typically, devs polishing their resume instead of prioritising business metrics probably means the overall org is on the down slope.
replies(2): >>41835636 #>>41835738 #
5. mytailorisrich ◴[] No.41835636{3}[source]
Perfectly normal for people to want to develop their skills and to enhance their value.

The thing is that this is not a developer's decision, this is a management decision. The developer might pitch for Rust or even start developing in Rust but if that is not right for the org then their manager should say 'no'.

So ultimately this is a red flag about management.

replies(2): >>41841777 #>>41844111 #
6. ndndjdjdn ◴[] No.41835738{3}[source]
Or the dev wants more money
7. j-pb ◴[] No.41836000[source]
That's a horrible rule of thumb, because C++ adds a ton of complexity with little reward except for speed. Rust adds less complexity (still a lot ofc), but it also gives you awesome tooling and dependency management (much better than python for example), and and extemely powerful typesystem and functional programming features, that make writing correct code extremely easy.

Rust is a complex but overall good language for writing solid software, C++ is making a deal with the devil in exchange for speed.

replies(2): >>41837345 #>>41839760 #
8. ttfkam ◴[] No.41837345{3}[source]
If a garbage collected language can easily do the job, choose the garbage collected language. I like Rust, but it is NOT the fastest language to develop in.

Typescript, Python, Go, Swift, and even Bash depending on the situation are all quicker to code in than Rust.

If any of those languages are inadequate for the requirements whether they be memory-bound, CPU-bound, or sensitive to gc pauses, Rust is an excellent option that is far superior to C++ in 2024 and beyond.

The notion of "one true language" has always been and will always remain a fool's errand.

replies(1): >>41840001 #
9. cozzyd ◴[] No.41839760{3}[source]
You missed the point of the rule of thumb. Maybe rephrasing it as if 15 years ago you would have written it in C++ would help.
replies(1): >>41839897 #
10. j-pb ◴[] No.41839897{4}[source]
Nope. C++ has mostly downsides, Rust has significant upsides.

A good rule of thumb would be: is correctness and code confidence more important than learning curve and compile times? If so Rust, otherwise JS or Python (with possibly parts in Rust).

replies(1): >>41846185 #
11. j-pb ◴[] No.41840001{4}[source]
I write most of my stuff in a combination of Python, JS/TS and Rust these days with some form of Interop between them. I.e. mostly Python Marimo notebook with JS visualisations, and PyO3 Rust bindings.

Tbh I don't find myself to be "slow" in rust. Sure for quick exploratory stuff the notebook-environment and introspection capabilities of a dynamic language are definitely nice (e.g. when taking apart some unknown JSON data format), but especially when it comes to complex logic and refactorings Rusts type system is really making a big positive impact on productivity.

Sure TypeScripts type system is also powerful, but Rust is consistently better at infering types from closures and function calls, and the existing types and tooling story is miles ahead of TS. (and I've never encountered an easier to setup/use model checking language integration than Kani)

For one-offs where correctness doesn't matter, sure throw $SCRIPTING_LANG at it. But once you want correct software, I'd still choose Rust in a heartbeat.

12. ndndjdjdn ◴[] No.41841777{4}[source]
Slightly disagree.

Needing the managers permission is more of a "wartime" mode.

For peacetime the management should set a culture of peer review and data and logic driven discussion. The culture would ideally have a Rust lover sit there and think "would love to do this in Rust but...." because they know their peers will be affected by this decision.

The problem with management approval required is it usually meams no or bias towards management pressures. A management veto that is occasionally used may be better.

Disclosure: not a Rust programmer but pretty neutral on it. It is on my radar if I get a problem Node or Go can't solve.

13. makeitdouble ◴[] No.41844111{4}[source]
I'd agree with ndndjdjdn in that management getting involved should be the last resort, and potentially only to veto a very bad decision.

I think the main issue here is having a single dev going for Rust. Ideally someone interested in a new technology would pitch it to the team, and they'd discuss if they want to have a shot a it and if they can justify the investment for the whole team. That's where a tech that doesn't fit would be discussed and rejected, potentially with a proposition for a better option that devs are also interested in.

Even if it starts with just a prototype, if it touches production the other members of the team should be able to review it and maintain if needed.

That's this whole bit missing, and the team looking at it as a thing of life, that makes me think they're not focused on pushing things forward anymore at an org level.

14. LunaSea ◴[] No.41846185{5}[source]
C++ is incredibly fast and still the language of choice for a lot if not most computing intensive tasks.
replies(1): >>41847084 #
15. pjmlp ◴[] No.41846984[source]
Pretty much it.
16. j-pb ◴[] No.41847084{6}[source]
See my initial: > C++ is making a deal with the devil in exchange for speed.
replies(1): >>41853694 #
17. LunaSea ◴[] No.41853694{7}[source]
That really doesn't matter when the price of the devil's deal is cheap.

ie: security is rarely a problem when selling software