Rust in Action
eBook - ePub

Rust in Action

Tim McNamara

Partager le livre
  1. 456 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Rust in Action

Tim McNamara

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

"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

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Rust in Action est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Rust in Action par Tim McNamara en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et Lenguajes de programaciĂłn. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Éditeur
Manning
Année
2021
ISBN
9781638356226

1 Introducing Rust

This chapter covers
  • 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
Welcome to Rust—the empowering programming language. Once you scratch its surface, you will not only find a programming language with unparalleled speed and safety, but one that is enjoyable enough to use every day.
When you begin to program in Rust, it’s likely that you will want to continue to do so. And this book, Rust in Action, will build your confidence as a Rust programmer. But it will not teach you how to program from the beginning. This book is intended to be read by people who are considering Rust as their next language and for those who enjoy implementing practical working examples. Here is a list of some of the larger examples this book includes:
  • Mandelbrot set renderer
  • A grep clone
  • CPU emulator
  • Generative art
  • A database
  • HTTP, NTP, and hexdump clients
  • LOGO language interpreter
  • Operating system kernel
As you may gather from scanning through that list, reading this book will teach you more than just Rust. It also introduces you to systems programming and low-level programming. As you work through Rust in Action, you’ll learn about the role of an operating system (OS), how a CPU works, how computers keep time, what pointers are, and what a data type is. You will gain an understanding of how the computer’s internal systems interoperate. Learning more than syntax, you will also see why Rust was created and the challenges that it addresses.

1.1 Where is Rust used?

Rust has won the “most loved programming language” award in Stack Overflow’s annual developer survey every year in 2016-2020. Perhaps that’s why large technology leaders such as the following have adopted Rust:
  • 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.
Rust is also productive enough for fast-moving startups to deploy it. Here are a few examples:
  • 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

What is it like to advocate for Rust at work? After overcoming the initial hurdle, it tends to go well. A 2017 discussion, reprinted below, provides a nice anecdote. One member of Google’s Chrome OS team discusses what it was like to introduce the language to the project:12
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...

Table des matiĂšres