Why Rust?

History of Rust

Rust was initially designed and developed by former Mozilla employee Graydon Hoare as a personal project. Mozilla began sponsoring the project in 2009 and announced it in 2010. But the first stable release, Rust 1.0 was released on May 15, 2015.

Since the initial stable release, the language has seen a series of improvements every three years through new editions; Rust 2015 with the release of Rust 1.0, Rust 2018, and Rust 2021. Each edition ensured backward compatibility with existing code.

Initial Goals

The goal of Rust is to be a good programming language for creating highly concurrent, safe and performant systems.

“Rust is a systems programming language focused on three goals: safety, speed, and concurrency.”
~ Rust Documentation

Rust is a very young and very modern language. It’s a compiled programming language and it uses LLVM on the backend. Also, Rust is a multi-paradigm programming language, which supports imperative procedural, concurrent actor, object-oriented and pure functional styles. It also supports generic programming and metaprogramming, in both static and dynamic styles.

One of Rust’s most unique and compelling features is Ownership, which is used to achieve memory safety. Rust creates memory pointers optimistically, checks memory pointers’ limited accesses at compile-time with the usage of References and Borrowing. And it does automatic compile-time memory management by checking the Lifetimes.

Influences

Its design elements came from a wide range of sources.

  • Abstract Machine Model: C
  • Data types: C, SML, OCaml, Lisp, Limbo
  • Optional Bindings: Swift
  • Hygienic Macros: Scheme
  • Functional Programming: Haskell, OCaml, F#
  • Attributes: ECMA-335
  • Memory Model and Memory Management: C++, ML Kit, Cyclone
  • Type Classes: Haskell
  • Crate: Assembly in the ECMA-335 CLI model
  • Channels and Concurrency: Newsqueak, Alef, Limbo
  • Message passing and Thread failure: Erlang

and etc.

Rust doesn’t use a built-in runtime or an automated garbage collection system (GC).

💡However, async Rust requires an async runtime, which is provided by community-maintained crates like tokio, async-std, soml etc. The async runtime will be bundled into the final executable.

Rust compiler observes the code at compile-time and helps to prevent many types of errors that are possible to write in C, C++ like programming languages.

👨‍🏫 Before going to the next…