Using Rust for Successful Projects

By Norman KöhringMar 9, 2021Read time 3 min
Wunderdog developers using Rust

Companies around the world, from startups to large corporations, are using Rust in production for fast, low-resource, cross-platform solutions.

The world's leading science journal, Nature, published an interesting article about the advantages of Rust. Rust is a modern language that blends performance of languages such as C++ with friendlier syntax, a focus on code safety and a well-engineered set of tools that simplify development. With a rapidly growing community, Rust has become one of the best languages to learn and apply, especially if you care about performance and safety.

Rust as an Investment

No secrets: the learning curve for Rust is steep. Rust is a static language. It requires a fair amount of thinking and designing memory management and types. If you’re used to dynamic languages this may first feel like a challenge. However, when high performance is a priority, Rust is a reliable choice, especially in IoT projects.

Why do companies such as Dropbox, npm, Cloudfare, Amazon and Discord use Rust? The list of the benefits is long:

1. Performance

Performance of Rust matches C, and sometimes Rust even outperforms C. While C and C++ can sometimes lead to program crashes or memory leaks that are difficult to debug and/or solve, the Rust compiler detects the issues while compiling the code, thereby guaranteeing memory safety during execution. Rust guarantees safety, especially if you’re used to languages such as Javascript or Python.

Static types and heavy compile-time checks give Rust an advantage over dynamically typed languages, especially when tackling complex codebases and concurrent code. Minimal and optional runtime gives the developer exact control over memory allocation and performance.

With Rust performance is also a synonym for speed, control, and predictability.

2. Speed

When speed matters, Rust is a fast language offering high-performance results. Rust is well equipped to develop efficient code, with e.g. SIMD intrinsics, memory alignment, memory barriers or inline assembly.

3. Zero cost abstractions

Over time zero cost abstractions has become a core principle of Rust. With Rust, you only pay for the features you actually use. This means no extra runtime overhead for certain powerful abstractions or safety features with other languages. Additionally, high-level APIs will compile to machine code as good as what you could get by writing lower-level code.

4. Safety and reliability

Rust uses various techniques to make sure that the code compiled is free of certain types of bugs. Rust is a great choice when you need a systems programming language (i.e. a language that can build systems that other software run on, e.g. OS kernels) that is thread-safe and memory-safe. Today many developers recommend Rust over C.

5. Ergonomics

Ergonomics is a measure of the friction experienced when trying to get things done with a tool. The Rust community has an initiative to help developers organize ideas for ergonomic improvements taking productivity and usability to the core.

6. Stability

Rust has always had a strong stability guarantee in terms of code breaks. A key focus of improving the Rust language in 2020 was on cleaning up and stabilizing features and existing initiatives.

7. Community

The fast-growing and strong Rust community offers extensive documentation and community-maintained collection of resources.

What are the benefits of using Rust?

Giving Rust an opportunity may open new horizons for you as a developer. If you're a business owner, consider using it too. At a minimum, Rust offers a new mindset. It works differently compared to other languages and mastering it will require time. However, Rust will definitely challenge your thinking and bring you closer to the metal. I can't stress it enough: give it a try.

This article was written in collaboration with Norman Köhring, who happens to be a Rust wizard. Norman is working as a senior software developer in Berlin.

If you're looking for new challenges, we're here for you!

Interested? Contact us.