The unsafe keyword is the ultimate refutation of Rust being a language that gives you "control" like C/C++. In order to do some things at the lower-level you simply need the ability to do unsafe things.
I had the same intuition as you at first, luckily for us developers it doesn't apply in practice; Rust stays on top of its game in performance in most benchmark (around +/-2% from C) and feels safer overall. Major libs (tokio, serde) have around 10% of unsafe LoC. Even less when you built on top. Pretty cool, isn't it?
Yes, and that's the reason there is the unsafe keyword in Rust. But what you're not understanding is that unsafe is used very seldomly. Most crates have not one unsafe block, and even the ones that do, it's always wrapped in a safe abstraction
You don't need to do unsafe things. In certain circumstances you may need to do things that the compiler can't prove to be safe - and if you do, you have to mark those passages with the unsafe keyword. Sure, at that point you're basically at C/C++ level - except that there's a clearly delimited scope of where extra caution is required - in an overall structure that's probably a lot easier to reason about than any C/C++ program of similar complexity.
33:42, Morpheus is calling
this is why rust feels like different
The really smart people know how to show complex things in a simple way. This is a great example of that.
There are many great intro videos about Rust. This is one of my favorites. Straight to the point of what makes Rust unique.
I love the slide in the thumbnail... it's got a real "retro" feel to it.
This presentation is really good. Thank you for sharing.
The presentation flickers badly on the overhead screen.
I'm guessing US/Japanese camera against PAL screen. (50 Hz vs 60 Hz)
Talk is in Australia which is all Pal.
4:55, not a hashmap but a treemap. to use a hashmap in C++ use unordered_map. but still a really really great talk
really good!
What happened to "optional GC" idea?
... and nothing about lifetimes?
+mrbus2007 He talked about lifetime in detail
The unsafe keyword is the ultimate refutation of Rust being a language that gives you "control" like C/C++. In order to do some things at the lower-level you simply need the ability to do unsafe things.
I had the same intuition as you at first, luckily for us developers it doesn't apply in practice; Rust stays on top of its game in performance in most benchmark (around +/-2% from C) and feels safer overall. Major libs (tokio, serde) have around 10% of unsafe LoC. Even less when you built on top. Pretty cool, isn't it?
@@batmansmk With the productivity that is higher than C&C++ and touches almost C# and Java.
Yes, and that's the reason there is the unsafe keyword in Rust.
But what you're not understanding is that unsafe is used very seldomly. Most crates have not one unsafe block, and even the ones that do, it's always wrapped in a safe abstraction
You don't need to do unsafe things. In certain circumstances you may need to do things that the compiler can't prove to be safe - and if you do, you have to mark those passages with the unsafe keyword. Sure, at that point you're basically at C/C++ level - except that there's a clearly delimited scope of where extra caution is required - in an overall structure that's probably a lot easier to reason about than any C/C++ program of similar complexity.