Skip to content

Commit b89c4db

Browse files
committed
---
yaml --- r: 39914 b: refs/heads/dist-snap c: 38ccaed h: refs/heads/master v: v3
1 parent 8e7e3a7 commit b89c4db

File tree

2 files changed

+30
-33
lines changed

2 files changed

+30
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 4c833af038bec879c8124520c68e7f27034d41ab
10+
refs/heads/dist-snap: 38ccaed4ce0892bfa36c210302c42de1aa4dd584
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Rust is a programming language with a focus on type safety, memory
66
safety, concurrency and performance. It is intended for writing
7-
large-scale, high-performance software while preventing several
7+
large-scale, high-performance software that is free from several
88
classes of common errors. Rust has a sophisticated memory model that
99
encourages efficient data structures and safe concurrency patterns,
1010
forbidding invalid memory accesses that would otherwise cause
@@ -18,13 +18,14 @@ pleasant high-level features include:
1818
* **Type inference.** Type annotations on local variable declarations
1919
are optional.
2020
* **Safe task-based concurrency.** Rust's lightweight tasks do not share
21-
memory and communicate through messages.
21+
memory, instead communicating through messages.
2222
* **Higher-order functions.** Efficient and flexible closures provide
2323
iteration and other control structures
2424
* **Pattern matching and algebraic data types.** Pattern matching on
25-
Rust's enums is a compact and expressive way to encode program
26-
logic.
27-
* **Polymorphism.** Rust has type-parameric functions and
25+
Rust's enumeration types (a more powerful version of C's enums,
26+
similar to algebraic data types in functional languages) is a
27+
compact and expressive way to encode program logic.
28+
* **Polymorphism.** Rust has type-parametric functions and
2829
types, type classes and OO-style interfaces.
2930

3031
## Scope
@@ -35,23 +36,23 @@ type system and memory model, generics, and modules. [Additional
3536
tutorials](#what-next) cover specific language features in greater
3637
depth.
3738

38-
It assumes the reader is familiar with the basic concepts of
39+
This tutorial assumes that the reader is familiar with the basic concepts of
3940
programming, and has programmed in one or more other languages
40-
before. It will often make comparisons to other languages,
41+
before. We will often compare Rust to other languages,
4142
particularly those in the C family.
4243

4344
## Conventions
4445

45-
Throughout the tutorial, words that indicate language keywords or
46-
identifiers defined in example code are displayed in `code font`.
46+
Throughout the tutorial, language keywords and identifiers defined in
47+
example code are displayed in `code font`.
4748

4849
Code snippets are indented, and also shown in a monospaced font. Not
4950
all snippets constitute whole programs. For brevity, we'll often show
5051
fragments of programs that don't compile on their own. To try them
5152
out, you might have to wrap them in `fn main() { ... }`, and make sure
52-
they don't contain references to things that aren't actually defined.
53+
they don't contain references to names that aren't actually defined.
5354

54-
> ***Warning:*** Rust is a language under heavy development. Notes
55+
> ***Warning:*** Rust is a language under ongoing development. Notes
5556
> about potential changes to the language, implementation
5657
> deficiencies, and other caveats appear offset in blockquotes.
5758
@@ -77,9 +78,14 @@ You may find that other platforms work, but these are our "tier 1"
7778
supported build environments that are most likely to work.
7879

7980
> ***Note:*** Windows users should read the detailed
80-
> [getting started][wiki-start] notes on the wiki. Even when using
81-
> the binary installer the Windows build requires a MinGW installation,
82-
> the precise details of which are not discussed here.
81+
> "[getting started][wiki-start]" notes on the wiki. Even when using
82+
> the binary installer, the Windows build requires a MinGW installation,
83+
> the precise details of which are not discussed here. Finally, `rustc` may
84+
> need to be [referred to as `rustc.exe`][bug-3319]. It's a bummer, I
85+
> know.
86+
87+
[bug-3319]: https://github.com/mozilla/rust/issues/3319
88+
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
8389

8490
To build from source you will also need the following prerequisite
8591
packages:
@@ -90,8 +96,8 @@ packages:
9096
* gnu make 3.81 or later
9197
* curl
9298

93-
Assuming you're on a relatively modern *nix system and have met the
94-
prerequisites, something along these lines should work.
99+
If you've fulfilled those prerequisites, something along these lines
100+
should work.
95101

96102
~~~~ {.notrust}
97103
$ wget http://dl.rust-lang.org/dist/rust-0.4.tar.gz
@@ -104,7 +110,7 @@ $ make && make install
104110
You may need to use `sudo make install` if you do not normally have
105111
permission to modify the destination directory. The install locations
106112
can be adjusted by passing a `--prefix` argument to
107-
`configure`. Various other options are also supported, pass `--help`
113+
`configure`. Various other options are also supported: pass `--help`
108114
for more information on them.
109115

110116
When complete, `make install` will place several programs into
@@ -130,10 +136,10 @@ If the Rust compiler was installed successfully, running `rustc
130136
hello.rs` will produce an executable called `hello` (or `hello.exe` on
131137
Windows) which, upon running, will likely do exactly what you expect.
132138

133-
The Rust compiler tries to provide useful information when it runs
134-
into an error. If you modify the program to make it invalid (for
135-
example, by changing `io::println` to some nonexistent function), and
136-
then compile it, you'll see an error message like this:
139+
The Rust compiler tries to provide useful information when it encounters an
140+
error. If you introduce an error into the program (for example, by changing
141+
`io::println` to some nonexistent function), and then compile it, you'll see
142+
an error message like this:
137143

138144
~~~~ {.notrust}
139145
hello.rs:2:4: 2:16 error: unresolved name: io::print_with_unicorns
@@ -144,19 +150,10 @@ hello.rs:2 io::print_with_unicorns("hello? yes, this is rust");
144150
In its simplest form, a Rust program is a `.rs` file with some types
145151
and functions defined in it. If it has a `main` function, it can be
146152
compiled to an executable. Rust does not allow code that's not a
147-
declaration to appear at the top level of the fileall statements must
153+
declaration to appear at the top level of the file: all statements must
148154
live inside a function. Rust programs can also be compiled as
149155
libraries, and included in other programs.
150156

151-
> ***Note:*** There are some 'gotchas' to be aware of on
152-
> Windows. First, the MinGW environment must be set up
153-
> perfectly. Please read [the wiki][wiki-started]. Second, `rustc` may
154-
> need to be [referred to as `rustc.exe`][bug-3319]. It's a bummer, I
155-
> know.
156-
157-
[bug-3319]: https://github.com/mozilla/rust/issues/3319
158-
[wiki-started]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
159-
160157
## Editing Rust code
161158

162159
There are vim highlighting and indentation scripts in the Rust source
@@ -170,7 +167,7 @@ Sublime Text 2, available both [standalone][sublime] and through
170167
under `src/etc/kate`.
171168

172169
There is ctags support via `src/etc/ctags.rust`, but many other
173-
tools and editors are not provided for yet. If you end up writing a Rust
170+
tools and editors are not yet supported. If you end up writing a Rust
174171
mode for your favorite editor, let us know so that we can link to it.
175172

176173
[sublime]: http://github.com/dbp/sublime-rust

0 commit comments

Comments
 (0)