Skip to content

Commit 8eef632

Browse files
authored
Merge pull request #131 from toku-sa-n/update_00
Update ch00-00
2 parents 38375a6 + e6af0a2 commit 8eef632

File tree

1 file changed

+60
-38
lines changed

1 file changed

+60
-38
lines changed

src/ch00-00-introduction.md

+60-38
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ Rustはまた、現代的な開発ツールをシステムプログラミング
8282

8383
<!--
8484
* 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.
8787
* Rustfmt ensures a consistent coding style across developers.
8888
* 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.
9090
-->
9191

9292
* Cargoは、付属の依存マネージャ兼ビルドツールで、依存を追加、コンパイル、管理することを楽かつ、
@@ -161,15 +161,11 @@ Rustは、Rustプログラミング言語やコミュニティ、開発者ツー
161161

162162
### スピードと安定性に価値を見出す方
163163

164-
<!--
165-
最後から3行目、zero-cost abstractions, higher-level featuresの繋がりがよくわからない。byが両者にかかっているように訳した
166-
-->
167-
168164
<!--
169165
Rust is for people who crave speed and stability in a language. By speed, we
170166
mean the speed of the programs that you can create with Rust and the speed at
171167
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
173169
legacy code in languages without these checks, which developers are often
174170
afraid to modify. By striving for zero-cost abstractions, higher-level features
175171
that compile to lower-level code as fast as code written manually, Rust
@@ -186,14 +182,14 @@ Rustは安全なコードを高速なコードにもしようと努力してい
186182
<!--
187183
The Rust language hopes to support many other users as well; those mentioned
188184
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.
192188
-->
193189

194190
Rust言語は他の多くのユーザのサポートも望んでいます; ここで名前を出した方は、
195-
ただの最大の出資者の一部です。総合すると、Rustの最大の野望は、プログラマが数十年間受け入れてきた代償を排除することです:
196-
つまり、安全性**生産性、スピード**エルゴノミクスです。Rustを試してみて、その選択が自分に合っているか確かめてください。
191+
ただの最大の出資者の一部です。総合すると、Rustの最大の野望は、プログラマが数十年間受け入れてきた代償を、安全性**生産性、
192+
スピード**エルゴノミクスを提供することで排除することです。Rustを試してみて、その選択が自分に合っているか確かめてください。
197193

198194
<!--
199195
## Who This Book Is For
@@ -243,21 +239,21 @@ Rustの一面を学ぶでしょう。プロジェクトの章では、それま
243239
2、12、20章がプロジェクトの章です。つまり、残りは概念の章です。
244240

245241
<!--
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,
247243
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
249245
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
251247
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
253249
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
255251
to skip Chapter 2 and go straight to Chapter 3, returning to Chapter 2 when
256252
you’d like to work on a project applying the details you’ve learned.
257253
-->
258254

259-
第1章はRustのインストール方法、Hello, world!プログラムの書き方、Rustのパッケージマネージャ兼、
260-
ビルドツールのCargoの使用方法を説明します。第2章は、Rust言語への実践的な導入です。概念を高度に講義し、後ほどの章で追加の詳細を提供します。
255+
第1章はRustのインストール方法、Hello, world!プログラムの書き方、Rustのパッケージマネージャ兼、
256+
ビルドツールのCargoの使用方法を説明します。第2章は、Rust言語への実践的な導入です。ここでは概念をざっくりと講義し、後ほどの章で追加の詳細を提供します。
261257
今すぐRustの世界に飛び込みたいなら、第2章こそがそのためのものです。第3章は他のプログラミング言語の機能に似たRustの機能を講義していますが、
262258
最初その3章すら飛ばして、まっすぐに第4章に向かい、Rustの所有権システムについて学びたくなる可能性があります。
263259
しかしながら、あなたが次に進む前に全ての詳細を学ぶことを好む特別に几帳面な学習者なら、
@@ -287,7 +283,7 @@ explores Rust’s error-handling philosophy and techniques.
287283
<!--
288284
Chapter 10 digs into generics, traits, and lifetimes, which give you the power
289285
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 Rusts safety guarantees is necessary to ensure your programs
291287
logic is correct. In Chapter 12, we’ll build our own implementation of a subset
292288
of functionality from the `grep` command line tool that searches for text
293289
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.
324320
<!--
325321
Chapter 18 is a reference on patterns and pattern matching, which are powerful
326322
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.
329325
-->
330326

331327
第18章は、パターンとパターンマッチングのリファレンスであり、これらはRustプログラムを通して、
332-
考えを表現する強力な方法になります。第19章は、unsafe Rustやライフタイム、トレイト、型、関数、クロージャの詳細を含む、
328+
考えを表現する強力な方法になります。第19章は、unsafe Rustやマクロ、ライフタイム、トレイト、型、関数、クロージャの詳細を含む、
333329
興味のある高度な話題のスモーガスボード(`訳注`: 日本でいうバイキングのこと)を含みます。
334330

335331
<!--
@@ -343,12 +339,14 @@ multithreaded web server!
343339
Finally, some appendixes contain useful information about the language in a
344340
more reference-like format. Appendix A covers Rust’s keywords, Appendix B
345341
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.
347344
-->
348345

349346
最後に、言語についての有用な情報をよりリファレンスのような形式で含む付録があります。
350347
付録AはRustのキーワードを講義し、付録Bは、Rustの演算子と記号、付録Cは、
351-
標準ライブラリが提供する導出可能なトレイト、付録Dはマクロを講義します。
348+
標準ライブラリが提供する導出可能なトレイト、付録Dはいくつか便利な開発ツールを講義し、
349+
付録EではRustのエディションについて説明します。
352350

353351
<!--
354352
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.
360358
混乱したら、前の章に戻らなければならない可能性もあります。ですが、自分に合った方法でどうぞ。
361359

362360
<!--
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>
371362
-->
372363

364+
<span id="ferris"></span>
365+
373366
<!--
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:
375374
-->
376375

377376
Rustを学ぶ過程で重要な部分は、コンパイラが表示するエラーメッセージを読む方法を学ぶことです:
378377
それは動くコードへと導いてくれます。そのため、各場面でコンパイラが表示するエラーメッセージとともに、
379-
コンパイルできないコードの例を多く提供します。適当に例を選んで走らせたら、コンパイルできないかもしれないことを知ってください!
378+
コンパイルできない例を多く提供します。適当に例を選んで走らせたら、コンパイルできないかもしれないことを知ってください!
380379
周りのテキストを読んで実行しようとしている例がエラーになることを意図しているのか確認することを確かめてください。
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+
381403
ほとんどの場合、コンパイルできないあらゆるコードの正しいバージョンへと導きます。
382404

383405
<!--
384-
## Source code
406+
## Source Code
385407
-->
386408

387409
## ソースコード
@@ -395,5 +417,5 @@ The source files from which this book is generated can be found on
395417

396418
> 訳注: 日本語版は[こちら][book-ja]です。
397419
398-
[book]: https://github.com/rust-lang/book/tree/master/second-edition/src
420+
[book]: https://github.com/rust-lang/book/tree/master/src
399421
[book-ja]: https://github.com/rust-lang-ja/book-ja

0 commit comments

Comments
 (0)