Rust Data Modelling WITHOUT CLASSES - Summary

Summary

The video discusses the benefits of using Rust's rich type system, algebraic data types, and data normalization to make invalid states unrepresentable. The speaker, Tris, explains how Rust's enums, which are algebraic data types, can be used to model complex data in a way that prevents invalid states from being represented. Tris also discusses the concept of data normalization, which involves splitting data into sensible structures to prevent data design mistakes. Additionally, the video explores the use of state machines in Rust, using the example of Super Mario World's state machine. Tris demonstrates how to implement a state machine in Rust using enums and match expressions, and highlights the benefits of using this approach, including increased safety and ease of debugging.

Facts

1. The speaker's name is Tris.
2. The video is about technical aspects of the Rust programming language.
3. One of the key features of Rust is its rich type system.
4. Rust's type system allows the creation of complex models that deeply integrate with the problem domain.
5. The video will demonstrate how to make invalid states unrepresentable using three techniques: algebraic type systems, data normalization, and state machines.
6. Everything in the video, from the script to the images, is part of a markdown document available on GitHub under a public domain license.
7. Rust has product types, which are similar to classes or C-style structs in other languages.
8. Rust also has algebraic Sun types, sometimes called tagged unions, which are different from enums in other languages.
9. In Rust, enums are used to model scenarios where a variable can have one of a few predefined values.
10. Rust's enums can be used to enforce the validity of states in a program.
11. Rust provides pattern matching via the `match` keyword, which can be used like a C-style switch.
12. Rust's `match` keyword requires all possible values to be covered by the branches.
13. Rust allows the enrichment of data with types, not just using anonymous numbers and strings.
14. The video also discusses the concept of object-orientation in Rust and how it differs from traditional object-oriented systems.
15. Rust's algebraic type system, like enums, allows for the creation of a simpler, better world.
16. The video mentions a project called Quadratic, an open-source spreadsheet for engineers and data scientists built in Rust, WebAssembly, and WebGL.
17. Quadratic combines the functional data visualization of a spreadsheet with the power of full programming languages.
18. The video recommends thinking about data modeling in terms of tables, using the principles of normalization.
19. The video discusses making invalid states unrepresentable using state machines.
20. The speaker concludes by suggesting that Rust's rich type system can be used to model data in a way that makes invalid states unrepresentable.