Rust in Action
Tim McNamara
- 456 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Rust in Action
Tim McNamara
About This Book
"This well-written book will help you make the most of what Rust has to offer." - Ramnivas Laddad, author of AspectJ in Action Rust in Action is a hands-on guide to systems programming with Rust. Written for inquisitive programmers, it presents real-world use cases that go far beyond syntax and structure. Summary
Rust in Action introduces the Rust programming language by exploring numerous systems programming concepts and techniques. You'll be learning Rust by delving into how computers work under the hood. You'll find yourself playing with persistent storage, memory, networking and even tinkering with CPU instructions. The book takes you through using Rust to extend other applications and teaches you tricks to write blindingly fast code. You'll also discover parallel and concurrent programming. Filled to the brim with real-life use cases and scenarios, you'll go beyond the Rust syntax and see what Rust has to offer in real-world use cases. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology
Rust is the perfect language for systems programming. It delivers the low-level power of C along with rock-solid safety features that let you code fearlessly. Ideal for applications requiring concurrency, Rust programs are compact, readable, and blazingly fast. Best of all, Rust's famously smart compiler helps you avoid even subtle coding errors. About the book
Rust in Action is a hands-on guide to systems programming with Rust. Written for inquisitive programmers, it presents real-world use cases that go far beyond syntax and structure. You'll explore Rust implementations for file manipulation, networking, and kernel-level programming and discover awesome techniques for parallelism and concurrency. Along the way, you'll master Rust's unique borrow checker model for memory management without a garbage collector. What's inside Elementary to advanced Rust programming
Practical examples from systems programming
Command-line, graphical and networked applications About the reader
For intermediate programmers. No previous experience with Rust required. About the author
Tim McNamara uses Rust to build data processing pipelines and generative art. He is an expert in natural language processing and data engineering. Table of Contents 1 Introducing Rust
PART 1 RUST LANGUAGE DISTINCTIVES
2 Language foundations
3 Compound data types
4 Lifetimes, ownership, and borrowing
PART 2 DEMYSTIFYING SYSTEMS PROGRAMMING
5 Data in depth
6 Memory
7 Files and storage
8 Networking
9 Time and timekeeping
10 Processes, threads, and containers
11 Kernel
12 Signals, interrupts, and exceptions
Frequently asked questions
Information
1 Introducing Rust
- Introducing Rust’s features and goals
- Exposing Rust’s syntax
- Discussing where to use Rust and when to avoid it
- Building your first Rust program
- Explaining how Rust compares to object-oriented and wider languages
- Mandelbrot set renderer
- A grep clone
- CPU emulator
- Generative art
- A database
- HTTP, NTP, and hexdump clients
- LOGO language interpreter
- Operating system kernel
1.1 Where is Rust used?
- Amazon Web Services (AWS) has used Rust since 2017 for its serverless computing offerings, AWS Lambda and AWS Fargate. With that, Rust has gained further inroads. The company has written the Bottlerocket OS and the AWS Nitro System to deliver its Elastic Compute Cloud (EC2) service.1
- Cloudflare develops many of its services, including its public DNS, serverless computing, and packet inspection offerings with Rust.2
- Dropbox rebuilt its backend warehouse, which manages exabytes of storage, with Rust.3
- Google develops parts of Android, such as its Bluetooth module, with Rust. Rust is also used for the
crosvm
component of Chrome OS and plays an important role in Google’s new operating system, Fuchsia.4 - Facebook uses Rust to power Facebook’s web, mobile, and API services, as well as parts of HHVM, the HipHop virtual machine used by the Hack programming language.5
- Microsoft writes components of its Azure platform including a security daemon for its Internet of Things (IoT) service in Rust.6
- Mozilla uses Rust to enhance the Firefox web browser, which contains 15 million lines of code. Mozilla’s first two Rust-in-Firefox projects, its MP4 metadata parser and text encoder/decoder, led to overall performance and stability improvements.
- GitHub’s npm, Inc., uses Rust to deliver “upwards of 1.3 billion package downloads per day.”7
- Oracle developed a container runtime with Rust to overcome problems with the Go reference implementation.8
- Samsung, via its subsidiary SmartThings, uses Rust in its Hub, which is the firmware backend for its Internet of Things (IoT) service.
- Sourcegraph uses Rust to serve syntax highlighting across all of its languages.9
- Figma employs Rust in the performance-critical components of its multi-player server.10
- Parity develops its client to the Ethereum blockchain with Rust.11
1.2 Advocating for Rust at work
indy on Sept 27, 2017 Is Rust an officially sanctioned language at Google? zaxcellent on Sept 27, 2017 Author here: Rust is not officially sanctioned at Google, but there are pockets of folks using it here. The trick with using Rust in this component was convincing my coworkers that no other language was right for job, which I believe to be the case in this instance. That being said, there was a ton of work getting Rust to play nice within the Chrome OS build environment. The Rust folks have been super helpful in answering my questions th...