Rust’s Most Unique Feature

16,103
0
Published 2024-04-12
In this video, I’ll take a closer look at how Rust manages memory with an ownership model, which is quite unique and really powerful. Stay tuned to find out what it is exactly, how it works, and why you need it.

👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: www.arjancodes.com/diagnosis

🔥 GitHub Repository: git.arjan.codes/2024/rustown

💻 ArjanCodes Blog: www.arjancodes.com/blog

✍🏻 Take a quiz on this topic: www.learntail.com/quiz/twmfal

Try Learntail for FREE ➡️ www.learntail.com/

🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level-python
The 30-Day Design Challenge: www.arjancodes.com/30ddc

🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.

👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!

Social channels:
💬 Discord: discord.arjan.codes/
🐦Twitter: twitter.com/arjancodes
🌍LinkedIn: www.linkedin.com/company/arjancodes
🕵Facebook: www.facebook.com/arjancodes
📱Instagram: www.instagram.com/arjancodes
♪ Tiktok: www.tiktok.com/@arjancodes

👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund
- Kit Hygh
- Alexander Milden
- Bean

🎥 Video edited by Mark Bacskai: www.instagram.com/bacskaimark

🔖 Chapters:
0:00 Intro
1:07 Basic rules of ownership in Rust
1:58 Borrowing
6:14 Stack Vs Heap
9:44 Lifetimes
11:23 Conclusion
12:43 Outro

#arjancodes #softwaredesign #python

DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free con

All Comments (21)
  • @srivatsa1193
    would love to see more rust content similar to your python content - design patterns, etc.
  • @Far_Gem
    6:36 What you say here is not quite right: s2 is not allocated on the stack. On the stack, there is only a "fat pointer" which points into the contents of s1 on the heap. I.e. it references data within s1. This is also made clear by the "&" in its type.
  • @iduran
    Thank you for this intro to Rust ownership model. Would love to see more Rust content in your Channel.
  • @_baco
    Now that you mention it... I've actually started following the channel for the Architecture content like 2 and a half years ago. But I am a Python developer and I enjoy the “Python view” on architecture designs in contrast of the Java view of many bibliography. I am also liking Rust, so having *also* content in Rust is also a plus 😄
  • @wizardfix
    Thanks for a great explanation of ownership in Rust, which I've just begun to learn. In other languages I kind of assume anything declared inside a function is stored on the stack, and global variables on the heap. Having control over memory in this way is something new to me. Great stuff Arjan - more on Rust would be great!
  • @shibak4
    Thank you for doing this great video. You explained a great deal of the main concepts in the first chapters of the Rust book in very simple examples. I'll be keeping this as a reference.
  • @damymetzke514
    Rust has been my favorite language for a while now, and the reason is actually one of your latest points. I realized that the borrow checker was making me structure my code better. I've actually picked up Python after this happened, and learned that I liked it more than I realized. Not really the language to be honest, more so the tooling and ecosystem. I'm planning on trying out pyo3 in the future on my projects, so hopefully that will go well.
  • @SuperHardik12345
    Thank you, for explaining ownership and borrowing content in such an easy way, But if possible, then please make more descriptive video for particularly Rust content.
  • @pjgierz
    Hi @ArjanCodes, as always, a great video! I have learned a lot from you over all the videos over the years, both for conceptual design, and for specific languages. One thing that might be considered (maybe just for me) and what was a little distracting: all the "hover-over" pop ups that come (which are of course totally useful for the programmer) make it (for me at least) difficult to follow along. Maybe you can selectively disable these for your presentations. I look forward to learning more about program design -- and Rust, my new favourite thing ;-) -- from you in the future! Cheers from Bremen! Paul
  • @GOTHICforLIFE1
    I honestly would love if you did segments and concepts for most of the more used languages. This channel always felt like one tailored to the more intermediate devs. And i think getting an insight in how other languages solves certain problems helps greatly in appreciate how things are built and why certain patterns work better in one language over another.
  • @djl3009
    Nice. Essential/fundamental Rust concepts like this are a great addition to your channel and works well alongside your Python content. 👌👍
  • @PhunkyBob
    I can't wait for next April 1st to see if Arjan do a Visual Basic video 😇
  • @phortheman
    I love the Rust content on the channel! Hope to see more!
  • @masiarek
    yes, more Rust please. Thank you Arjan!
  • I am working a lot with Python and the sklearn-Library. For analysing labels of 1 plant my resources are enough (16GB, M1 Apple). Connecting data from all plants is a story for the future. Now I am learning and refreshing my knowledge about Linear Algebra. Reducing dependencies works perfect with Random Forest Regressors and is running very fast. Work with flax, Tensorflow or rewrite Important critical functions in Zig or Rust? Apple also delievered mlx at 2024-02. A lot of questions… I love and enjoy Your Rust-Stuff also as Python-Videos!👍