RustConf 2021 - Move Constructors: Is it Possible? by Miguel Young de la Sota

RustConf 2021 - Move Constructors: Is it Possible? by Miguel Young de la Sota

Channel:
Subscribers:
42,100
Published on ● Video Link: https://www.youtube.com/watch?v=Lvma7VTkdx8



Duration: 24:09
375 views
13


Move Constructors: Is it Possible? by Miguel Young de la Sota

A "self-referential" type is one that holds a reference into itself; async Futures are the most common self-referential types in Rust today. However, they can't be moved without invalidating the reference, so they're pinned on the heap or stack. You can't return them or put them into collections (without Boxing, of course). C++ makes heavy use of safely-moveable self-referential types, via move constructors. Bridging move constructors into Rust is one of the great unsolved problems of C++ FFI. Was an unsolved problem. Using a novel interpretation of the Pin P guarantees, we'll port all C++ constructors, not just move constructors, to Rust, without compromising Rust's move-after-use protections (something C++ lacks). Return-by-move and collections are fully supported in today's stable Rust. Beyond zero-cost C++ FFI, Rust "constructors" can be applied to express novel data structures in pure Rust. No C++ knowledge required!




Other Videos By Confreaks


2021-09-15RustConf 2021 - This Week in Rust: 400 Issues and Counting! by Nell Shamrell-Harrington
2021-09-15RustConf 2021 - Hacking rustc: Contributing to the Compiler by Esteban Kuber
2021-09-15RustConf 2021 - Compile-Time Social Coordination by Zac Burns
2021-09-15RustConf 2021 - Supercharging Your Code With Five Little-Known Attributes by Jackson Lewis
2021-09-15RustConf 2021 - How I Used Rust to Become Extremely Offline by Luke Westby
2021-09-15RustConf 2021 - Whoops! I Rewrote It in Rust by Brian Martin
2021-09-15RustConf 2021 - Writing the Fastest GBDT Library in Rust by Isabella Tromba
2021-09-15RustConf 2021 - Fuzz Driven Development by Midas Lambrichts
2021-09-15RustConf 2021 - Identifying Pokémon Cards by Hugo Peixoto
2021-09-15RustConf 2021 - The Importance of Not Over-Optimizing in Rust by Lily Mara
2021-09-15RustConf 2021 - Move Constructors: Is it Possible? by Miguel Young de la Sota
2021-09-15RustConf 2021 - Project Update: Lang Team by Niko Matsakis
2021-09-15RustConf 2021 - Project Update: Libs Team by Mara Bos
2021-09-15RustConf 2021
2021-04-19!!Con 2020 - Using font shaping to put commas in big numbers EVERYWHERE!! by Tristan Hume
2021-04-19!!Con 2020 -Obelisk and the Known Unknowns (Or: The Art of Fumbling Through your...) by Sacha Sayan
2021-04-19!!Con 2020 - Let’s implement DNS to learn history! by Dylan Nugent
2021-04-19!!Con 2020 - Screwing up is easier than ever before! by Joshua Wise
2021-04-19!!Con 2020 - 89 characters of base-11?! Mobile networking in rural Ethiopia! by Ben Kuhn
2021-04-19!!Con 2020 - *Punch Card Love! A (Very!) Personal History of Computer Dating! by Amy Cash
2021-04-19!!COn 2020 - EMAIL! by Char Stiles



Tags:
Rust
Lang