Understanding Ownership in Rust

Understanding Ownership in Rust

Let's Get Rusty

3 года назад

249,140 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@reactjs1900
@reactjs1900 - 16.12.2023 11:46

What is this b here ----- > if item == b' ' {
return i;
}

Ответить
@user-sq1nd8ln9k
@user-sq1nd8ln9k - 11.12.2023 13:43

well, this one is not easy to understand. 😭

Ответить
@eileennoonan771
@eileennoonan771 - 07.12.2023 19:49

I am going to watch this every day until I understand it in my bones

Ответить
@recreationalplutonium
@recreationalplutonium - 21.11.2023 15:08

daning kruger the video

Ответить
@almuaz
@almuaz - 17.11.2023 09:44

I read the book and i was overwhelmed of new terms and information. this video helped me to visualize it live. yes rust book visualizations were great but for me i find this more helpful. i think after watching this, i will understand the book better. thank you.
there are too little learning resources for rust :)

Ответить
@alexloktionoff6833
@alexloktionoff6833 - 11.11.2023 14:45

Can you help the beginner? Is there a possibility for borrow-checker to help to control partial structure updates? I mean can I pass the whole structure to the functions and in&out but borrow checker could help/nag in case called function changed a field value but the rest of the caller function code assumes the value has not been changed/updated? Can you show an example for the structure with the basic u32/int fields?

Ответить
@macchiato_1881
@macchiato_1881 - 03.11.2023 05:00

"Get them tattooed, whatever it takes."

Don't threaten me with a good time buddy.

Ответить
@luckyraj8118
@luckyraj8118 - 27.10.2023 15:27

Thanks for the great website hosting info! Ive examined DreamHost and A2 Web Hosting, but Cloudways with TST20 coupon is the real gem.

Ответить
@kayakMike1000
@kayakMike1000 - 07.10.2023 20:15

I dunno, this seems like a pile of malarkey when proper message passing mechanism could be created in any language.

Ответить
@snippletrap
@snippletrap - 19.09.2023 00:31

In C++ you use std::unique_ptr and it auto-deletes when out of scope. Use of `new` is practically deprecated at this point.

Ответить
@hanshaun1350
@hanshaun1350 - 18.09.2023 18:34

This is BY FAR the hardest part to learn Rust. It's frustrating to learn without any C background tbh.

Ответить
@kudorgyozo
@kudorgyozo - 17.09.2023 15:00

How/where are u executing a()?

Ответить
@sunilanthony17
@sunilanthony17 - 28.08.2023 03:10

This is so confusing. I will have to get back to this later.

Ответить
@fennecfox2366
@fennecfox2366 - 27.08.2023 22:37

Coming from c++ this is intuitive. Unique pointers and move semantics give this type of behavior as options in modern c++ so having them as the default makes sense. Also having the const as default on refs is another good safety measure. I do think a basic understanding of pointers in c and references and smart pointers in c++ will help people understandownership and the ideas it's built upon.

Ответить
@JOHNSMITH-ve3rq
@JOHNSMITH-ve3rq - 27.08.2023 01:54

These are great. But some language seems to be used inconsistently in this series and it’s quite frustrating.

It seems copy == clone
And reference == pointer

But if these are different or the same it wasn’t clarified. That’s the frustrating thing.

Ответить
@Cygx
@Cygx - 23.08.2023 05:55

I tried reading the book but it made no sense. After watching this video I finally understand the ownership and borrowing model.

Ответить
@dixztube
@dixztube - 19.08.2023 19:50

I work with node and go for my serious business projects but I did get a offer from a firm that uses rust and pretty flexible timeline if I ever wanted to onboard. This got me into going through the rust book and learning the language… I really like it! I also liked go a lot too.. probably because I started in insane crazy js land now these relatively new languages seem to nice

Ответить
@playfulyogi5639
@playfulyogi5639 - 16.08.2023 09:01

Rather than plagiarize the book, maybe you could demonstrate your understanding by coming up with your own examples and explanations.

Ответить
@miguelnogueira3552
@miguelnogueira3552 - 14.08.2023 18:23

i love you bro

Ответить
@rohanshukla2632
@rohanshukla2632 - 05.08.2023 08:41

Bro you are going to the solutions very quickly without letting us understand the problem. You are not a robot, you can go slow and not act like you're reciting an entire book at 2x speed. No offense

