Rust in 100 Seconds

preview_player
Показать описание

#programming #rust #100SecondsOfCode

🔗 Resources

🔥 Get More Content - Upgrade to PRO

Use code lORhwXd2 for 25% off your first payment.

🎨 My Editor Settings

- Atom One Dark
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- Rust ownership and borrowing explained
- How Rust memory management works
- Get started with Rust
- Rust vs Go
- Rust vs C
Рекомендации по теме
Комментарии
Автор

Yes, I'd love to see a rust tutorial! Especially one geared toward creating web assembly functions/modules using Rust.

ircmullaney
Автор

Best line of today's 100sec
" lower level languages provide functions like free and allocate to shoot yourself in the foot"

augustinefodayngobie
Автор

0:55 This is wrong, value mutability doesn't have anything to do with the value being stored on the stack or the heap (and the example let mut hello = "hi mom" will be stored on the stack since it's type is `&'static str`), it depends on the type of the value (if it's `Sized` or not).

baryemini
Автор

The only thing I understood here is that RUST is a programming language.

nirjalmahat
Автор

Dude I’m discovering the comment section of your videos right and this is amazing. So much quality feedback, friendly corrections, and expansive conversations. What a lovely place on the internet.

crowlsyong
Автор

Let's go!
I think Rust takes a new innovative look at how we write software without compromising safety for performance.
Borrow checker has taught me a lot of good lessons in writing better code

Tantandev
Автор

I would also like to mention how friendly and informative the rust compiler error are!

swanandx
Автор

Good video overall, but a major mistake: YOU decide what values live on the stack or heap, NOT whether the value is immutable or not.
I can have:
struct Foo {
bar: i32
}
let mut x = Foo {bar:42};"
and
"let x = Foo{bar:32}",
both are gonna live on the stack, unless I heap-allocate them explictly like I do in C/C++.

I think what you're talking about is that you can't have unknown-sized values on the stack.
Like you can't declare an array with non-const size, because that would depend at runtime, which isn't allowed, you'd have to heap-allocate that array.

VivekYadav-dsoz
Автор

1. Don't call rustc directly, do it via cargo
2. You don't have to declare the type of a variable in most cases
3. Mutable variables are stored on the stack. When you need dynamic size, then you use Box<> which indicates that the variable is stored on the heap.

sznio
Автор

Your videos are amazing!!!
Sometimes are even better than a "getting started" of 30 minutes tutorials 🔥

SamueldeBrito
Автор

Mutability doesn't mean it's stored in the heap. It is stored in the heap if the size cannot be known at compile time such as Vector, etc . In order to make `hello` variable heap allocated, you would have to wrap it in a smart pointer

codebreatherHQ
Автор

Nice video! Just a heads up tho making a variable mutable doesn't make it heap allocated. Allocation explicitly happens when using types like Vec, Arc, Rc, Box, String, etc.

varunlatthe
Автор

You can mutate a stack allocated type like an integer. You could box it into the heap if you needed though, some rare circumstances require that, like for using dynamic dispatch.

lieQT
Автор

0:41 Outstanding video! Just to amplify, for newbies: Rust uses a "middle path" to be both performant and safe (from a bug standpoint, which implies a _security_ standpoint). This combination is key to understanding its popularity. The key to learning Rust is to accept that the Borrow Checker will hound you like a vicious dog (but it has your back).

michaeleaster
Автор

Nicely done. Yes, I'd love to see some more Rust tutorials.

AlanPope
Автор

I actually just started using rust earlier this week. Pretty cool to see that you made a video on it, would absolutely love to see you make more!

ThatDudeSmoke
Автор

Pretty good overview.

Just a little nit pick for @0:58: Mutability is not a deciding factor for a value placed Heap vs. stack. In Rust, it cannot because mutability is an attribute of the handle, not of the value. Now, dynamically sized elements are placed on the Heap, and the developer can force anything to be on the Heap by using constructs like Box.

Anyway, great video. Hope many will look at Rust.

JeremyChone
Автор

Full rust tutorial! Let's go.... ehm... Let's rust!

weblio
Автор

You did a great job of highlighting the main features of Rust! Would've liked a bit on zero-cost abstraction though. A full tutorial would be great!

ConnorMooneyhan
Автор

Totally down for a Rust tutorial. Your videos are so great to follow along and learn. Love them :)

NedCollyer