DEV Community

Cover image for Pitch me on Rust
Ben Halpern
Ben Halpern Subscriber

Posted on

Pitch me on Rust

Part of a new series! Feel welcome to dip in and weigh in on a past question.

Let's say I've never used Rust before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.

Oldest comments (34)

Collapse
 
softchris profile image
Chris Noring
  • It's fast
  • Built-in project management with cargo, crates, run tests etc..
  • Great community
  • Safe memory model
Collapse
 
dhravya profile image
Dhravya

RUST RUST RUST RUST RUST RUST RYSTTTTF

anyways on a serious note, blog.dhravya.dev/learn-rust

Collapse
 
cerchie profile image
Lucia Cerchie

I've not learned it, but I'm thinking of switching my efforts on learning Golang towards Rust because the performance benefits are similar but I hear more enthusiastic things about the community.

Collapse
 
softchris profile image
Chris Noring

I'm learning both. Have to say Go is easier to learn, I've also come further in my journey, i.e wrote a free book :) leanpub.com/go-from-the-beginning. Rust is slightly faster, I like it too.. So there seems to be more Go devs in the world but the community for Rust seems more enthusiastic, I agree with that :)

Collapse
 
guithomas profile image
Guilherme Thomas

Just got the ebook, I'll definitely start reading it this weekend. Thanks for writing and sharing it!

Thread Thread
 
softchris profile image
Chris Noring

any time :)

Collapse
 
stojakovic99 profile image
Nikola Stojaković

Rust community is amazing, and although it's harder, it's well worth learning it. So I would say don't give up on Rust easily! If you like it, keep going.

Collapse
 
codewander profile image
Anon • Edited

Larger ecosystem than Haskell and Scala, embracing some similar ideas about type systems and some elements of expressive/functional programming. I would use rust instead of Haskell, Scala, or OCaml only because it's ecosystem is larger.

In an ideal world, one of the functional languages would have a huge ecosystem and rust would only be used for extreme performance and low level tools. At present, I would use rust for high level web programming as well, if I wanted to use Haskell, but I wanted as many libraries as golang or python. Rust might match golang's ecosystem size within three years.

Collapse
 
gklijs profile image
Gerard Klijs

Not larger than Scala. With Scala you can use anything JVM, which still is more/better in a lot of cases than Rust IMHO.

Collapse
 
codewander profile image
Anon

True. I usually only evaluate an ecosystem based on its native libraries, so I exclude java libraries when evaluating clojure, etc.

Collapse
 
leob profile image
leob

Yes - Rust embraces a LOT of FP concepts, but in a less "extreme" way than Haskell ... still waiting for FP to go mainstream, will it ever ... ?

Collapse
 
codewander profile image
Anon

With 80k packages, I think rust's flavor of FP is the closest to mainstream that functional has ever reached on the backend. Scala had a shot, then faded. Clojure just hasn't broken through. Elixir isn't breaking through.

Thread Thread
 
leob profile image
leob

I agree with you, seems Rust is the closest thing to FP (or a variant thereof) going mainstream :)

Collapse
 
simeg profile image
Simon Egersand 🎈

It's fun! Modern syntax features. No fighting with setting up environment. Everything in cargo (format, dep management etc). It's fast.

The logo is cool πŸ¦€

Collapse
 
stojakovic99 profile image
Nikola StojakoviΔ‡ • Edited
  • Warm and welcoming community
  • Established standards for testing and code formatting
  • Supports functional programming style with no runtime cost
  • Very helpful error messages
  • Amazing documentation

The only cons is that sometimes writing something which would be trivial in C++ for example takes much more time in Rust but it's worth it most of the time.

Collapse
 
lexlohr profile image
Alex Lohr

You certainly don't want rust's borrow checker cause irreparable damage to your self-esteem by condemning your code for doing stuff that would be perfectly normal in other languages even though it might potentially create memory leaks. You don't need lots of different types of strings that each perfectly fit a different use-case, let alone a multitude of small APIs that each only does one job extremely well. You don't want asynchronous handling just be a stub that you can fill with whatever library you just want, depending on your use case – nobody needs that much control! Not to forget that the incredible performance benefits of the language are basically completely negated by the time the compilation requires. Also, everything gets statically linked, which somewhat increases the executable size; granted, those are still reasonably small. And you're a professional developer, you don't need the WASM target that produces really tight code. Long story short: you don't want Rust, unless you do, do you?

Collapse
 
drumm profile image
Sam J.

I disagree definitely because a rust program typically uses less power, is more performant and most importantly has less issues than C or C++ programs. With wasm you can create smaller and faster web pages which require a lot of content, what’s your point here?

Collapse
 
lexlohr profile image
Alex Lohr

I should have probably marked that as sarcasm, but I thought it was obvious.

Collapse
 
wiseai profile image
Mahmoud Harmouch

It is a bit rusty. Me IRL:

python_for_kids

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Do you like being beaten into submission by your compiler until you get it right, thats rust as I know it 😊

Collapse
 
feresr profile image
Raviola

"beaten" is a bit harsh. The Rust compiler error messages are super nice :D

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Oh yes they are, okay politely beaten because I still get a headache working out lifetimes and all that, I'm a bit rusty so perhaps ignore my out of date opinions before I get egg on my face

Thread Thread
 
feresr profile image
Raviola

haha politely beaten is a good way to put it

Collapse
 
pavonz profile image
Andrea Pavoni

If your rust code gets compiled, you can bet it won’t crash.

I would use it to optimize/extend other languages instead of relying on C/C++.