Introducing Rust

If you’re already well versed in Rust, then feel free to skip to the next section. If you’re new to it or you’d like a refresher on the core concepts of the language, then you may find this section beneficial.

Rust started in 2006 as Graydon Hoare’s personal project while he was working for Mozilla. Mozilla sponsored it in 2009 and announced it in 2010. In the history of each programming language, its genesis moment is when a compiler written in that language is able to compile that language—a compiler inception,[10] if you will. For Rust, this came in 2011 and the first stable 1.0 release came in 2015.

Rust has been gaining in popularity exponentially ever since. In addition to powering Mozilla’s new browser layout engine and showing up in a number of high-visibility systems and networking open source projects, it won the “Most Loved Programming Language” award in 2016, 2017, and 2018,[11] surpassing Kotlin, Python, TypeScript, and even Go. This is Rust’s elevator pitch from the official website:

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Some of the main characteristics of the Rust language that make it appealing for building applications with WebAssembly include:

Safety

Rust doesn’t have the concept of null. Instead, any data that can be missing is represented as an Option type. This gets rid of an entire class of errors that plagues other systems languages like C and C++ and even many higher-level languages. In addition to lack of nulls, Rust will prevent your code from compiling if it could potentially create a data race, free already deallocated resources, or access something that has gone out of scope.

Expressivity

Despite being labeled as a “systems language,” Rust has a remarkably expressive syntax and includes many features that people typically laud when talking about functional programming: pattern matching, destructuring, streams, iterators, and much more. Combined with the concepts of traits and generics, Rust (most of the time) manages to facilitate highly readable and maintainable code.

Performance

Rust binaries are standalone, native binaries. They consume relatively little disk space, have a fairly small memory footprint, and the code generally performs extremely well. Despite all of the additional safety constraints in the language, Rust doesn’t need a garbage collector, which can often produce raw, C-like performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.109.234