Let's talk about Rust.

The most-loved language, according to StackOverflow's yearly developer survey that not enough people seem to use professionally.

🧵⏬
1️⃣ What Is Rust?

Rust is a systems programming language that is compiled to binary. It has no runtime and instead uses a concept called "borrow checking". Developers don't need to explicitly free memory, the compiler does it for them.
The language itself is multi-paradigm, offering functional, generic, imperative, structured, and concurrent programming with a huge emphasis on performance, memory safety, and developer productivity.
2️⃣ Who Uses Rust?

There are actually quite a few companies now that successfully use Rust in production.

This includes

🔻 Amazon Web Services (AWS)
🔻 Microsoft
🔻 npm
🔻 Dropbox
🔻 yelp
🔻 Mozilla
🔻 Atlassian
🔻 CoreOS
🔻 Coursera

and many more.
3️⃣ Some Core Features Of Rust

🔻 Compilation to binary
🔻 Memory-safety
🔻 Performance
🔻 Developer-Productivity
🔻 Resource-efficiency
♦️Compilation to binary

Rust compiles to binary. On building your software, the compiler does everything necessary to ensure that you get a binary file at the end of the process.

This binary isn't platform-independent, but cross-compilation is possible.
♦️ Memory-safety

The compiler ensures that no code you write can ever create a memory leak. It thoroughly checks your code, inserts free-statements, and aborts the compilation if your code would create a leak.

The aim for memory-safety goes even so far, ...
... that the compiler doesn't even allow scenarios where it is unsure if there is really no way a certain piece of code could ever leak. Such cases are strictly researched before they are finally allowed by the compiler in a new version of Rust.
♦️ Performance

Rust is damn fast. It's sometimes faster than C++ and C, and sometimes slower. It usually depends on the scenario you benchmark the language in. On average, you can place Rust in one bracket with C and C++.
♦️ Developer-Productivity

Rust has an awesome toolchain. The compiler has some of the best error messages you have ever seen. The language comes with an integrated package manager and build tool (Cargo), an auto-formatter (bye bye style-guide wars) and an ...
... impressive language server that makes integration into IDEs and editors (hello VSCode) pretty good.
♦️ Resource-efficiency

Rust has no runtime and thus no garbage collector. This means that memory does not grow and grow until a limit is hit and the garbage collector kicks in. It only uses what is allocated at a given time.
The resulting binaries are also pretty CPU-saving. This is bare-metal software running that contains binary instructions.
4️⃣ What You Can Use Rust For

Rust can be used for a multitude of use cases, and here are some of them:

🔻 Backend Development
🔻 Creating CLIs
🔻 Embedded Programming
🔻 Networking
🔻 Web Development (through WebAssembly)
🔻 OS development
♦️ Backend Development

There is a multitude of frameworks that enable you to develop microservices in Rust that use gRPC or HTTP REST for communication, including async DB drivers and at least one fully-fledged ORM. Rust's performance makes services perform awesomely well.
♦️ Creating CLIs

Creating CLIs is pretty straight-forward in Rust. There are enough libraries for command-line argument parsing and the language itself is powerful enough to support nearly all use cases you could think of. As it compiles to one binary, distribution is easy.
🔻 Embedded Programming

Rust compiles to binary and can run on a multitude of CPU architectures. Especially Rust's memory safety, small binary size, and resource-saving nature makes it a perfect fit for environments with limited resources.
🔻 Networking

Rust binaries are small and performant. Linkerd proxies are, e.g. written in Rust, to offer maximum performance. As a bare metal language, a developer can use every native functionality without much overhead.
🔻 Web Development (through WebAssembly)

Rust supports compilation to WebAssembly. And this works out awesomely well. The automatic memory management that the compiler brings to the table serves WebAssembly extremely well and results in well-performing programs.
🔻 OS development

You can use Rust to develop operating systems, like you could do with C and C++. You may still write some drivers in C or Assembly, but Rust is a good fit for low-level stuff that is used by a lot of higher-level functionalities.
5️⃣ Rust Has A Steep Learning Curve

The language is awesome, but it is a huge shift from what most developers are used to.

As a developer, you really have to think about what you actually do with your variables. Where you pass them as an argument and how you ...
... reuse them after that.

Garbage-collected languages remove the need to think about this from developers. The runtime and GC simply take care of all memory management.

