Lecture:
Exercise:
- Rust Book, Brown University with great quizzes: https://rust-book.cs.brown.edu/
- Rust by Example: https://doc.rust-lang.org/rust-by-example/index.html
- Walk through the rustlings tutorial: https://github.com/rust-lang/rustlings
- Finish all Exercises for Session 1 in Rust
Prepare the exercises in the following list according to the sessions they are assigned to. Each exercise should take about 30min to complete, if approached right. Make use of any tool at your disposal and do work in groups to reflect upon the different solutions possible:
Credit: The exercises are taken from Exercism, you can find many other languages to practice there and a helpful community. You can also find solutions to each exercise. In you own interest, only look at these solutions after spending at least 30min on an honest attempt to each exercise.
The course is taught in a Flipped Classroom style. You are required to prepare coding exercises and will be asked to present them in front of class on a random selection basis.
- 30 min | Review and joint development of selected Homework Exercises
- 60 min | Theoretical input on computational thinking with Algorithms and Data Structures.
- 90 min | Applying theoretical input in a hands-on class project: Building the Game of Clack.
The Exam will be written and online. It will be a code exercise just like the ones you practice with tests provided.
-
Types: Data Types and Rust Tooling (Chapter 1-3) | Exercises R01
-
Memory Management: Mutability and Ownership (Chapter 3-6)
-
System Design: Error Handling, Crates and Modules (Chapter 7-8)
-
Object-Oriented-Design: Structs, Enums and Patterns Chapter 9-10)
-
Encapsulation and Abstraction: Traits and Generics, Operator Overloading (Chapter 11-13)
-
Functional Programming: Closures, Iterators and Collections (Chapter 14-16)
-
Input and Output: Strings, Text and IO (Chapter 17-18)
-
Algorithms Analysis, Design and Evaluation (Chapter 1-4)
-
Sorting and Ordering (Chapter 6-8)
-
Lists, Maps and Sets (Chapter 10-11)
-
Trees (Chapter 12-13)
-
Dynamic Programming (Chapter 14)
-
Greedy Algorithms and Backtracking (Chapter 15)
-
Amortized Analysis (Chapter 16)
-
Review and Mock Exam
Learning Goals:
- Understand why are types important for programming in General
- Understand how can types help support efficiency, safety, and security
- Know basic types in Rust and understand how they compare to Python
- Understand the differences between scalar types, compound types, and structs
- Apply Numeric Types, Strings, and Pointers in your programs.
- Apply Tuples, Arrays, Vectors, and Hashmaps in your programs.
-
Exercise Review
-
Lecture
- Why do we need types and what can we do with them?
- Project
- Creating preliminary Data Structure and Logic for our Game of Clack
Learning Goals:
- Understand head and stack and their usage and implications for structuring programs
- Understand the need for and pitfalls of pointers
- Understand the difference between mutable and immutable types
- Understand how C, Python and Rust handle memory
- Understand Ownership and Borrowing and Rust for both mutable and immutable types
- Analyse and resolve issues arising from Ownership and Borrowing in your own code
Additional Reading:
The detailed content of each Session will be added here during the term.
Learning Goals:
- Understand and apply important principles of systems design
- Know and apply the Separation of Concerns principle
- Know and apply the Don't Repeat Yourself Principle
- <TODO: Add other principles>
-
Exercise Review
-
Lecture
-
Project
- String Conversion: https://stackoverflow.com/questions/41034635/how-do-i-convert-between-string-str-vecu8-and-u8
Reading: