SDMS24 Rust Intro
SDMS24 Rust Intro
1
Organizational
2
Course Logistics
• Lecture: Tuesday 15:20-17:00pm in S202/C205 (here)
• Exercise: Friday 9:50-11:30am in S202/C205 (here)
• Exercise Sheets: Preparation for Final Exam
• Programming Labs (Graded): Practical Implementation of
Concepts in Lecture
Prerequisites:
• Solid programming skills (Rust, C++, Java, …)
• Lecture “Information Management” or equivalent (Intro to Databases/SQL)
• Enough time to work on course assignments (i.e., labs) during semester
3
Grade
60 / 100 Points 40 / 100 Points
Up to 8 Bonus Points
Lab 0: 2 Points
Lab 1,2,3 Up to 2 Points each (Performance)
5
Exercise Sheets aka Paper-Based Exercise
● Handed-out every 1-2 weeks (first one next week)
● Solution discussed during the exercise sessions, published afterwards
● Tasks are meant to (roughly) mimic possible exam questions
● Not handed-in, not graded!
6
Programming Labs
Goal: Implement major building blocks of a scalable data systems
(based on concepts discussed in the lecture)
• We will have 3 programming labs with 5-6 weeks time per lab
Plus a warm-up lab starting next week, awarding 2 bonus points (Lab 0)
• Labs have to be solved individually
• We provide a minimal code framework and tests to check your implementation
7
Programming Lab Infrastructure
● Gitlab is the central piece of programming lab infrastructure
○ Code repository for stencil and student projects
○ Automated test pipeline when changes are pushed
● Link to Gitlab: https://tg.dm.informatik.tu-darmstadt.de/
(Registration is detailed on later slide)
8
Programming Lab Infrastructure
General process:
• Fork stencil project (from group sdms_ws2024_students into own namespace)
• Develop and test locally (we provide set of basic tests in stencil project)
• Push code to your forked repository
• Test pipeline will evaluate your code (Basic tests, Advanced Tests, Benchmark)
• You can push as often as you want, the best version will be graded (highest
number of passed tests)
More details + demo next Friday!
9
Programming Lab - Evaluation
Basic Tests (Step 1) Advanced Tests (Step 2)
11
Programming Lab Infrastructure Signup
● ASAP: Join the Moodle Course
○ Make sure your Moodle profile contains your matriculation number in the “ID-Number”
Field, e.g. “1234567”, not your TU-ID “ab12cdef“ or anything else
○ If the field is empty, fill it in. If it contains something else contact the Moodle admin
([email protected]) to get it fixed
● During the next week, you will receive an Email telling you to set up a
password to complete your Gitlab account creation
● The Gitlab is only reachable inside the University VPN! VPN HowTo
12
Course and Exam Registration
Registration in TUCaN for Exam/Labs („Prüfungsanmeldung“):
● You need to register for the exam before you hand in the first graded
programming lab (Lab 1)
○ The registration will likely show multiple examination dates, one for each lab plus the exam
● Registration deadline: 12.12.2024
● No de-registration after deadline possible!
13
Rust Introduction
14
Goal/Assumptions
● Not a Programming or Rust course - i.e., we will not teach you Rust
15
Is Rust hard?
I wanted to learn Rust and had this idea:
Turns out:
● It is different
● It forces you to think
● It encourages you to learn
16
Quick comparison
No JVM overhead or GC pauses.
Zero-cost abstractions.
vs Java ConcurrentModificationException
Pattern matching.
Dependency management.
Zero-cost abstractions.
vs Java ConcurrentModificationException
Pattern matching.
Dependency management.
20
Image Source [2]
No GC pauses; lower memory use.
No null pointers.
Zero-cost abstractions.
Dependency management.
22
Image Source [2]
No GC pauses; lower memory use.
No null pointers.
Zero-cost abstractions.
Dependency management.
No buffer overflows.
No null pointers.
vs C/C++ No data races.
Dependency management.
Due to improved:
● Safety
● Quality
● Productivity
● Performance
26
Growth & Industry adoption
27
Image Source: https://strapi.io/blog/rust-vs-other-programming-languages-what-sets-rust-apart
Growth & Industry adoption
28
Safety
29
Source: https://www.memorysafety.org/docs/memory-safety/
Safety & Quality
30
Source: https://www.youtube.com/watch?v=QrrH2lcl9ew
Productivity
31
Source: https://www.youtube.com/watch?v=QrrH2lcl9ew
Performance
32
Image Source: https://www.figma.com/blog/rust-in-production-at-figma/
Learning Rust
Mental model for learning Rust
● Embrace the compiler and tools
● Just in time learning
● Keep it simple
● You pay the costs upfront
● Be open - “re-learn programming/coding”
○ Data-driven-design vs. Object-oriented-programming
○ Functional programming vs. imperative programming
34
The Rust journey
1. Fight it
2. Almost lose it
3. Agree with it
4. Embrace it
5. Understand it
35
Adopted from: https://jondot.medium.com/my-key-learnings-after-30-000-loc-in-rust-a553e6403c19
Learning Resources
● https://doc.rust-lang.org/book/ (https://rust-book.cs.brown.edu)
● https://google.github.io/comprehensive-rust/
● https://rust-unofficial.github.io/too-many-lists/
● https://cliffle.com/p/dangerust/ (if you have C/C++ background)
● https://doc.rust-lang.org/rust-by-example/
● https://rustlings.cool/
● https://www.rust-lang.org/tools
36
References
● [1] Jon Gjengset, Considering Rust, Feb 2020
● [2] https://medium.com/@dexwritescode/
comparison-between-java-go-and-rust-fdb21bd5fb7c
37
Next Steps
Starting today: Catch up on prerequisites, learn Rust
Now: Join Moodle → Link and check that matriculation number is set up
38