Crust of Rust: Lifetime Annotations
Jon Gjengset3 HN recommenders · recommended in 3 months, 2020–2023
tutorial · intermediate · evergreen · 2020–2023 on HN
In this first Crust of Rust episode, Jon Gjengset live-codes an example that needs multiple explicit lifetime annotations. Along the way he covers string types and generics over a custom trait.
Recommended as a slow-paced, detailed live-coding session that makes lifetimes click once you are past Rust basics.
Up next
2 mo on HNRust at speed — building a fast concurrent database
Jon Gjengset
2 HN recommender · 2019–2022
2 mo on HNAbseil's Open Source Hashtables: 2 Years In - Matt Kulukundis - CppCon 2019
CppCon
1 HN recommend · 2021–2026
7 mo on HNCppCon 2015: Kate Gregory “Stop Teaching C"
CppCon
7 HN recommender · 2016–2025
8 mo on HNDiffie-Hellman Key Exchange
Art of the Problem
9 HN recommender · 2016–2024
11 mo on HNCppCon 2015: Andrei Alexandrescu “std::allocator...”
CppCon
7 HN recommender · 2017–2025
12 mo on HNLexical Scanning in Go - Rob Pike
GoogleFOSSSydney
13 HN recommender · 2012–2025
10 mo on HNCppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”
CppCon
9 HN recommender · 2018–2026
9 mo on HNRustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West
Rust Programming Language
9 HN recommender · 2018–2023
10 mo on HNCppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
13 HN recommender · 2016–2024
9 mo on HNIdeas about a new programming language for games.
Jonathan Blow
7 HN recommender · 2014–2025
9 mo on HNCppCon 2014: Mike Acton "Data-Oriented Design and C++"
CppCon
9 HN recommender · 2015–2026
9 mo on HNHow I program C
Eskil Steenberg
8 HN recommender · 2017–2025
4 comments from Hacker News
So, with "good working knowledge" of C++ and Swift, you probably aren't going to have too much trouble with the basics, if anything you might worry that there's some subtlety which you're missing when actually nope, whatever just seemed easy maybe actually was that easy. [ For example move really is as simple as Rust makes it look, it is a headache in C++ because they added it to a finished working language ] Several people suggested books/ web pages let me suggest some videos: Jon Gjengset's "Crust of Rust" Youtube videos are good once you reach the point where you can write more than "Hello, world!" with some confidence but certain specific things aren't clicking. ▶ this video For example, Jon does a whole video on lifetime annotations, which are something you won't see in most popular languages, but also one on Rust's iterators, which are a familiar concept from both C++ and Swift but don't work quite like either (they're very different from C++ iterators, your Swift experience will help more). I recommend watching specifically a handful on topics you don't feel you understood well, although you could watch all of them especially if you just enjoy Jon's style and have the free time. They're not fast paced, if you wanted "Rust in 60 minutes" this is not that, but each one is actually writing carefully chosen code that runs and talking through what's going on, not just clicking through slides.
I also used to feel the same way. But listening to [0]Crust of Rust: Lifetime Annotations by Jon Gjengset helped me understand its need. [0] ▶ this video really helped me understand it.
Anecdotal - One of favorite YouTube live-streaming personalities, Jon Gjengset[1] is a Ph.D student at MIT CSAIL. His talks are very detailed[4] and captivating[3] [1] link Talks [2] link [3] link Rust Details(my favorites) [4] ▶ this video
Rust seems nice when you see someone like Jon Gjengset writing it [1], however when actually writing it yourself you discover that your errors have errors which only show some kind of alien fishing when you Google them. Perhaps ChatGPT could help here, it's quite useful/pleasant for trivial quizzes, however I asked it recently how to handle a file upload using actix-web and it hallucinated some really nice methods, too bad they aren't in the code base. [1] ▶ this video