Ответить
@-karter-4556
@-karter-4556 - 01.08.2023 09:45

I wish I found this language sooner 😫. The control and defined, predictable behavior is so appealing.

Ответить
@user-qr4jf4tv2x
@user-qr4jf4tv2x - 10.07.2023 12:49

the reference and borrow is definingly the best part of this tutorial

Ответить
@rino19ny
@rino19ny - 08.07.2023 18:46

and yet C++ is faster than Rust even with manual memory management.

Ответить
@JR-wu3rx
@JR-wu3rx - 27.06.2023 19:26

Regarding the dangling reference, how is '&s' a dangling reference when it is in the same scope as the value it is pointing to? It seems valid to me because the value doesn't get dropped until after the '}' which comes after '&s'

Ответить
@venkateswarans1012
@venkateswarans1012 - 13.06.2023 00:01

Blaaazinglyyy fast

Ответить
@garotalibertaria7219
@garotalibertaria7219 - 11.06.2023 01:06

Best explanation about ownership and borrowing, it helped me a lot.

Ответить
@tinymurky7329
@tinymurky7329 - 25.05.2023 21:10

&str = "hello world" is stored in binary, it's that means "hello world" is directly store in exe file?

Ответить
@carlsmith8593
@carlsmith8593 - 24.05.2023 23:07

You don't need bugs in a garbage collector to create memory leaks. You can easily create a retain cycle with a circular reference.

Ответить
@1nan821
@1nan821 - 16.05.2023 04:35

字符串(String)和字符串切片(&str)这块是最容易懵逼的。

Ответить
@HarshRajput-jr7qp
@HarshRajput-jr7qp - 14.05.2023 00:27

great video bro

Ответить
@sunhsiang6644
@sunhsiang6644 - 03.05.2023 23:37

Who 0.5x speed?

Ответить
@tilmanrotationalinvariant2257
@tilmanrotationalinvariant2257 - 01.05.2023 21:08

You could have added: automatic managment in cpp, which has built in types like std::unique_ptr which does the managment for you. You can get by without using pointers in 99.9% of the code.

Ответить
@martynclarke8400
@martynclarke8400 - 28.04.2023 12:41

Honestly man, your videos have really helped me whilst I go through the book. Theres a lot of information to consume so appreciate you taking the time to make these accompanying videos (y), some things are easier to see than to read and vice versa :)

Ответить
@BenCreasyAlaska
@BenCreasyAlaska - 23.04.2023 22:02

You taking ownership is tedious but why?

Ответить
@kayakMike1000
@kayakMike1000 - 20.04.2023 09:54

Nah... You don't really understand this stuff. Most of what you said is pretty close, but kinda shows you paraphrased a bunch of information you never really engaged with. Your description of stack frames was about a C-/D+ . Functions don't go on the stack, it's the variable data like function arguments and return values. It's possible to put a function pointer on the stack... It largely depends on the ABI and calling conventions related to your architecture. An entire stack frame, however is usually used to save the processor core state when switching contexts.
Also, if you use the heap correctly you usually don't hit any performance hit unless you malloced an ass ton of data that's much larger than your L1 cache.
Someone needs to do more homework.

Ответить
@tahsinulhaqueabir1046
@tahsinulhaqueabir1046 - 09.04.2023 19:19

Best video on rust ownership

Ответить
@hamzadlm6625
@hamzadlm6625 - 03.04.2023 00:12

I love u, thanks for the clear explanation

Ответить
@Wyvernnnn
@Wyvernnnn - 24.03.2023 17:55

I appreciate them trying to make cool stuff and all, but seriously the range syntax could just have been a function and slices could just have been a method
It's not something that deserved its own syntax

Ответить
@mnemotronic
@mnemotronic - 15.03.2023 01:46

S is string literal. If we want dynamic string need to use string type. Ack! Can you see how that might be confusing without clarifying "str" primative type vs. "String" complex object type. I know Rust doesn't have objects, or maybe calls them something else, but objects are a concept I can understand and are prevalent in one or two other programming languages.

Ответить
@bzzzvzzze
@bzzzvzzze - 11.03.2023 19:01

great video!

Ответить
@ycombinator765
@ycombinator765 - 10.03.2023 18:15

I have found my Cherno for Rust

Ответить
@bibliusz777
@bibliusz777 - 07.03.2023 05:16

cut the crap out

Ответить