finish part 14
[rust-101.git] / src / main.rs
1 // Welcome to Rust-101
2 // ===================
3 // 
4 // This is [Rust-101](https://www.ralfj.de/projects/rust-101/), a small *work-in-progress*
5 // tutorial for the [Rust language](http://www.rust-lang.org/).
6 // It is intended to be an interactive, hands-on course: I believe the only way to
7 // *really* learn a language is to write code in it, so you should be coding during
8 // the course.
9 // 
10 // If you have any questions that are not answered here, check out the "Additional Resources"
11 // below. In particular, the IRC channel is filled with awesome people willing to help you! I spent
12 // lots of time there ;-)
13 // 
14 // I will assume some familiarity with programming, and hence not explain the basic
15 // concepts common to most languages. Instead, I will focus on what makes Rust special.
16 //
17 // Why Rust?
18 // ---------
19 // 
20 // When you got here, I am kind of assuming that you already decided to give Rust at
21 // least a look, so that I don't have to do much convincing here ;-) . But just in
22 // case, here's why I think Rust is worth learning:<br/>
23 // At this time, Rust is a language with a pretty unique set of goals. Rust aims to
24 // achieve C++-style control over memory and execution behavior (like, static vs. dynamic
25 // dispatch), which makes it possible to construct abstractions that carry no run-time
26 // cost. This is combined with the comfort of high-level functional languages and guaranteed
27 // safety (as in, the program will not crash). The vast majority of existing
28 // languages sacrifices one of these goals for the other. In particular, the
29 // first requirement rules out a garbage collector: Rust can run "bare metal".
30 // In fact, Rust rules out more classes of bugs than languages that achieve safety
31 // with a GC: Besides dangling pointers and double-free, Rust also prevents issues
32 // such as iterator invalidation and data races.
33 // 
34 // 
35 // Getting started
36 // ---------------
37 // 
38 // You will need to have Rust installed, of course. It is available for download on
39 // [the Rust website](http://www.rust-lang.org/). You should go for either the "stable"
40 // or the "beta" channel. More detailed installation instructions are provided in
41 // [the second chapter of The Book](https://doc.rust-lang.org/stable/book/installing-rust.html).
42 // This will also install `cargo`, the tool responsible for building rust projects (or *crates*).
43
44 // Next, fetch the Rust-101 source code from the [git repository](http://www.ralfj.de/git/rust-101.git)
45 // (also available [on GitHub](https://github.com/RalfJung/rust-101), and as a
46 // [zip archive](https://github.com/RalfJung/rust-101/archive/master.zip) in case you don't have git installed).
47 // 
48 // There is a workspace prepared for you in the `workspace` folder. I suggest you copy this
49 // folder somewhere else - that will make it much easier to later update the course without
50 // overwriting your changes. Try `cargo build` in that new folder to check that compiling your workspace succeeds.
51 // (You can also execute it with `cargo run`, but you'll need to do some work before this will succeed.)
52 // 
53 // If you later want to update the course, do `git pull` (or re-download the zip archive).
54 // Then copy the files from `workspace/src/` to your workspace that you did not yet work on. Definitely
55 // copy `main.rs` to make sure all the new files are actually compiled. (Of course you can also
56 // copy the rest, but that would replace all your hard work by the original files with all the holes!)
57
58 // Course Content
59 // --------------
60 // 
61 // Open `your-workspace/src/part00.rs` in your favorite editor, and follow the link below for
62 // the explanations and exercises. Have fun!
63 // 
64 // ### Introduction
65 //
66 // * [Part 00: Algebraic datatypes](part00.html)
67 // * [Part 01: Expressions, Inherent methods](part01.html)
68 // * [Part 02: Generic types, Traits](part02.html)
69 // * [Part 03: Input](part03.html)
70 // 
71 // ### Basic Rust
72 // 
73 // * [Part 04: Ownership, Borrowing](part04.html)
74 // * [Part 05: Clone](part05.html)
75 // * [Part 06: Copy, Lifetimes](part06.html)
76 // * [Part 07: Operator Overloading, Tests, Formating](part07.html)
77 // * [Part 08: Associated Types, Modules](part08.html)
78 // * [Part 09: Iterators](part09.html)
79 // * [Part 10: Closures](part10.html)
80 // * [Part 11: Trait Objects, Box, Rc, Lifetime bounds](part11.html)
81 // * [Part 12: Concurrency, Arc, Send](part12.html)
82 // * [Part 13: Slices, Arrays, External Dependencies](part13.html)
83 // 
84 // ### Advanced Rust
85 // 
86 // * [Part 14: Mutex, Interior Mutability, Sync](part14.html)
87 // * (to be continued)
88 // 
89 #![allow(dead_code, unused_imports, unused_variables, unused_mut, unreachable_code)]
90 /* extern crate docopt; */
91 mod part00;
92 mod part01;
93 mod part02;
94 mod part03;
95 mod part04;
96 mod part05;
97 mod part06;
98 mod part07;
99 mod part08;
100 mod part09;
101 mod part10;
102 mod part11;
103 mod part12;
104 mod part13;
105 mod part14;
106 mod part15;
107
108 // To actually run the code of some part (after filling in the blanks, if necessary), simply edit the `main`
109 // function.
110 fn main() {
111     part00::main();
112 }
113
114
115 // Additional material
116 // -------------------
117 // 
118 // There's tons of useful Rust stuff out there, so let me just put links to some
119 // of the most interesting places here:
120 // 
121 // * [The Rust Book](https://doc.rust-lang.org/stable/book/)
122 // * [Rust by Example](http://rustbyexample.com/)
123 // * The [Rust Subreddit](https://www.reddit.com/r/rust/)
124 // * For the IRC channel and other forums, see the "Community" section of the [Rust Documentation index](http://doc.rust-lang.org/index.html)