Rust as a Lens

Dear Computer

Chapter 10: Everything Revisited

Rust as a Lens

We have arrived at Rust, the third and final lens through which we are examining programming language concepts. Compared to Ruby and Haskell, Rust is young. Its originator, Graydon Hoare, released its first prototype in 2006. Hoare wanted a language for building fast programs that didn't leak or violate memory. At the time, Hoare was a software developer at Mozilla, the company that publishes the Firefox web browser. Mozilla invested heavily in Rust, hiring researchers and engineers who continued to develop the language and its ecosystem. The language has matured and been adopted by many companies seeking a language that is safer than C++ and nearly as fast.

Hoare stepped down from his leadership role in 2013. By this point, Rust was being worked on by many different people, and his departure didn't derail its momentum. Hoare loudly rejected the idea that the language was solely his brainchild in an all-caps tweet:

PLEASE DESIST IN THINKING THINGS ARE MADE BY SINGLE PEOPLE IT IS A VERY UNHEALTHY MYTH

Later he joined the Swift development team at Apple. He explains his embrace of a completely different language in a Reddit post:

But: I don't think Rust is the last or only language that needs to exist. Indeed, I think there's quite a lot of work left to do on languages before anyone could credibly argue such things about any language. I've always been a language pluralist—picture my relationship towards languages like a kid enjoying a wide variety of building blocks, musical instruments or plastic dinosaurs—and I don't think evangelism or single-language puritanism is especially helpful.

Rust supports many of the features we have been learning about, including tuples, structs, enums, pattern matching, lambdas, and higher-order functions. In particular, you will recognize the strong influence of Haskell on Rust. But unlike Haskell, Rust is more tolerant of mutability and side effects.

In this chapter, we explore Rust's take on variables, types, functions, and control flow. All of these concepts we've already explored through the lens of Ruby and Haskell. By the chapter's end, you'll be able to answer the following questions:

In later chapters, we'll explore Rust's polymorphism, unique approach to memory management, and builtin support for concurrency.

Print →