Rust takes a unique approach to function types, for both closures and fn items. In this video we’ll talk about a way to fit these strange function types into your existing understanding of what types are. Then we’ll look at how another language (okay, it’s C ) does function types in a way that causes poor codegen in generic higher-order functions if you aren’t careful--and how/why Rust avoids this problem.
Compiler Explorer -
Godbolt code samples from the video:
C -
Rust -
*Rust Stuff*
fn pointers vs. fn items - #creating-function-pointers
Fn (the trait) -
*C Stuff*
Decay -
-
std::reduce -
1 view
1360
429
4 months ago 00:02:12 1
CustomModules
5 months ago 00:17:42 1
Forge Korean Takedown Steel Bow from Rusty Leaf Spring | Forge a steel BOW out of Rusted Leaf SPRING
5 months ago 00:33:11 1
Restoration old Football arcade machine from 1920s
5 months ago 00:10:26 1
Making leather belt - blacksmithing
5 months ago 00:20:17 1
Amazing Restoration of a rare 1923 pistol made in the USA