From 83283c0d4ca5f797e505f511b418c3a2f6472d8c Mon Sep 17 00:00:00 2001 From: P1start Date: Mon, 30 Jun 2014 16:41:13 +1200 Subject: [rust/en] Add an English Rust tutorial Fixes #480. --- rust.html.markdown | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 rust.html.markdown (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown new file mode 100644 index 00000000..532362d1 --- /dev/null +++ b/rust.html.markdown @@ -0,0 +1,245 @@ +--- +language: rust +contributors: + - ["P1start", "http://p1start.github.io/"] +filename: learnrust.rs +--- + +Rust is an in-development programming language developed by Mozilla Research. +It is relatively unique among systems languages in that it can assert memory +safety *at compile time*. Rust’s first alpha release occurred in January +2012, and development moves so quickly that at the moment the use of stable +releases is discouraged, and instead one should use nightly builds. + +Although Rust is a relatively low-level language, Rust has some functional +concepts that are generally found in higher-level languages. This makes +Rust not only fast, but also easy and efficient to code in. + +```rust +// This is a comment. Single-line look like this... +/* ...and multi-line comment look like this */ + +/////////////// +// 1. Basics // +/////////////// + +// Functions +fn add2(x: int, y: int) -> int { + // Implicit return (no semicolon) + x + y +} + +// Main function +fn main() { + // Numbers // + + // Immutable bindings + let x: int = 1; + + // Integer/float suffixes + let y: int = 13i; + let f: f64 = 1.3f64; + + // Type inference + let implicit_x = 1i; + let implicit_f = 1.3f64; + + // Maths + let sum = x + y + 13i; + + // Mutable variable + let mut mutable = 1; + mutable += 2; + + // Strings // + + // String literals + let x: &'static str = "hello world!"; + + // Printing + println!("{} {}", f, x); // 1.3 hello world + + // A `String` + let s: String = "hello world".to_string(); + + // A string slice - a view into another string + let s_slice: &str = s.as_slice(); + + ////////////// + // 2. Types // + ////////////// + + // Struct + struct Point { + x: int, + y: int, + } + + let origin: Point = Point { x: 0, y: 0 }; + + // Tuple struct + struct Point2(int, int); + + let origin2 = Point2(0, 0); + + // Basic C-like enum + enum Direction { + Left, + Right, + Up, + Down, + } + + let up = Up; + + // Enum with fields + enum OptionalInt { + AnInt(int), + Nothing, + } + + let two: OptionalInt = AnInt(2); + let nothing: OptionalInt = Nothing; + + // Generics // + + struct Foo { bar: T } + + // This is defined in the standard library as `Option` + enum Optional { + SomeVal(T), + NoVal, + } + + // Methods // + + impl Foo { + // Methods take an explicit `self` parameter + fn get_bar(self) -> T { + self.bar + } + } + + let a_foo = Foo { bar: 1i }; + println!("{}", a_foo.get_bar()); // 1 + + // Traits (interfaces) // + + trait Frobnicate { + fn frobnicate(self) -> Option; + } + + impl Frobnicate for Foo { + fn frobnicate(self) -> Option { + Some(self.bar) + } + } + + println!("{}", a_foo.frobnicate()); // Some(1) + + ///////////////////////// + // 3. Pattern matching // + ///////////////////////// + + let foo = AnInt(1); + match foo { + AnInt(n) => println!("it’s an int: {}", n), + Nothing => println!("it’s nothing!"), + } + + // Advanced pattern matching + struct FooBar { x: int, y: OptionalInt } + let bar = FooBar { x: 15, y: AnInt(32) }; + + match bar { + FooBar { x: 0, y: AnInt(0) } => + println!("The numbers are zero!"), + FooBar { x: n, y: AnInt(m) } if n == m => + println!("The numbers are the same"), + FooBar { x: n, y: AnInt(m) } => + println!("Different numbers: {} {}", n, m), + FooBar { x: _, y: Nothing } => + println!("The second number is Nothing!"), + } + + ///////////////////// + // 4. Control flow // + ///////////////////// + + // `for` loops/iteration + let array = [1i, 2, 3]; + for i in array.iter() { + println!("{}", i); + } + + for i in range(0u, 10) { + print!("{} ", i); + } + println!(""); + // prints `0 1 2 3 4 5 6 7 8 9 ` + + // `if` + if 1i == 1 { + println!("Maths is working!"); + } else { + println!("Oh no..."); + } + + // `if` as expression + let value = if true { + "good" + else { + "bad" + }; + + // `while` loop + while 1i == 1 { + println!("The universe is operating normally."); + } + + // Infinite loop + loop { + println!("Hello!"); + } + + ///////////////////////////////// + // 5. Memory safety & pointers // + ///////////////////////////////// + + // Owned pointer - only one thing can ‘own’ this pointer at a time + let mut mine: Box = box 3; + *mine = 5; // dereference + let mut now_its_mine = mine; + *now_its_mine += 2; + println!("{}", now_its_mine); // 7 + // println!("{}", mine); // this would error + + // Reference - an immutable pointer that refers to other data + let mut var = 4i; + var = 3; + let ref_var: &int = &var; + println!("{}", var); // Unlike `box`, `var` can still be used + println!("{}", *ref_var); + // var = 5; // this would error + // *ref_var = 6; // this would too + + // Mutable reference + let mut var2 = 4i; + let ref_var2: &mut int = &mut var2; + *ref_var2 += 2; + println!("{}", *ref_var2); // 6 + // var2 = 2; // this would error +} +``` + +## Further reading + +There’s a lot more to Rust—this is just the basics of Rust so you can +understand the most important things. To learn more about Rust, read the +[Rust tutorial](http://doc.rust-lang.org/tutorial.html) and check out the +[/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel +on irc.mozilla.org are also always keen to help newcomers. + +You can also try out features of Rust with an online compiler at the official +[Rust playpen](http://play.rust-lang.org) or on the main +[Rust website](http://rust-lang.org). -- cgit v1.2.3 From 9874c063d32e1b9affffac7cca457ffe977c5d71 Mon Sep 17 00:00:00 2001 From: P1start Date: Tue, 1 Jul 2014 15:24:08 +1200 Subject: add &str explanation; add section on vectors --- rust.html.markdown | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 532362d1..0b9a5e58 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -59,12 +59,32 @@ fn main() { // Printing println!("{} {}", f, x); // 1.3 hello world - // A `String` + // A `String` - a heap-allocated string let s: String = "hello world".to_string(); - // A string slice - a view into another string + // A string slice - an immutable view into another string + // This is basically an immutable pointer to a string - it doesn’t + // actually contain the characters of a string, just a pointer to + // something that does (in this case, `s`) let s_slice: &str = s.as_slice(); + println!("{} {}", s, s_slice); // hello world hello world + + // Vectors/arrays // + + // A fixed-size array + let four_ints: [int, ..4] = [1, 2, 3, 4]; + + // A dynamically-sized vector + let mut vector: Vec = vec![1, 2, 3, 4]; + vector.push(5); + + // A slice - an immutable view into a vector or array + // This is much like a string slice, but for vectors + let slice: &[int] = vector.as_slice(); + + println!("{} {}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] + ////////////// // 2. Types // ////////////// @@ -188,7 +208,7 @@ fn main() { // `if` as expression let value = if true { "good" - else { + } else { "bad" }; -- cgit v1.2.3 From 8768176023c4bb2efaea70ed19a89831e67fd402 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Tue, 14 Oct 2014 16:42:39 -0400 Subject: Rust tutorial -> The Rust Guide Previous link is deprecated --- rust.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 0b9a5e58..3717a7d9 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -255,8 +255,8 @@ fn main() { ## Further reading There’s a lot more to Rust—this is just the basics of Rust so you can -understand the most important things. To learn more about Rust, read the -[Rust tutorial](http://doc.rust-lang.org/tutorial.html) and check out the +understand the most important things. To learn more about Rust, read [The Rust +Guide](http://doc.rust-lang.org/guide.html) and check out the [/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel on irc.mozilla.org are also always keen to help newcomers. -- cgit v1.2.3 From ecc5d89841ec2417c8d68f0c84347760cf69c140 Mon Sep 17 00:00:00 2001 From: P1start Date: Thu, 15 Jan 2015 15:14:19 +1300 Subject: [rust/en] Update the Rust tutorial This adjusts the English Rust tutorial for changes to the language and generally tweaks a few other things. Fixes #860. --- rust.html.markdown | 169 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 67 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 3717a7d9..dcb54733 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -7,9 +7,13 @@ filename: learnrust.rs Rust is an in-development programming language developed by Mozilla Research. It is relatively unique among systems languages in that it can assert memory -safety *at compile time*. Rust’s first alpha release occurred in January -2012, and development moves so quickly that at the moment the use of stable -releases is discouraged, and instead one should use nightly builds. +safety *at compile time* without resorting to garbage collection. Rust’s first +release, 0.1, occurred in January 2012, and development moves so quickly that at +the moment the use of stable releases is discouraged, and instead one should use +nightly builds. On January 9 2015, Rust 1.0 Alpha was released, and the rate of +changes to the Rust compiler that break existing code has dropped significantly +since. However, a complete guarantee of backward compatibility will not exist +until the final 1.0 release. Although Rust is a relatively low-level language, Rust has some functional concepts that are generally found in higher-level languages. This makes @@ -24,7 +28,8 @@ Rust not only fast, but also easy and efficient to code in. /////////////// // Functions -fn add2(x: int, y: int) -> int { +// `i32` is the type for 32-bit signed integers +fn add2(x: i32, y: i32) -> i32 { // Implicit return (no semicolon) x + y } @@ -34,71 +39,90 @@ fn main() { // Numbers // // Immutable bindings - let x: int = 1; + let x: i32 = 1; // Integer/float suffixes - let y: int = 13i; + let y: i32 = 13i32; let f: f64 = 1.3f64; // Type inference - let implicit_x = 1i; - let implicit_f = 1.3f64; + // Most of the time, the Rust compiler can infer what type a variable is, so + // you don’t have to write an explicit type annotation. + // Throughout this tutorial, types are explicitly annotated in many places, + // but only for demonstrative purposes. Type inference can handle this for + // you most of the time. + let implicit_x = 1; + let implicit_f = 1.3; - // Maths - let sum = x + y + 13i; + // Arithmetic + let sum = x + y + 13; // Mutable variable let mut mutable = 1; + mutable = 4; mutable += 2; // Strings // - + // String literals - let x: &'static str = "hello world!"; + let x: &str = "hello world!"; // Printing println!("{} {}", f, x); // 1.3 hello world - // A `String` - a heap-allocated string + // A `String` – a heap-allocated string let s: String = "hello world".to_string(); - // A string slice - an immutable view into another string - // This is basically an immutable pointer to a string - it doesn’t - // actually contain the characters of a string, just a pointer to + // A string slice – an immutable view into another string + // This is basically an immutable pointer to a string – it doesn’t + // actually contain the contents of a string, just a pointer to // something that does (in this case, `s`) - let s_slice: &str = s.as_slice(); + let s_slice: &str = &*s; println!("{} {}", s, s_slice); // hello world hello world // Vectors/arrays // // A fixed-size array - let four_ints: [int, ..4] = [1, 2, 3, 4]; + let four_ints: [i32; 4] = [1, 2, 3, 4]; - // A dynamically-sized vector - let mut vector: Vec = vec![1, 2, 3, 4]; + // A dynamic array (vector) + let mut vector: Vec = vec![1, 2, 3, 4]; vector.push(5); - // A slice - an immutable view into a vector or array + // A slice – an immutable view into a vector or array // This is much like a string slice, but for vectors - let slice: &[int] = vector.as_slice(); + let slice: &[i32] = &*vector; + + // Use `{:?}` to print something debug-style + println!("{:?} {:?}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] + + // Tuples // - println!("{} {}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] + // A tuple is a fixed-size set of values of possibly different types + let x: (i32, &str, f64) = (1, "hello", 3.4); + + // Destructuring `let` + let (a, b, c) = x; + println!("{} {} {}", a, b, c); // 1 hello 3.4 + + // Indexing + println!("{}", x.1); // hello ////////////// // 2. Types // ////////////// - + // Struct struct Point { - x: int, - y: int, + x: i32, + y: i32, } let origin: Point = Point { x: 0, y: 0 }; - // Tuple struct - struct Point2(int, int); + // A struct with unnamed fields, called a ‘tuple struct’ + struct Point2(i32, i32); let origin2 = Point2(0, 0); @@ -110,16 +134,16 @@ fn main() { Down, } - let up = Up; + let up = Direction::Up; // Enum with fields - enum OptionalInt { - AnInt(int), + enum OptionalI32 { + AnI32(i32), Nothing, } - let two: OptionalInt = AnInt(2); - let nothing: OptionalInt = Nothing; + let two: OptionalI32 = OptionalI32::AnI32(2); + let nothing = OptionalI32::Nothing; // Generics // @@ -140,10 +164,10 @@ fn main() { } } - let a_foo = Foo { bar: 1i }; + let a_foo = Foo { bar: 1 }; println!("{}", a_foo.get_bar()); // 1 - // Traits (interfaces) // + // Traits (known as interfaces or typeclasses in other languages) // trait Frobnicate { fn frobnicate(self) -> Option; @@ -155,30 +179,31 @@ fn main() { } } - println!("{}", a_foo.frobnicate()); // Some(1) + let another_foo = Foo { bar: 1 }; + println!("{:?}", another_foo.frobnicate()); // Some(1) ///////////////////////// // 3. Pattern matching // ///////////////////////// - - let foo = AnInt(1); + + let foo = OptionalI32::AnI32(1); match foo { - AnInt(n) => println!("it’s an int: {}", n), - Nothing => println!("it’s nothing!"), + OptionalI32::AnI32(n) => println!("it’s an i32: {}", n), + OptionalI32::Nothing => println!("it’s nothing!"), } // Advanced pattern matching - struct FooBar { x: int, y: OptionalInt } - let bar = FooBar { x: 15, y: AnInt(32) }; + struct FooBar { x: i32, y: OptionalI32 } + let bar = FooBar { x: 15, y: OptionalI32::AnI32(32) }; match bar { - FooBar { x: 0, y: AnInt(0) } => + FooBar { x: 0, y: OptionalI32::AnI32(0) } => println!("The numbers are zero!"), - FooBar { x: n, y: AnInt(m) } if n == m => + FooBar { x: n, y: OptionalI32::AnI32(m) } if n == m => println!("The numbers are the same"), - FooBar { x: n, y: AnInt(m) } => + FooBar { x: n, y: OptionalI32::AnI32(m) } => println!("Different numbers: {} {}", n, m), - FooBar { x: _, y: Nothing } => + FooBar { x: _, y: OptionalI32::Nothing } => println!("The second number is Nothing!"), } @@ -187,19 +212,20 @@ fn main() { ///////////////////// // `for` loops/iteration - let array = [1i, 2, 3]; + let array = [1, 2, 3]; for i in array.iter() { println!("{}", i); } - for i in range(0u, 10) { + // Ranges + for i in 0u32..10 { print!("{} ", i); } println!(""); // prints `0 1 2 3 4 5 6 7 8 9 ` // `if` - if 1i == 1 { + if 1 == 1 { println!("Maths is working!"); } else { println!("Oh no..."); @@ -213,7 +239,7 @@ fn main() { }; // `while` loop - while 1i == 1 { + while 1 == 1 { println!("The universe is operating normally."); } @@ -225,40 +251,49 @@ fn main() { ///////////////////////////////// // 5. Memory safety & pointers // ///////////////////////////////// - - // Owned pointer - only one thing can ‘own’ this pointer at a time - let mut mine: Box = box 3; + + // Owned pointer – only one thing can ‘own’ this pointer at a time + // This means that when the `Box` leaves its scope, it can be automatically deallocated safely. + let mut mine: Box = Box::new(3); *mine = 5; // dereference + // Here, `now_its_mine` takes ownership of `mine`. In other words, `mine` is moved. let mut now_its_mine = mine; *now_its_mine += 2; + println!("{}", now_its_mine); // 7 - // println!("{}", mine); // this would error + // println!("{}", mine); // this would not compile because `now_its_mine` now owns the pointer - // Reference - an immutable pointer that refers to other data - let mut var = 4i; + // Reference – an immutable pointer that refers to other data + // When a reference is taken to a value, we say that the value has been ‘borrowed’. + // While a value is borrowed immutably, it cannot be mutated or moved. + // A borrow lasts until the end of the scope it was created in. + let mut var = 4; var = 3; - let ref_var: &int = &var; + let ref_var: &i32 = &var; + println!("{}", var); // Unlike `box`, `var` can still be used println!("{}", *ref_var); - // var = 5; // this would error - // *ref_var = 6; // this would too + // var = 5; // this would not compile because `var` is borrowed + // *ref_var = 6; // this would too, because `ref_var` is an immutable reference // Mutable reference - let mut var2 = 4i; - let ref_var2: &mut int = &mut var2; + // While a value is mutably borrowed, it cannot be accessed at all. + let mut var2 = 4; + let ref_var2: &mut i32 = &mut var2; *ref_var2 += 2; + println!("{}", *ref_var2); // 6 - // var2 = 2; // this would error + // var2 = 2; // this would not compile because `var2` is borrowed } ``` ## Further reading -There’s a lot more to Rust—this is just the basics of Rust so you can -understand the most important things. To learn more about Rust, read [The Rust -Guide](http://doc.rust-lang.org/guide.html) and check out the -[/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel -on irc.mozilla.org are also always keen to help newcomers. +There’s a lot more to Rust—this is just the basics of Rust so you can understand +the most important things. To learn more about Rust, read [The Rust Programming +Language](http://doc.rust-lang.org/book/index.html) and check out the +[/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel on +irc.mozilla.org are also always keen to help newcomers. You can also try out features of Rust with an online compiler at the official [Rust playpen](http://play.rust-lang.org) or on the main -- cgit v1.2.3 From 00a246e77b8cf8fd84812844de7bca78f220b2c5 Mon Sep 17 00:00:00 2001 From: Antonio Ognio Date: Fri, 15 May 2015 17:12:45 -0500 Subject: Updating rust.html.markdown for Rust 1.0 --- rust.html.markdown | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index dcb54733..17f7dc90 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -6,14 +6,21 @@ filename: learnrust.rs --- Rust is an in-development programming language developed by Mozilla Research. -It is relatively unique among systems languages in that it can assert memory -safety *at compile time* without resorting to garbage collection. Rust’s first -release, 0.1, occurred in January 2012, and development moves so quickly that at -the moment the use of stable releases is discouraged, and instead one should use -nightly builds. On January 9 2015, Rust 1.0 Alpha was released, and the rate of -changes to the Rust compiler that break existing code has dropped significantly -since. However, a complete guarantee of backward compatibility will not exist -until the final 1.0 release. +Rust combines low-level control over performance with high-level convenience and +safety guarantees. + +It achieves these goals without requiring a garbage collector or runtime, making +it possible to use Rust libraries as a "drop-in replacement" for C. + +Rust’s first release, 0.1, occurred in January 2012, and for 3 years development +moved so quickly that until recently the use of stable releases was discouraged +and instead the general advise was to use nightly builds. + +On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward +compatibility. Improvements to compile times and other aspects of the compiler are +currently available in the nightly builds. Rust has adopted a train-based release +model with regular releases every six weeks. Rust 1.1 beta was made available at +the same time of the release of Rust 1.0. Although Rust is a relatively low-level language, Rust has some functional concepts that are generally found in higher-level languages. This makes -- cgit v1.2.3 From 337710e13d726b91fd6cdde9e58d8c0db24c73f0 Mon Sep 17 00:00:00 2001 From: Jingwen Date: Sat, 13 Jun 2015 17:27:05 +0800 Subject: Fixed typo: changing an immutable ref will not compile --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 17f7dc90..49303b0d 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -281,7 +281,7 @@ fn main() { println!("{}", var); // Unlike `box`, `var` can still be used println!("{}", *ref_var); // var = 5; // this would not compile because `var` is borrowed - // *ref_var = 6; // this would too, because `ref_var` is an immutable reference + // *ref_var = 6; // this would not too, because `ref_var` is an immutable reference // Mutable reference // While a value is mutably borrowed, it cannot be accessed at all. -- cgit v1.2.3 From ad344ac7c68ecbfa55f5d7d50bc8b3e7c162f14b Mon Sep 17 00:00:00 2001 From: Esption Date: Wed, 17 Jun 2015 18:35:32 -0500 Subject: Rust: Change '&*' to '&' --- rust.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 17f7dc90..fbfa4cdf 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -84,7 +84,7 @@ fn main() { // This is basically an immutable pointer to a string – it doesn’t // actually contain the contents of a string, just a pointer to // something that does (in this case, `s`) - let s_slice: &str = &*s; + let s_slice: &str = &s; println!("{} {}", s, s_slice); // hello world hello world @@ -99,7 +99,7 @@ fn main() { // A slice – an immutable view into a vector or array // This is much like a string slice, but for vectors - let slice: &[i32] = &*vector; + let slice: &[i32] = &vector; // Use `{:?}` to print something debug-style println!("{:?} {:?}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] -- cgit v1.2.3 From 8d22be8f85339a73f4dcf09be4feefe1be9156b9 Mon Sep 17 00:00:00 2001 From: Michael Simpson Date: Mon, 22 Jun 2015 16:03:24 -0400 Subject: Remove in-development from Rust's description Now that Rust is stable at 1.0 saying "in-development" might not be appropriate any more. --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index fbfa4cdf..dd03acdd 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -5,7 +5,7 @@ contributors: filename: learnrust.rs --- -Rust is an in-development programming language developed by Mozilla Research. +Rust is a programming language developed by Mozilla Research. Rust combines low-level control over performance with high-level convenience and safety guarantees. -- cgit v1.2.3 From 5e11d06a4f131302956334e76c989fb935ad9709 Mon Sep 17 00:00:00 2001 From: Tim Heaney Date: Mon, 5 Oct 2015 22:19:59 -0400 Subject: Typo: should be advice, not advise. --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 4fbd6144..3157fcf4 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -14,7 +14,7 @@ it possible to use Rust libraries as a "drop-in replacement" for C. Rust’s first release, 0.1, occurred in January 2012, and for 3 years development moved so quickly that until recently the use of stable releases was discouraged -and instead the general advise was to use nightly builds. +and instead the general advice was to use nightly builds. On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward compatibility. Improvements to compile times and other aspects of the compiler are -- cgit v1.2.3 From 960ee4a1856db8eadb96277bb2422edfa8f2a81c Mon Sep 17 00:00:00 2001 From: Gabriel Halley Date: Wed, 7 Oct 2015 23:11:24 -0400 Subject: removing whitespace all over --- rust.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 3157fcf4..b2854b0c 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -6,20 +6,20 @@ filename: learnrust.rs --- Rust is a programming language developed by Mozilla Research. -Rust combines low-level control over performance with high-level convenience and -safety guarantees. +Rust combines low-level control over performance with high-level convenience and +safety guarantees. -It achieves these goals without requiring a garbage collector or runtime, making +It achieves these goals without requiring a garbage collector or runtime, making it possible to use Rust libraries as a "drop-in replacement" for C. -Rust’s first release, 0.1, occurred in January 2012, and for 3 years development +Rust’s first release, 0.1, occurred in January 2012, and for 3 years development moved so quickly that until recently the use of stable releases was discouraged -and instead the general advice was to use nightly builds. +and instead the general advice was to use nightly builds. -On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward +On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward compatibility. Improvements to compile times and other aspects of the compiler are currently available in the nightly builds. Rust has adopted a train-based release -model with regular releases every six weeks. Rust 1.1 beta was made available at +model with regular releases every six weeks. Rust 1.1 beta was made available at the same time of the release of Rust 1.0. Although Rust is a relatively low-level language, Rust has some functional -- cgit v1.2.3