Тёмный

Polonius: Either Borrower or Lender Be, but Responsibly - Niko Matsakis 

Rust Belt Rust Conference
Подписаться 4,6 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@smth_witty
@smth_witty 4 года назад
1:15 That was a great moment of comedic timing and a great save/joke by Niko
@isaiahdante7362
@isaiahdante7362 3 года назад
I realize I'm kind of off topic but do anybody know a good site to stream new tv shows online ?
@nikolasbrendan7928
@nikolasbrendan7928 3 года назад
@Krew Abdiel Yup, I've been watching on Flixzone for since march myself :)
@maximussamir2332
@maximussamir2332 3 года назад
@Krew Abdiel thank you, I signed up and it seems like a nice service :D Appreciate it !!
@gatlinthatcher7651
@gatlinthatcher7651 3 года назад
@Isaiah Dante you are welcome =)
@maximus1172
@maximus1172 7 месяцев назад
Finally grasped the mechanical steps I need to pay attention to when dealing with the borrow checker in today's rust code!! This needs to be documented in the rust book the way it was explained here, the best explanation of borrow checker yet !!
@edgeeffect
@edgeeffect 3 года назад
This is quite a good talk but more conference speakers need to look to Benno Rice when it comes to taking questions.... they're good for the person asking the question but kinda dull for the rest of us.
@j3kfd9j
@j3kfd9j 4 года назад
Great talk, very informative. Thanks to everybody working on this---everything mentioned would provide real "quality of life" benefits deserving of gratitude. A question: in the definition of a live loan, I don't understand why the `z` loan requires the `y` loan to still be considered live. Can the compiler not prove that now that it has assigned a reference to a part of foo (by way of `y`) to `z`, it will not need to dereference `y` again?
@porky1118
@porky1118 2 года назад
Will this solve this problem: - case that doesn't work: object.call(object.value()); - case that works: let value = object.value(); object.call(value);
@jeffg4686
@jeffg4686 3 года назад
Great talk, knowing the below the surface happenings in rust is essential imo - I have a long ways to go .... I'd like to know why the * is needed in &*map (27:50) if anyone can explain. It's always little isms like this the give me hang ups with languages like c++ because there is so many of them. Like in C++, the whole **void (I mean I get what it is, but sure makes language messy for someone new to language that doesn't get the isms. In fact, that would make a great book. Rustisms
@blackwhattack
@blackwhattack 3 года назад
I think it's unnecesary to say `&*map`. Basically the function in which he used this had a reference, so actually `map` was a pointer, by typing `*map` he accessed the actual value of the variable, and then made another reference `&*map`. He did it to desugar what Rust actually does for you (this is written up somewhere in the Rust book), so I think in Rust `map` and `&*map` are equivalent (when map is a reference), and the second one is more accurate. Please correct me if I'm wrong. here's some info: doc.rust-lang.org/book/ch15-02-deref.html#treating-a-type-like-a-reference-by-implementing-the-deref-trait read the paragraph linked to and also the next one
@jeffg4686
@jeffg4686 3 года назад
@@blackwhattack - thanks, good explanation. So essentially, a copy of value, then reference to that new location - am I reading that correct? Avoids a borrow from original variable since it's a new one (guessing)...
@blackwhattack
@blackwhattack 3 года назад
@@jeffg4686 There is no copying with references. It's just glorified pointers with additional memory safety. Rust tries to be nice to you so you dont have to dereference an argument for a function such as `&map` and type `*map` everywhere you use it. When he wrote `&*map` he just tried to remove all the levels of abstractions (language sugar) that are supposed to make your life easier. Also in (idomatic) Rust there is no implicit copies (except for numbers for which copies have the same or even less overhead than references) so if there was a copy involved you would see it with .clone() or .copy(). I encourage you to read the Rust Book. It really breaks things up into small problems and slowly builds on top of the previous stuff.
@jeffg4686
@jeffg4686 3 года назад
@@blackwhattack - thanks
@ZiggyGrok
@ZiggyGrok 2 года назад
The question I had that wasn't answered: what prevents this from being the way we do borrow checking today?
@shekhinah5985
@shekhinah5985 Год назад
it's expensive to type check. the current implementation in rustc can be very slow and memory expensive. you can use it with the nightly compiler and RUSTFLAGS="-Zpolonius".
@christopherprobst-ranly6284
@christopherprobst-ranly6284 3 года назад
I don't get the final statement... Are Rust lifetimes doomed to be replaced by ... something else? Just curious. the language is already complex enough to teach.
@protowalker
@protowalker 3 года назад
Your code will stay the same. How it gets interpreted will be slightly different, but in a way that will only remove restrictions and not add new ones.
@christopherprobst-ranly6284
@christopherprobst-ranly6284 3 года назад
@@protowalker Sounds interesting. Any intel on when this will land?
@blackwhattack
@blackwhattack 3 года назад
@@christopherprobst-ranly6284 check out the zulip chat, Niko and others said they will try to dedicate more time to this starting 2021!
@shekhinah5985
@shekhinah5985 Год назад
No
Далее
Type Theory for the Working Rustacean - Dan Pittman
19:24
Главное рыба есть, а воды нет..
00:54
pumpkins #shorts
00:39
Просмотров 12 млн
Bearwolf - GODZILLA Пародия Beatrise
00:33
Просмотров 140 тыс.
The Talk You've Been Await-ing for
49:58
Просмотров 62 тыс.
Type Theory for Busy Engineers - Niko Matsakis
51:01
Errichto Stream, POI 22/1
3:55:08
Просмотров 157 тыс.
but what is 'a lifetime?
12:20
Просмотров 73 тыс.
Niko Matsakis - Rust: Putting Ownership to Use
38:19
Просмотров 17 тыс.
Rust at speed - building a fast concurrent database
52:54
Главное рыба есть, а воды нет..
00:54