Skip to content

Hackerschool: Introduction to Rust

Photo of Chaitanya Baranwal
Hosted By
Chaitanya B.
Hackerschool: Introduction to Rust

Details

Sign up at https://bit.ly/hs-2019-rust

Rust is a systems programming language focused on zero-cost abstractions and safety, providing many of the features of modern, expressive languages, like pattern matching and destructuring, iterators, and algebraic data types, with as little overhead as possible compared to a handwritten version (like in C). Rust also provides compile-time checking of value ownership and thread-safety. Rust also brings with it a package manager, Cargo, providing the convenience loved by developers in other ecosystems, like .NET and Python.

  1. Preliminaries
  • Installing and managing Rust (rustup)
  • Rust's stable/nightly system, and why one may use multiple versions
  1. Hello world in Rust
  2. Things that most other languages have
  • Functions, let, const, types
  • Returning from a function, and the semicolon
  • Literals: integers, floats, booleans, characters, tuples, arrays, strings
  • Control flow: if, while, loop, for
  • Range expressions
  • Macro invocation
  • Structs and enums
  1. Things from functional languages
  • Pattern matching and destructuring: match, if let, let
  • Control flow with match, if let and while let
  • Lambdas/anonymous functions
  • Monadic error handling: Option, Result
  • Iterators
  1. The elephant in the room: Lifetimes
  • Ownership
  • Borrowing and references
  • Slices and the two string types: String and &str
  • Closures/lambdas that capture their environment
  1. Declaring your own types
  2. Traits and generics
  3. Modules
  4. Cargo
  • crates.io
  • Adding and using dependencies
  • Documentation
  1. Some suggestions on architecting Rust programs

Join this workshop for an introduction to the key features of Rust! Programming experience in any language is assumed, and experience with a non-garbage collected language like C or C++ will be very helpful. Remember to fully charge your laptop as power points may be limited, and see you there!

Photo of NUS Hackers group
NUS Hackers
See more events
Seminar Room 1, COM1
School of Computing, National University of Singapore · Singapore, al