Crust of Rust: Sorting Algorithms
In this Crust of Rust episode, we implement some common sorting algorithms in Rust. This episode doesn't aim to explain any _single_ concept, but rather showcase what writing "normal" Rust code is like, and explaining various "odd bits" we come across along the way. The thinking here is that sorting algorithms are both familiar and easy to compare across languages, so this might serve as a good bridge into Rust if you are familiar with other languages.
I've uploaded the algorithms we implemented in the stream to https://github.com/jonhoo/orst. Feel free to contribute your own as well!
0:00:00 Introduction
0:02:42 Ord and sort in std
0:10:04 Sorting algorithms
0:12:02 Bubble sort
0:27:42 Insertion sort
0:52:18 Selection sort
1:07:27 Quicksort
1:46:22 Benchmarking
2:06:20 Quicksort underflow
2:13:46 Back to benchmarking
2:18:56 Evaluating the results
You can watch the live version with comments at https://www.youtube.com/watch?v=K7v4EysI0kg
Other Videos By Jon Gjengset
2021-06-26 | Implementing Hazard Pointers in Rust |
2021-06-13 | Lock-Free to Wait-Free Simulation in Rust (part 2) |
2021-05-22 | Lock-Free to Wait-Free Simulation in Rust |
2021-04-30 | Crust of Rust: Dispatch and Fat Pointers |
2021-04-02 | Crust of Rust: Atomics and Memory Ordering |
2021-03-13 | Crust of Rust: The Drop Check |
2021-02-20 | Crust of Rust: Subtyping and Variance |
2021-01-23 | Q&A January 2021 (now with cat) |
2020-12-12 | The Unsafe Chronicles: Exhibit A: Aliasing Boxes |
2020-11-21 | A Cool Generic Concurrency Primitive in Rust |
2020-11-14 | Crust of Rust: Sorting Algorithms |
2020-10-23 | Thesis: Partial State in Dataflow-Based Materialized Views |
2020-08-19 | Q&A August #2 2020 |
2020-08-09 | Q&A August 2020 |
2020-08-05 | Crust of Rust: Channels |
2020-07-25 | Thesis Talk: The Evaluation Chapter |
2020-06-17 | Crust of Rust: Smart Pointers and Interior Mutability |
2020-05-27 | Crust of Rust: Iterators |
2020-04-29 | Crust of Rust: Declarative Macros |
2020-04-01 | (Partially) fixing a bug in a Rust research database |
2020-03-06 | Considering Rust |