-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Intro slides: https://slides.com/johanneskoester/praxisprojekt-rust-ws-2023-2024
We learn Rust via a combination of reading through the official Rust book and completing corresponding exercises. Use an editor of your choice to conduct the exercises. A very popular choice is Visual Studio Code.
- Install Rust on your system as instructed in chapter 1.1 of the Rust book.
- Read through chapter 1.2 in the Rust book and conduct the presented exercises.
- Next, read through chapter 2 in the Rust book and conduct the presented exercises.
Install rustlings as instructed here.
Use rustlings watch as instructed on the rustlings page and run through the exercises step by step.
Before each exercise, carefully read the corresponding book chapter as listed below.
Note: There is an experimental version of the Rust book which aims to further improve its readability by adding more visualizations, sometimes rephrasing stuff, and introducing little quizzes. If problems occur while trying to understand the official Rust book, this alternative version might help.
| Exercise | Book Chapter |
|---|---|
| variables | §3.1 |
| functions | §3.3 |
| if | §3.5 |
| primitive_types | §3.2, §4.3 |
| vecs | §8.1 |
| move_semantics | §4.1, §4.2 |
| structs | §5.1, §5.3 |
| enums | §6, §18.3 |
| strings | §8.2 |
| modules | §7 |
| hashmaps | §8.3 |
| options | §10.1 |
| error_handling | §9 |
| generics | §10,§10.1 |
| traits | §10.2 |
| tests | §11.1 |
| lifetimes | §10.3 |
| iterators | §13.2,§13.3,§13.4 |
| threads | §16.1,§16.2,§16.3 |
| smart_pointers | §15, §16.3 |
| macros | §19.6 |
| clippy | §21.4 |
Examples for all central concepts can be found here. However, they don't replace the reading of the book chapters and the exercises.
Read through the guidelines for writing ergonomic and readable APIs here.
Once all above exercises have been solved and there is still time, the following additional exercises should be completed. They usually require more complex implementations and serve to deepen the things you have learned above. Complete as many of them as you can in the order listed here:
- https://google.github.io/comprehensive-rust/exercises/day-1/implicit-conversions.html
- https://google.github.io/comprehensive-rust/exercises/day-1/for-loops.html
- https://google.github.io/comprehensive-rust/exercises/day-1/pattern-matching.html
- https://google.github.io/comprehensive-rust/exercises/day-2/book-library.html
- https://google.github.io/comprehensive-rust/exercises/day-3/points-polygons.html
- https://google.github.io/comprehensive-rust/exercises/day-2/iterators-and-ownership.html
- https://google.github.io/comprehensive-rust/exercises/day-2/health-statistics.html
- https://google.github.io/comprehensive-rust/exercises/day-3/simple-gui.html
- https://google.github.io/comprehensive-rust/exercises/day-2/strings-iterators.html
- https://google.github.io/comprehensive-rust/exercises/day-1/luhn.html
For the journal club (see slides), the manuscript The Wavelet Matrix: An Efficient Wavelet Tree for Large Alphabets has to be prepared carefully. In addition, section 5.3 of the manuscript Wavelet trees for all has to be prepared, which draws the link between the wavelet tree (or matrix) and graph representations. Required examples for the journal club (as visual as possible, in PDF format, either at the day on USB drive or before via email to Johannes Koester):
- Wavelet tree structure
- Access operation on the wavelet tree
- Rank operation on the wavelet tree
- Select operation on the wavelet tree
- Idea behind the wavelet matrix
- How to represent a graph with a wavelet tree
In case problems occur while trying to understand the concepts: plausibly explaining visually why a certain aspect was not understood is also an achievement.
- Use the qwt crate for the wavelet tree functionality (rank, select, access).
- Implement a wavelet tree based representation of directed and undirected graphs with edge and vertex labels/weights. Labels/weigths should be generic type parameters of the graph struct.
- Allow the addition and deletion of vertices and edges.
- Allow modification of labels of existing edges and vertices.
- Solve the challenge: how to efficiently use a wavelet tree (which is static) while still allowing edits to the graph topology (adding, removing vertices or edges)?
- Implement classical graph algorithms like breadth-first-search, depth-first-search, spanning tree determination, shortest paths, min-cut, max-flow, etc. (as many as possible in time, but those are not mandatory)
- Properly document the API (doc comments including parameters and usage examples)
- Have comprehensive unit and integration tests.
- Use modern tooling like e.g. Github, Github Actions, Release automation, ...
- Have a reasonable development strategy (pull requests, code reviews, linting with clippy and cargo, ...)
- Document (internally) your success and failure stories as well as design decisions for later reporting in the presentation phase