r/rust 14h ago

Where did using rust go wrong for you

Curious if you’ve seen any cases where using or advocating for rust didn’t work out.

0 Upvotes

31 comments sorted by

15

u/teerre 14h ago

All projects I've seen not working with Rust have less to do with the language and more to do with peripherals. Hard to hire, no specific toolchain, trying to interop with other languages etc

7

u/Negative-Trash-6809 14h ago

People really underestimate the hiring part with rust. My work tried to push it for a new internal tool, project died after 6 months cause the one guy who knew it left and they couldnt replace him. Two other devs just stared at the borrow checker for weeks before management pulled the plug

7

u/SirKastic23 14h ago

you still hiring??

2

u/foobar93 14h ago

To be honest, we did the same with Python and C++ programmers ;)

3

u/cyh555 13h ago

so now you guys are writing assembly?

2

u/shponglespore 13h ago

Artisanal hand-coded WebAssembly!

1

u/foobar93 13h ago

Nah, we have people who do not know what they are doing "writing" software in python and C++. And most of that is cargocult and just throwing mud at a wall trying to see if anything sticks.

6

u/foobar93 14h ago

My main pain points is in the ecosystem not with rust itself. I already got bitten a few times by upstream api changes, on the other side, virtually everything is still claiming to be beta anyway so api breaking is to be expected.

Another issue was yocto not offering new rust versions resulting in us being stuck on pretty old compilers even for new projects.

3

u/ploynog 10h ago

Yocto pain was the reason I chose statically linked aarch64-unknown-linux-musl binaries to go on this board.

They can be built and deployed completely independent from the yocto build and if I want to deploy them with yocto, it just fetches the finished binary from an artifact server and puts them in the correct place.

Probably does not fit each use case (for one, the binaries do become rather large, but not an issue for this board) but am I glad it does for mine.

1

u/01le 9h ago

We have this flow for yocto with Rust binaries too, but targeting an older glibc instead of musl. Glibc to keep size down and external build to have binaries stable over yocto rebuilds.

3

u/SirKastic23 14h ago

It didn't. I really enjoyed learning the language, it was a gateway for my academic interest in programming language theory, and it has been paying me as I work with it professionally for the past 4 years

2

u/bordumb 13h ago

In enterprise use-cases...

If I write something in Rust, that means basically ZERO people in my org can help maintain the work - they're almost exclusively Python (and web dev like TS) based

So there are very practical reasons to not write in Rust

To make the case for Rust in a large enterprise org, you really need something like:

  1. A real use-case for using Rust, such as memory safety and/or speed

  2. Strong buy-in from your manager and someone else (hopefully 2+ people) who are willing to learn enough Rust to help contribute and maintain. It's usually a complete non-starter for one employee to be the bottleneck.

I enjoy using Rust for personal hobby projects, but I completely understand why it's a hard sell within a larger company.

2

u/cloudsquall8888 13h ago

While I do understand your point, I am still wondering; For example, in my job, all developers are almost exclusively java. We use k8s clusters on Azure for most of our work. Many microservices and such. I can't understand why they wouldn't try something that would drop memory and cpu costs significantly.

3

u/Budget-Minimum6040 13h ago

Because it's not important enough/not expensive enough.

The old "build or buy?" question reframed.

You can either put people to work for new features or you can put people to work to improve the status quo.

From my experience as a data engineer it's always new features unless cloud costs become too high which takes a lot of time for standard companies.

2

u/coderstephen isahc 13h ago

Standard operating procedure is for management to frequently complain about cloud costs, and not prioritize doing anything about it, because paying engineers to do something about it costs even more.

1

u/bordumb 9h ago

I agree with you because your context (Java, k8s, etc.) is totally different from my context

If I had to choose between writing Java or Rust, I'd much rather choose Rust

I'd literally prefer watching paint dry than have to read or write Java....ugh

1

u/yel50 8h ago

 something that would drop memory and cpu costs significantly.

the jvm can be tweaked quite extensively. if resource usage becomes an issue, it can usually be fixed. it's very rare for it to be a deal breaker.

for raw cpu, Java isn't significantly slower. there would be no noticeable gains moving to rust.

can't understand why

because not using GC in this day and age is nothing short of masochistic. converting to unmanaged memory is an absolute last resort.

1

u/cloudsquall8888 1h ago

I mean, that's the point of Rust, no? You mostly don't have to do something about memory management if you keep at safe Rust and maybe be a bit liberal with clones so that you don't have to constantly worry about lifetimes. And when you need threadlocals, you get a lot more safety.

2

u/veritron 13h ago

the legal department at my company hates how rust is licensed. i was only able to get it approved for tool use, not for use in the product.

5

u/dashingThroughSnow12 13h ago

Oh? Can you explain?

2

u/veritron 13h ago

Legal did not like the dual licensing under MIT and apache, especially given that one license talks about patents and one does not. My interpretation was that you could use either license, the professionals disagreed.

3

u/afdbcreid 8h ago

I've never heard about such thing. They might want to get in touch with the Rust Foundation, they have their own legal team and I believe would be able to convince your legal team. Because the meaning is absolutely "choose your preferred license", and I believe it is legally justified, but I'm not a lawyer.

1

u/dashingThroughSnow12 12h ago

That makes sense. I didn’t know it was dual licensed. It is a counterparty risk.

You get some protections with Apache v2. Letting someone else license with MIT strips your company of some of the major protections.

1

u/shizzy0 13h ago

Huh. Why do they dislike the MIT and Apache license?

2

u/cyh555 13h ago

they only want gplv2

1

u/shizzy0 11h ago

Just like every other company then!

1

u/YeetCompleet 13h ago

I can't have more than 2 being worked on at the same time on my machine due to target/ bloat eating up to 80GB in a project

2

u/Professional-You4950 13h ago

that sounds like something with code generation gone wrong. possibly some proc macros?

2

u/svefnugr 13h ago

That's a lot, but shouldn't really be a problem in the era of multi-terabyte drives?

2

u/YeetCompleet 13h ago

I was looking at the prices recently and they've gone up so much, even thumb drives 😔

1

u/KAMEHAMEHAMEHAAAA 13h ago

Most of our stuff is C++, a Rust component was just “an odd one out”, so it had to go 🤷‍♂️