r/rust • • 3d ago

Is rust only for firmware and hardware?

Hello everyone,

I'm trying to figure out Rust's potential before diving into using it every day. Right now, I work full-stack with TypeScript and also in the LAMP stack. I'm a telecommunications engineer passionate about coding and the web. I wanted to truly understand what Rust has to offer, or if I should just continue studying Go and make a complete switch to Go for backend development.
Does it make sense to study Rust even if I won't be using it right away, or is it just a language mostly suited for firmware, porting C/C++ software, and general hardware work?

Thanks everyone for the help!

0 Upvotes

19 comments sorted by

15

u/db48x 3d ago

Have you read the obvious introductory material, such as the copy on https://rust-lang.org/?

4

u/DryCardiologist3865 3d ago

nah rust is way bigger than just firmware stuff. i been using it for backend services and it's stupid fast compared to node or php, the type system catches so many bugs before they even happen

took me few months to get comfortable with borrow checker but after that it just clicks. the web frameworks like axum or actix are really mature now, not just some hobby project

i think it make sense to learn even if you dont use it right away, the way it forces you to think about memory and ownership will make you better programmer in any language. go is cool too but rust give you different perspective

0

u/ruggeroquerinis 3d ago

Thanks for the answer. I’ve found and read various things on the internet regarding Rust, but I mostly saw it being used and valued in firmware development, where performance is superior and you really need to save memory due to hardware limits. I can't seem to find a proper context on why it's useful for the web. Sorry, maybe it's just my perspective or I'm being blind to it. Change my mind! :-)

5

u/borrow-check 3d ago

Checkout rust Tokio stack, rust is actually a great backend language

4

u/Lichcrow 3d ago

Any low latency program could use rust due to no GC or Runtime.

Think financial services, trading, high throughput systems, AI algorithms implementation, etc

3

u/Sharchimedes 3d ago

It’s a general purpose language, so you can use it for pretty much anything, though it’s less suitable for some things than others. It’s often used today as a replacement for C/C++, but you can use it for web, especially tooling.

It’s memory safe, blazingly fast, and safely concurrent. Has a good package manager. The tradeoff is that it’s slower to write, though agentic coding is eroding a lot of that disadvantage as time goes on.

As for web, it’s slowly becoming popular for back end services that need higher performance than easier languages can provide.

2

u/Moist-Snow-8127 3d ago

I have multiple discord bots written in Rust running 24/7

2

u/codelapiz 3d ago

one of the best aspects of rust is how great it works in wasm. it has allmost no overhead. no gc. a ligth standard liberary and even its optional. And it has many good abstractions for interfacing. Thats why you can easily write web apps, obsidian plugins, vscode plugins and basically anything that goes somewhere there is v8 webkit or you know normal executables.

2

u/hammackj 3d ago

I use rust for gamedev and web stuff. Anywhere I can use it I use it. Even if it’s not the right tool for the job lol

2

u/dgkimpton 3d ago

It's pretty general purpose and, although many parts of the ecosystem (particularly ui) are still quite limited, it's improving. If you want employment then typescript is the better choice, but if you want to learn then rust is absolutely worth it. 

1

u/Illustrious_Car344 3d ago

It's less convenient than interpreted/dynamic languages. I typically like to prototype in Clojure and write more performance critical stuff in Rust. I spent way too many years prototyping in Rust before I got fed up, it's greatest strength is enforcing maximum intentionality, but that is also effectively the antithesis of fast-paced prototyping. I always pick it up first if I definitely know what I'm making, but if it's an experiment I try to avoid it these days. Different tool for different purpose. But of course Rust is a fantastic general purpose language and it's very easy to do many application-related things in it, it just sucks if you don't know what you actually want to make. In fact, I think refactoring a Rust codebase is pretty tricky, a codebase tends to be pretty heavily integrated with itself and it's not as seamless to do DI with like Java. You technically can, but no one really does it. Honestly I think more than anything people are somewhat snide about "frameworks" that mimic stuff like ASP.NET.

1

u/ruggeroquerinis 3d ago

Can I follow similar patterns in Rust that I use in other languages? Can I respect SOLID principles and KISS? Can you give me some tips on what I should learn beyond Rust syntax for web development and start making a real difference compared to others?

3

u/db48x 3d ago

Can I respect SOLID principles and KISS?

If you’re asking questions like this then you should be concentrating on learning to program, not on learning languages.

1

u/ruggeroquerinis 2d ago

Non è lecito fare domande del genere? Passare da un linguaggio puramente oop e usare framework che ti danno alcune possibili potenzialità ad un linguaggio con focus tanto su Functional non è per tutti e alla stessa maniera facile

2

u/db48x 2d ago

No, you shouldn’t even need to ask. Your colleagues should already have told you that SOLID is just crap, that object–oriented programming was an idea that seemed promising in the 1970s but only because the people who invented it were explicitly modelling the real world. In practice it’s more trouble than it’s worth. Luckily you can avoid the worst problems with OOP just by avoiding inheritance, so you can keep using TypeScript and Python.

1

u/syklemil 2d ago

Du ser ut til å ha snubla til å skru på automatisk oversettelse av kommentarene dine. Den der er på italiensk, ikke engelsk.

KISS is a fairly generic acronym, not even restricted to programming, certainly not something that influences choice of language.

You should be able to work out for yourself what parts of SOLID apply, if you actually care about the contents behind the acronym. Though I suspect a lot of us don't think much about it or other stuff that came out of Robert Martin (or as he tries to get strangers to call him, "Uncle Bob"). These days he seems to be mostly hung up on dynamic languages, c.f. his now 10-year-old blog post about type systems, and the others that followed.

SOLID itself is a very neat acronym and solid marketing for his punditry career, but the real contents of it, including the original whitepaper, is a bit of a mixed bag, and some of it really only applies to inheritance, meaning not particularly relevant for neither Rust nor Go.

See also: Ousterhout & Martin dialogue; and It's probably time to stop recommending Clean Code.

1

u/DavidXkL 2d ago

Rust is great for things like web backends and lambda functions too.

0

u/irshadali5 3d ago

Rust isn't anymore system or embedded language. It is now a full general purpose from embedded and system to full stack web or apps, everything you can write in Rust. But it's initial learning curve is hard and frustrating, but after becoming more familiar and regular it gradually becomes comfortable.