@@ -82,11 +82,11 @@ Rustはまた、現代的な開発ツールをシステムプログラミング
82
82
83
83
<!--
84
84
* Cargo, the included dependency manager and build tool, makes adding,
85
- compiling, and managing dependencies painless and consistent across the Rust
86
- ecosystem.
85
+ compiling, and managing dependencies painless and consistent across the Rust
86
+ ecosystem.
87
87
* Rustfmt ensures a consistent coding style across developers.
88
88
* The Rust Language Server powers Integrated Development Environment (IDE)
89
- integration for code completion and inline error messages.
89
+ integration for code completion and inline error messages.
90
90
-->
91
91
92
92
* Cargoは、付属の依存マネージャ兼ビルドツールで、依存を追加、コンパイル、管理することを楽かつ、
@@ -161,15 +161,11 @@ Rustは、Rustプログラミング言語やコミュニティ、開発者ツー
161
161
162
162
### スピードと安定性に価値を見出す方
163
163
164
- <!--
165
- 最後から3行目、zero-cost abstractions, higher-level featuresの繋がりがよくわからない。byが両者にかかっているように訳した
166
- -->
167
-
168
164
<!--
169
165
Rust is for people who crave speed and stability in a language. By speed, we
170
166
mean the speed of the programs that you can create with Rust and the speed at
171
167
which Rust lets you write them. The Rust compiler’s checks ensure stability
172
- through feature additions and refactoring. This is contrast to the brittle
168
+ through feature additions and refactoring. This is in contrast to the brittle
173
169
legacy code in languages without these checks, which developers are often
174
170
afraid to modify. By striving for zero-cost abstractions, higher-level features
175
171
that compile to lower-level code as fast as code written manually, Rust
@@ -186,14 +182,14 @@ Rustは安全なコードを高速なコードにもしようと努力してい
186
182
<!--
187
183
The Rust language hopes to support many other users as well; those mentioned
188
184
here are merely some of the biggest stakeholders. Overall, Rust’s greatest
189
- ambition is to eliminate trade-offs that programmers have accepted for
190
- decades: safety *and* productivity, speed *and* ergonomics. Give
191
- Rust a try, and see if its choices work for you.
185
+ ambition is to eliminate the trade-offs that programmers have accepted for
186
+ decades by providing safety *and* productivity, speed *and* ergonomics. Give
187
+ Rust a try and see if its choices work for you.
192
188
-->
193
189
194
190
Rust言語は他の多くのユーザのサポートも望んでいます; ここで名前を出した方は、
195
- ただの最大の出資者の一部です。総合すると、Rustの最大の野望は、プログラマが数十年間受け入れてきた代償を排除することです:
196
- つまり、安全性 * と * 生産性、 スピード* と* エルゴノミクスです 。Rustを試してみて、その選択が自分に合っているか確かめてください。
191
+ ただの最大の出資者の一部です。総合すると、Rustの最大の野望は、プログラマが数十年間受け入れてきた代償を、安全性 * と * 生産性、
192
+ スピード* と* エルゴノミクスを提供することで排除することです 。Rustを試してみて、その選択が自分に合っているか確かめてください。
197
193
198
194
<!--
199
195
## Who This Book Is For
@@ -243,21 +239,21 @@ Rustの一面を学ぶでしょう。プロジェクトの章では、それま
243
239
2、12、20章がプロジェクトの章です。つまり、残りは概念の章です。
244
240
245
241
<!--
246
- Chapter 1 explains how to install Rust, how to write a Hello, world! program,
242
+ Chapter 1 explains how to install Rust, how to write a “ Hello, world!” program,
247
243
and how to use Cargo, Rust’s package manager and build tool. Chapter 2 is a
248
- hands-on introduction to the Rust language. We’ll cover concepts at a high
244
+ hands-on introduction to the Rust language. Here we cover concepts at a high
249
245
level, and later chapters will provide additional detail. If you want to get
250
- your hands dirty right away, Chapter 2 is the one for that. At first, you
246
+ your hands dirty right away, Chapter 2 is the place for that. At first, you
251
247
might even want to skip Chapter 3, which covers Rust features similar to those
252
- of other programming language , and head straight to Chapter 4 to learn about
248
+ of other programming languages , and head straight to Chapter 4 to learn about
253
249
Rust’s ownership system. However, if you’re a particularly meticulous learner
254
- who prefers to learn every detail before moving onto the next, you might want
250
+ who prefers to learn every detail before moving on to the next, you might want
255
251
to skip Chapter 2 and go straight to Chapter 3, returning to Chapter 2 when
256
252
you’d like to work on a project applying the details you’ve learned.
257
253
-->
258
254
259
- 第1章はRustのインストール方法、Hello, world!プログラムの書き方、Rustのパッケージマネージャ兼、
260
- ビルドツールのCargoの使用方法を説明します。第2章は、Rust言語への実践的な導入です。概念を高度に講義し 、後ほどの章で追加の詳細を提供します。
255
+ 第1章はRustのインストール方法、“ Hello, world!” プログラムの書き方、Rustのパッケージマネージャ兼、
256
+ ビルドツールのCargoの使用方法を説明します。第2章は、Rust言語への実践的な導入です。ここでは概念をざっくりと講義し 、後ほどの章で追加の詳細を提供します。
261
257
今すぐRustの世界に飛び込みたいなら、第2章こそがそのためのものです。第3章は他のプログラミング言語の機能に似たRustの機能を講義していますが、
262
258
最初その3章すら飛ばして、まっすぐに第4章に向かい、Rustの所有権システムについて学びたくなる可能性があります。
263
259
しかしながら、あなたが次に進む前に全ての詳細を学ぶことを好む特別に几帳面な学習者なら、
@@ -287,7 +283,7 @@ explores Rust’s error-handling philosophy and techniques.
287
283
<!--
288
284
Chapter 10 digs into generics, traits, and lifetimes, which give you the power
289
285
to define code that applies to multiple types. Chapter 11 is all about testing,
290
- which even with Rust' s safety guarantees is necessary to ensure your program' s
286
+ which even with Rust’ s safety guarantees is necessary to ensure your program’ s
291
287
logic is correct. In Chapter 12, we’ll build our own implementation of a subset
292
288
of functionality from the `grep` command line tool that searches for text
293
289
within files. For this, we’ll use many of the concepts we discussed in the
@@ -324,12 +320,12 @@ principles you might be familiar with.
324
320
<!--
325
321
Chapter 18 is a reference on patterns and pattern matching, which are powerful
326
322
ways of expressing ideas throughout Rust programs. Chapter 19 contains a
327
- smorgasbord of advanced topics of interest, including unsafe Rust and more
328
- about lifetimes, traits, types, functions, and closures.
323
+ smorgasbord of advanced topics of interest, including unsafe Rust, macros, and
324
+ more about lifetimes, traits, types, functions, and closures.
329
325
-->
330
326
331
327
第18章は、パターンとパターンマッチングのリファレンスであり、これらはRustプログラムを通して、
332
- 考えを表現する強力な方法になります。第19章は、unsafe Rustやライフタイム 、トレイト、型、関数、クロージャの詳細を含む、
328
+ 考えを表現する強力な方法になります。第19章は、unsafe Rustやマクロ、ライフタイム 、トレイト、型、関数、クロージャの詳細を含む、
333
329
興味のある高度な話題のスモーガスボード(` 訳注 ` : 日本でいうバイキングのこと)を含みます。
334
330
335
331
<!--
@@ -343,12 +339,14 @@ multithreaded web server!
343
339
Finally, some appendixes contain useful information about the language in a
344
340
more reference-like format. Appendix A covers Rust’s keywords, Appendix B
345
341
covers Rust’s operators and symbols, Appendix C covers derivable traits
346
- provided by the standard library, Appendix D covers macros.
342
+ provided by the standard library, Appendix D covers some useful development
343
+ tools, and Appendix E explains Rust editions.
347
344
-->
348
345
349
346
最後に、言語についての有用な情報をよりリファレンスのような形式で含む付録があります。
350
347
付録AはRustのキーワードを講義し、付録Bは、Rustの演算子と記号、付録Cは、
351
- 標準ライブラリが提供する導出可能なトレイト、付録Dはマクロを講義します。
348
+ 標準ライブラリが提供する導出可能なトレイト、付録Dはいくつか便利な開発ツールを講義し、
349
+ 付録EではRustのエディションについて説明します。
352
350
353
351
<!--
354
352
There is no wrong way to read this book: if you want to skip ahead, go for it!
@@ -360,28 +358,52 @@ confusion. But do whatever works for you.
360
358
混乱したら、前の章に戻らなければならない可能性もあります。ですが、自分に合った方法でどうぞ。
361
359
362
360
<!--
363
- An important part of the process of learning Rust is learning how to read the
364
- error messages the compiler displays: these will guide you toward working code.
365
- As such, we’ll provide many examples of code that doesn’t compile along with
366
- the error message the compiler will show you in each situation. Know that if
367
- you enter and run a random example, it may not compile! Make sure you read the
368
- surrounding text to see whether the example you’re trying to run is meant to
369
- error. In most situations, we’ll lead you to the correct version of any code
370
- that doesn’t compile.
361
+ <span id="ferris"></span>
371
362
-->
372
363
364
+ <span id =" ferris " ></span >
365
+
373
366
<!--
374
- NOTE: docs.rust-lang.orgにあるバージョンだとFerrisに関する追記があるが、2nd editionで必要なのか、確認が必要
367
+ An important part of the process of learning Rust is learning how to read the
368
+ error messages the compiler displays: these will guide you toward working code.
369
+ As such, we’ll provide many examples that don’t compile along with the error
370
+ message the compiler will show you in each situation. Know that if you enter
371
+ and run a random example, it may not compile! Make sure you read the
372
+ surrounding text to see whether the example you’re trying to run is meant to
373
+ error. Ferris will also help you distinguish code that isn’t meant to work:
375
374
-->
376
375
377
376
Rustを学ぶ過程で重要な部分は、コンパイラが表示するエラーメッセージを読む方法を学ぶことです:
378
377
それは動くコードへと導いてくれます。そのため、各場面でコンパイラが表示するエラーメッセージとともに、
379
- コンパイルできないコードの例を多く提供します 。適当に例を選んで走らせたら、コンパイルできないかもしれないことを知ってください!
378
+ コンパイルできない例を多く提供します 。適当に例を選んで走らせたら、コンパイルできないかもしれないことを知ってください!
380
379
周りのテキストを読んで実行しようとしている例がエラーになることを意図しているのか確認することを確かめてください。
380
+ フェリスもコードが動作するとは意図されていないコードを見分けるのを手助けしてくれます:
381
+
382
+ <!--
383
+ | Ferris | Meaning |
384
+ |------------------------------------------------------------------------|--------------------------------------------------|
385
+ | <img src="img/ferris/does_not_compile.svg" class="ferris-explain"/> | This code does not compile! |
386
+ | <img src="img/ferris/panics.svg" class="ferris-explain"/> | This code panics! |
387
+ | <img src="img/ferris/unsafe.svg" class="ferris-explain"/> | This code block contains unsafe code. |
388
+ | <img src="img/ferris/not_desired_behavior.svg" class="ferris-explain"/>| This code does not produce the desired behavior. |
389
+ -->
390
+
391
+ | Ferris | Meaning |
392
+ | ------------------------------------------------------------------------| --------------------------------------------------|
393
+ | <img src =" img/ferris/does_not_compile.svg " class =" ferris-explain " /> | このコードはコンパイルできません! |
394
+ | <img src =" img/ferris/panics.svg " class =" ferris-explain " /> | このコードはパニックします! |
395
+ | <img src =" img/ferris/unsafe.svg " class =" ferris-explain " /> | このコードはアンセーフなコードを含みます。 |
396
+ | <img src =" img/ferris/not_desired_behavior.svg " class =" ferris-explain " />| このコードは求められている振る舞いをしません。 |
397
+
398
+ <!--
399
+ In most situations, we’ll lead you to the correct version of any code that
400
+ doesn’t compile.
401
+ -->
402
+
381
403
ほとんどの場合、コンパイルできないあらゆるコードの正しいバージョンへと導きます。
382
404
383
405
<!--
384
- ## Source code
406
+ ## Source Code
385
407
-->
386
408
387
409
## ソースコード
@@ -395,5 +417,5 @@ The source files from which this book is generated can be found on
395
417
396
418
> 訳注: 日本語版は[ こちら] [ book-ja ] です。
397
419
398
- [ book ] : https://github.com/rust-lang/book/tree/master/second-edition/ src
420
+ [ book ] : https://github.com/rust-lang/book/tree/master/src
399
421
[ book-ja ] : https://github.com/rust-lang-ja/book-ja
0 commit comments