Rust intro: Compiled, like C/C++ Not like Python Intended for general and system programming build with rustc .rs extension, build with rustc example, hello world cargo is used more often than rustc directly example, "cargo new " It handles dependencies and such Large programs aren't built with g++ directly either Build with --release to add optimization instead of debug symbols Where'd it come from? Mozilla Research, started around 2010 That's when Mozilla announced the project, anyway Intended to support more reliable programs than C++ How to learn rust: rust-lang.org Let's start by learning to build rust programs cargo, management, and packages This isn't strictly part of the language, but is built-in To avoid problems like I've had building nvpro So let's just build some simple examples! hello world example Let's go through my little examples from nimrod Caveat: I did write these a year ago Went through them to refresh my memory stay out of struct until later, but functions, loops, pass_test, are ok A little more advanced: Object-Oriented programming Java: Really really object oriented, and this is enforced C++: However object-oriented you'd like Rust: Medium Python: Medium C: Just make your own object-oriented system with pointers and strange math impl and struct: Why did C++ not separate class data members and methods this way? Just my opinion, but this idea was really obvious Probably I like it because it reminds me of C Boxes: Heap allocation It's a heap-allocated structure, so put something in a box if you want it on a heap Boxes are transparent, so you can easily change allocation method Unlike C, where it might have strange caveats and widespread implications Exceptions: Not really, these are slow and complicated Instead, functions can return an error instead of a value Error-handling is expected, wheras exceptions are often left to terminate the program Shall we try not to handle the error in error_return.rs? if is an expression, can be used with let, all branches must return the same type if requires a boolean function return semicolon vs. expression loop: If you intend to customize the exit point anyway Is an expression! Evaluates to value after break while: Basically normal Doesn't look like an expression for: Range-based, like everything but C and derivatives .iter for collections shadowing match let, mutable, etc Shallow copy vs. move, and ownership Something must own each heap object A shallow copy will actually invalidate the original called a "move" .clone method for deep copy (on string anyway) struct and impl Basically adding methods