DEV Community

Ian bradbury
Ian bradbury

Posted on

Explain Rust like I'm five

I see the term RUST here and there and I nod internally to myself that I know it's a development language or something. But I really don't know anything about RUST.

  • What are RUST's strong points?
  • Why and when would I want to use it?
  • And (importantly) will i earn lots of money if I invest my time with it?

Top comments (9)

Collapse
 
mnivoliez profile image
mnivoliez

As stated in other post, Rust is a low level language. Therefor, some complexity related to memory and process management come into play. Many struggle with the borrow checker which is the equivalent of pointer in c++ in terms of pain. However, the syntax is pretty simple and straightforward. Writing in rust can remember writing in JavaScript. Also, Rust can be seen as a functional programming language.

To conclude, it's a good language and you can learn a lot with it. It's backed but numerous companies and know a rapid growth which seems far from being stopped. After, as Kasey Speakman stated, product make money, not language. But popular language tends to be attractive in a market way.

Collapse
 
michaeltd profile image
michaeltd

Sometimes you can tell when something is worth your wile simply by noting who's involved in it.

This is mozilla's active projects page and it contains among other things
firefox, web-assembly and last but not least rust.

mozilla.org/en-US/technology/

Collapse
 
eljayadobe profile image
Eljay-Adobe

Rust is a relatively young language. It is sponsored by Mozilla, so has solid backing.

I think it is fair to say that Rust is a "better C++ than C++". At least that's their goal as I see it.

C++ folks would rightly point out that C++ is enormously popular, has many resources available, and a very vibrant community and large ecosystem. And C++ is evolving, too.

Rust is object-oriented, with a very strong ownership model, and a strong concurrency story.

If you were doing systems programming, it is worth considering as an alternative to C, C++ or D.

If you are doing applications programming, then that depends on your platform.

For example, a .NET or Mono environment is best served by using C#, VB.NET, or F#. An iOS or macOS environment is best served by using Swift or Objective-C. Android environment is best served using Java, Groovy, Scala, or Clojure. And a Win32 environment is best served using C++.

Using a non-premier language for those environments would entail extra work to bridge to the platform's APIs.

In time, there will very likely be high quality Rust toolkits that have done all the hard work to interoperate with those various platforms.

I'm not sure what you mean by "earn lots of money" in this context.

If you mean finding an employer who will pay you for your Rust skills, then I would say that there is higher demand for other skills.

If you mean writing an application and selling it, then that would depend on the application much more so than the language it is written in.

If you mean learning Rust helps you be a better software developer because it teaches you new concepts, which is a virtuous cycle helping you have more earning potential, then yes. Same applies with other computer languages. F#, Haskell, Scala, Clojure, D, Lua, Python... the list is vast.

I use resources like TIOBE and StackOverflow's Developer Survey to see what languages have a lot of interest.

Collapse
 
kayis profile image
K

When you programm a computer you have to tell it when you need memory to store your data in and when you done using it.

There are two ways to do it.

1 Say what memory you want and when you done. Yo write "free" every time your done.

2 Just pretend you can use all the meomory and let someone else figure out how much you really use and when you done with it.

Now "someone else" is usually some part of your software, called a garbage collector. While your software runs, it checks what memory you don't use anymore and "frees" it for other programs to use.

But with Rust "someone else" is your compiler, the program that translates the Rust language into computer language.

The Rust compiler writes your "manual" frees into the right places while it translates your Rust code into computer language. So you don't need a extra part in your software that looks for unused memory while it runs.

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

Rust is a systems language, operating in the same space as C and C++. The difference being that Rust eases a lot of the pains those languages have. For instance, Rust has "guaranteed memory safety" whereas most system languages have lots of common ways to shoot yourself in the foot (at runtime) when dealing with memory. Rust has built-in concurrency abstractions to ensure memory safety for multi-threaded programs, including message passing. Rust also has convenience features that you usually only see in application languages. Examples: pattern matching, immutable variables, expressions, type inference.

Why and when would I want to use it?

You would use it any place where you might make a C, C++, or maybe a Go application for high performance, low overhead, and low-level access to system resources. Examples: device drivers, operating systems. Rust additionally claims to be good for "web applications". I think they mean server-side but could increasingly mean client-side as Web Assembly matures.

And (importantly) will i earn lots of money if I invest my time with it?

Products make money, not languages. As far as salary, probably no more than other languages in the long run (haven't done the market research myself), but it could be more enjoyable to maintain and add features over time.

Collapse
 
lexlohr profile image
Alex Lohr

What are RUST's strong points?

RUST's strongest point is to annoy developers into writing good code; less strong points are ease of multithreading, security and a very flexible type system

Why and when would I want to use it?

If you need a compiled language and either want to become a better developer or are just masochistic, use RUST as soon as possible

Will I earn lots of money if I invest my time with it?

At the moment, only few employers search for people with RUST experience. So if you want RUST to become your only language, you're probably not going to be rich very soon.

However, in some cases, having RUST in your arsenal might enable you to solve some problems that will be difficult or even impossible in other languages. For example, ripgrep uses some pretty clever optimizations that can be done in RUST without much hassle, but will be a pain to implement in C++ (at least according to the author, Andrew Gallant).

In a startup, this might be the unfair advantage that decides between bankruptcy or success. Don't expect big companies to adopt RUST at the moment, as there are not enough experts on the market yet, so they will more likely look for Java developers.

Collapse
 
bizzibody profile image
Ian bradbury

Brilliant.

Collapse
 
notriddle profile image
Michael "notriddle" Howell

What are RUST's strong points?

Speed and correctness are the strong points.

Why and when would I want to use it?

If your use case is similar to a web browser, where the code needs to follow a spec and needs to be fast, you'll want to use Rust.

You'll notice there's nothing in here about fast iteration times, so most startups don't want to use Rust (though they might want to use other people's Rust code for various infrastructure-y things like database backends).

And (importantly) will i earn lots of money if I invest my time with it?

Not right now.

Collapse
 
bizzibody profile image
Ian bradbury

Excellent answers. Thanks both.

I feel like I now know exactly that RUST is not for me. Too low level.

However - it is good to know that the low level arena is moving forward.