Learning how to really deal with variable-lifetimes can take some time. But gladly, the compiler ...
... has some of the most helpful error messages throughout all compilers that really help you understand what you did wrong, and where.

This actually leads to you not having to google everything. And with time, you get used to it.
5️⃣ Conclusion

Rust is a really great language, and although Go has gained way more traction in recent years, Rust seems to only have walked a few steps back, to run with even faster speed afterward.

I'm pretty sure that we will hear more and more about Rust being used ...
... in different scenarios and by many more companies (and also well-known ones).

Since Mozilla's large layoffs due to COVID-19 and a restructure, Amazon (AWS) has jumped in and shown huge support for the language. You don't need to worry that it goes away anytime soon.
6️⃣ Before You Leave

I hope you liked this thread about Rust and if you want to read more about Rust from someone that actually uses it in production, show your support and let me know, so I know that I can safely spend more time on creating content for it!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Oliver Jumpertz

Oliver Jumpertz Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @oliverjumpertz

17 Mar
Want to get started with Rust?

Here are some resources that help you to get into the language!

🧵⬇️
1️⃣ "The Book"

This is the official Rust book. It covers everything the language has to offer and introduces feature after feature while enabling especially newbies to follow along from the simpler to the more difficult topics.

doc.rust-lang.org/book/
2️⃣ Rustlings

This project gives you small exercises that aim at getting you comfortable writing Rust code. Especially if you don't feel creative enough to think of a new project, this is a great way of still writing code.

github.com/rust-lang/rust…
Read 8 tweets
15 Mar
What are NFTs? Everyone seems to be talking about them but what are they, and how can you use them?

Interested? Then this thread is for you!

🧵🔽
1️⃣ What Is An NFT?

Non-fungible tokens (NFTs) are digital assets. Just imagine a trading card where each card has unique information engraved into it. No two NFTs are the same and they are thus not interchangeable.
Other than crypto where one BTC is one and two BTC are two BTC, two NFTs are one NFT and one NFT. Only because you have two NFTs of the same type simply doesn't enable you to sum them up together.
Read 19 tweets
14 Mar
Let's talk about how you can optimize your LinkedIn profile by using keywords.

This approach worked pretty well for me, and it might help you, too.

🧵🔽
1️⃣ Most Recruiters Search For Keywords

LinkedIn offers recruiters the chance to look for profiles of users by using keywords. If you ever had to search in Atlassian Jira, you know how that works approx.
If not, basically imagine it like this:

A recruiter can type in keywords and then use boolean logic, like ("engineer" OR "developer" OR "dev") AND "javascript" AND ("react" OR "vue").

LinkedIn will process this and then return a list of potential profiles for them.
Read 13 tweets
13 Mar
Imagine every device manufacturer created their own plug that only they were allowed to manufacture. You'd need at least one cable for each device to charge. Gladly we have USB as a standard.

The Dependency Inversion Principle solves this issue for software.

🧵🔽
1️⃣ What does it state?

Modules that encapsulate high-level policy should not depend upon modules that implement details. Rather, both kinds of modules should depend upon abstractions.
This may sound a little complicated, but you can break it up, as follows:

1. High-level modules should not depend on low-level modules. Both should depend on abstractions (e.g., interfaces).
Read 23 tweets
12 Mar
Just imagine that you need 20 different keys on your keyring to enter your home but only one of them is actually used to unlock the door.

The Interface Segregation Principle tries to solve this problem for software.

🧵🔽
1️⃣ What does it state?

The Interface Segregation Principle (ISP) sets a pretty simple statement:

"No client should be forced to depend on methods it does not use."

The ISP applied to the extreme will result in single-method interfaces, also called role interfaces.
You can take a look at the following example to get an idea of how the ISP can be violated in one way (it's in TypeScript). interface ReportService {  ...
Read 18 tweets
5 Mar
Code Reviews are a great way to use the experience and knowledge of a team to create good software. Not all review processes are enjoyable, though.

Here are 6 tips to make your review process better and more enjoyable for everyone!

🧵🔽 Two developers sitting at a...
1️⃣ Make Expectations Clear

A good review process should both be standardized and individual. The terms of the process should be written down and transparent for everyone on the team. Each team member should know what is expected of them and all team members should agree ...
... on the terms. Changing the terms should always be a democratic process within the team. If the team disagrees on changes or terms, it should discuss the issues until there is consent.

On the other hand, the process should be flexible enough to allow for individuality.
Read 19 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!