Skip to Content
Effective Rust ―Rustコードを改善し、エコシステムを最大限に活用するための35項目
book

Effective Rust ―Rustコードを改善し、エコシステムを最大限に活用するための35項目

by David Drysdale, 中田 秀基
November 2024
Intermediate to advanced
304 pages
4h 24m
Japanese
O'Reilly Japan, Inc.
Content preview from Effective Rust ―Rustコードを改善し、エコシステムを最大限に活用するための35項目

まえがき

コードはルールというよりは、どちらかというとただの「ガイドライン」だ。

ヘクター・バルボッサ†1

[†1] 訳注:パイレーツ・オブ・カリビアンの登場人物。この文の「コード」は作中では海賊の掟を指す。

現在、プログラミング言語はたくさんあるが、Rustは他の言語とは違う。Rustはコンパイル言語の速度と、ガベージコレクションのない言語の効率性と、関数型言語の型安全性とを併せ持ち、メモリ安全性問題をユニークな方法で解決する。この結果、Rustは最も愛されたプログラミング言語の常連となっている(https://oreil.ly/KKcb6)。

Rustの型システムは強力で一貫しているので、Rustで書かれたプログラムは、コンパイルできてしまえば高い確率で動作する。Rust以前では、これはアカデミックな環境でしか使われていないHaskellのような言語でのみ見られた現象だ。Rustプログラムはコンパイルできたら「安全に」動作する。

ただし、この安全性(型安全性とメモリの安全性)にはコストが伴う。Rustの基本的なドキュメントの質は高いにもかかわらず、学習曲線が急峻だと言われている。初心者は借用チェッカと戦い、データ構造を再設計し、生存期間に混乱するという通過儀礼をくぐりぬけなければならない。コンパイルできたRustプログラムは、高い確率でそのまま動くかもしれないが、コンパイルを通すこと自体が難しい、とよく言われるが、それは本当だ。Rustコンパイラは非常にわかりやすいエラーメッセージを出してくれるが、それでもなお難しい。

本書の対象読者

C++などの他のコンパイル言語経験者のプログラマでも、Rustではいくつかの分野で苦労する。本書はそのような分野での補助となることを目指している。したがって、他の ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Effective Rust

Effective Rust

David Drysdale
Hands-on Rust

Hands-on Rust

Herbert Wolverson
Command-Line Rust

Command-Line Rust

Ken Youens-Clark

Publisher Resources

ISBN: 9784814400942Publisher Website