Комментарии:
Hey guys, I know I've already covered Ownership on this channel. I must confess that I was never satisfied with that video. Now that we are aiming to talk about Async Await in Rust, I figured that it would be prime time to refresh this video due to the prominence of 'static and Sized data as well as the Smart Pointers like the Pin and Atomics like Arc and Mutex. I'm hoping that the explanation is different enough that you guys will have learned something even if you already know the concepts.
Btw, just to preempt all of the incoming comments, yes I misspoke, u8 is 8 bits not bytes. Yet another tragedy of my dyslexia. Sorry about that guys. Also aware that I typed in a string slice and not a character. Character literals in Rust use single quotes not double quotes; that one was pure negligence on my part.
This is one of the best explanation I have seen on Rust Memory model and Ownership. I am bookmarking this video. Great work and Thank you.
ОтветитьWhat an explanation. You deserve to have 10 girlfriends with this. many thanks.
Ответитьbest explanation
ОтветитьBest explanation of the stack ever!
ОтветитьThis was very useful, but you really need to slow down and give the viewer a few seconds to assimilate the info before you move on. Hold pauses between your points :-)
ОтветитьStrings can be on the stack. It's contents are on the heap. Structures in general can be on the stack also.
ОтветитьHuh, cool. Sounds very similar to unique_ptr in c++, except ALL heap allocations are unique_ptr by default all the time.
ОтветитьGreat video ! Can you give me the name of the color scheme you are using ?
Ответитьso great norm macdonald could teach me great programming before he passed 🙏
ОтветитьExcellent work.
Ответить8 bits
ОтветитьGreat video. Small note: u8 = 8 bits, not 8 bytes.
ОтветитьPerfect, simple expo. Thanks.
ОтветитьGreat video dude
ОтветитьThis helped me soooo much in understanding the whole stuff with ownership and borrowing. Thank you! Great explanation!
ОтветитьPerfect explanation! Thanks!
ОтветитьWow Rust is actually cool
ОтветитьBest video on Rust memory
Ответить10 out of 10. Great video and explaination.
ОтветитьBits, not bytes. But yeah, you just made a mistake, it's not like you know it wrong. :P
Ответитьthis was more insightfull that description in the rust book...
thank you!
thank you for your explaination. it's easyb to understand.
Ответитьwow this is amazing thank you so much!!!
ОтветитьYou are a legend. What an incredible explanation, please continue to dig into these Rust concepts, would love to get more videos on Rust from you! You are one of the best people I've seen explain difficult concepts like this, superb!
Ответитьmutable borrow example, of 3) Only allowed to pass one borrow at a time for write access/mutability.
after c borrow, only after modify/reference c end, we can touch a.
after modify/reference a again, cannot touch c.
after use a, we can continue use a.
fn main() {
let mut a = 10;
let c = &mut a;
*c += 2;
// a += 5;
println!("c {} ", c);
println!("a {} ", a);
// println!(" c {} ", c);
a += 3;
println!("a {} ", a);
}
Your series is amazing and I really enjoyed watching the projects as well. I want to build on this. Do you have some favourite crates you could send people (or just me) to go read and play with to figure some more stuff out? I use Go a lot for work and I really like cobra for cli stuff, for instance, figuring out how it worked helped me understand go.
ОтветитьThis was the best explanation of stack, heap, and ownership I've seen. Coming from C# this was awesome!
ОтветитьI had no idea Norm McDonald was a programmer
ОтветитьGreat tutorial! One thing I don't understand is why Rust allow mutable owner and mutable reference coexists?
Eg.
fn main()
{
let mut a_string = String::from("hello");
//If this were async, wouldn't we have a data race?
append_string(&mut a_string);
a_string.push('world!');
println!("{}", a_string);
}
fn append_string(target: &mut String) -> () {
target.push_str("world");
}
great to see larger characters, qould be nice to use an editor that also uses wrap to see complete sentences when they are long! great content! keep it going
thanks
Here's an excellent book recommendation for anyone wanting a solid introduction to Rust -> Programming Rust Fast, Safe Systems Development by Jim Blandy & Jason OrenDroff, published by O'Reilly.
ОтветитьYeah! The video makes it look real simple. Try writing some real world code in Rust and you'll understand why some very competent system programmers call it the most difficult language they ever experienced.
Note: I'm not saying Rust is a bad language because it isn't. Rust has some lovely features like let binding and default immutability and pattern matching and type inference but appeasing its borrow checker can be an absolute pain in the ass.
In Rust... Its Rust's way or the highway. In Rust you have to be ever conscious about the borrow checker and bend to its wishes or have a program that will never compile which is a good thing in the long run.
I turn on this video each time I have insomnia. It helps a lot. Thanks!
ОтветитьThat was really a great explaination. Can you please explain cases where we use the raw pointers such as *a? I'm having some trouble getting them through my head.
ОтветитьPerfect pace and clear explanation. Thank you very much!
ОтветитьGreat explanation Thx <3 Tensor ,Nice name by the way =D
ОтветитьExcellent tutorial. Clear and concise. I would like to make a request. Can you cover Utility traits such as From, Into, Deref, Borrow, ToOwned? I have spent a few weeks studying this material, and I have a decent grasp of it. However, it would be helpful to see these traits implemented in a practical example. Thanks!
Ответитьbeautiful explanation, thank you tensor
Ответитьhello, your courses are very great and full (but i wait a video about symbols and runes in Dart 😉). I would ask you which vs code theme do you use 😅 ? thanks
ОтветитьGreat Video! One minor correction, when you demonstrated the copy() function with "a", that was not a character but a string slice, since it was not in single quotes.
ОтветитьThis is a REALLY good explanation, thank you!
ОтветитьThe best explanation I saw about! thank you very much
ОтветитьG'day Tensor. I know you have been making a lot of awesome programming based tutorials. Any idea of starting up Cloud technologies tutorials would be great to learn from you on that front...Thanks.
Ответить