by cmrdporcupine · 3y ago · 0 comments
Just ... stop writing web services in it. Not writing a compiler, a browser, an operating system, a database, an interpreter, building fundamental datastructures, or a working on an embedded system etc? Go back to enjoying the conveniences of garbage collection and looser ownership models.
If you hit a wall with the GC and performance there, you can always rewrite portions native later.
OCaml, F#, or Haskell would offer many of the benefits that come with Rust's type system.
I've used OCaml professionally, and it's been a real pleasure.
Writing a low latency, high throughput ad server / RTB system from scratch? Sure, go Rust. Google uses C++ for this stuff still for a reason.
But in reality most of the services we're talking about are I/O bound low-thread-count data pipelines. And they'll be perfectly served by various managed languages.
Instead we get tokio-all-the-things...And Rust is a flavour of the month, and the JVM Isn't Cool, etc...
* Immutability by default, including a warning for unnecessary mutability
* Usable documentation even when the library author wrote none
* Extremely low-friction testing, including fuzzing
To name a few.
Racing to get an HTTP service that starts but doesn't do anything you want it to do correctly isn't really useful; in my experience, that's the only advantage e.g. Python, Go, etc really give you over Rust.
And honestly, TypeScript's union & intersection types are pretty nice and that language is nice and expressive.
Actually I actually routinely run up against expressiveness limits in Rust's enums in places where e.g. Scala would actually allow for a more static-declarative model (for better or for worse). I haven't worked in Scala in 15 years, but it was actually quite compelling.
A technology that works equally well in all use cases is not optimized for any particular application (by definition) and thus will be outperformed by a technology that IS optimized for the target needs. While there is an argument to be made for the existence of stacks that are "good enough" for most/all problems, that shouldn't empower proponents of said stack to spit on everybody else's choices - many of which being objectively better for the task at hand.
It's in large part because the industry is top-heavy with younger people who get senior titles and decision making powers after only a handful of years of work, and they're by nature excitement and novelty seekers. I definitely went through that phase.
Do I want to work in cool tech? Yes. But there's always a trade-off.
FWIW Rust is my fulltime language. And actually I would probably use it for (some) web services, for personal things. But if I were managing and staffing a team, I would not do this simply because hiring and managing that would suck.
Could you elaborate on the disadvantages of Rust from the point of view of a manager or a project lead?
Established best practices -- this is still being sorted out in Rust in various domains.
Third party library support -- again, immature in some domains but not all.
Managing and tutoring junior devs -- a bit trickier here.
I think there is potential big win in using Rust. I want to see it propagate. I work in the language, and love it. But also a big fan of right tools in right places. For most web service ("full stack") type projects a GC managed language with a pile of existing code and a larger potential hiring pool just makes sense.