Rust makes cents

preview_player
Показать описание
Today I'm going to explain a feature of Rust that doesn't get a lot of attention.

Corrections are in the pinned ERRATA comment.

CREDITS & PROMO
My name is Tris Oaten and I produce fast, technical videos.

Special thanks to my patreon sponsors:
- Affax
- JC Andrever-Wright
And to all my patrons!
Рекомендации по теме
Комментарии
Автор

ERRATA

Tauri hasn't yet release mobile app bundling, though its in their roadmap. Desktop only for now!
2:31 Though the "80%" header is right, the table below is only for 128MB lambdas
4:53 The heading reads "Hander" instead of "Handler"

NoBoilerplate
Автор

"oxidizing your entire stack" what a great line, cheers

DoomKaiserGliders
Автор

This is becoming a must watch channel. I don't even read the title anymore. I know it is my reliable rust content.

EdissonReinozo
Автор

These videos convinced me to write my latest project in rust. At first I thought the project was too big, too many states to model and too many breaking changes. But having written something once, it never broke. Whenever I added a new thing, I first extended the valid states by changing the type of a variable from String to a parsed struct - and the compiler told me where I had to fix stuff. When there were no more compiler errors, I was done. It's fun to write code like this.

foobar
Автор

I read that energy efficiency paper. The reason Java is so high up is because they used Java to execute the power analysis function, and instead of launching the program externally like they did for literally every other language, they just ran the Java program inside the same VM, cutting corners significantly.

tuskiomisham
Автор

The production quality of this is so high. The message is a complex thing made simple, using rudimentary graphics done well, overlaid with a voice that is so pleasant this guy should voice audiobooks. Very much appreciate the level of quality in this!

enque
Автор

You've mentioned execution time and memory usage but there is an area you didn't mention: disk usage.

Rust's compiler is a powerful tool that does a lot of checking for you. This takes a lot of time. The first build in Rust takes a long time, easily in the order of minutes. The authors knew this and so, just like C's object files, the compiler produces a lot of artifacts to remember its progress. And this is where the cost of Rust manifests because nothing in the world is ever completely free. Rust consumes a lot of persistent memory on the developer side to power its magic. Even a simple hello world project will take a couple hundred megabytes, real projects easily number in gigabytes of compile-time artifact data.

There is a argument to be made that persistent memory is pretty cheap today and that this single-time, developer-side cost of space is a small price to pay for all the good stuff - and I would agree with that. But I felt it necessary to mention it for the sake of completeness.

the_kovic
Автор

That feeling when he says "Hi friends" and for a moment you feel like you actually have a friend ... and then the video ends.

LukaSauperl
Автор

will he ever make a video that isn’t amazing probably not

jameslugenga
Автор

Another thing about rust that makes it very good for writing code: I often find that if I understand what a struct is, I can very often tell what a method does just by its name and type signature. I can also very often find the method I want quickly by looking through the autogenerated documentation

piguyalamode
Автор

Can we get a complete Rust tutorial for begginers?
You have an amazing writing style and your voice is very pleasant to listen. I'd love to see a good Rust tutorial series

cylian
Автор

As Mark (CTO of Azure) correctly tweeted, C/C++ should be declared as retired languages and instead use Rust.
Am pretty sure, going forward most of the cloud services and data centre infrastructure code will be written in Rust. Fast, energy efficient and of course cheap!

shreyasjejurkar
Автор

In exchange for making code fast, you generally have to sacrifice some space to hold the compiled binary. While your code may not get to the size of a shell-script one-liner, Rust has plenty of tools available that let you get down to an absurdly small binary, even forgoing the entire C runtime, while still being confident that things won't break.

angeldude
Автор

When I first tried Rust in 2016, I was repelled by its weird syntax and borrow checker - C++ seemed much more familiar. Later (in 2019) I decided to try it once more, maybe write something small and simple. And it clicked. Since then I'm using Rust for all my personal projects. I don't remember last time when my program crashed NOT on my own unwrap(), which is just quick dirty hack to make program compile. But unlike said C++, I know that I can just grep for unwrap()s and replace them with proper error handling, not re-reading whole code 50 times.

dixaba
Автор

Jean Young's talk on Strange Loop was amazing for bringing attention to system rationality and not just saying "your local program is the only system you ought to be concerned about" knowing there's plenty of tooling for proving local state to not only be correct, but for invalid state to not be representable. Proving that our code can be glued together to talk to other systems correctly would be a huge win in my book for engineers everywhere! :)

SimGunther
Автор

You can definitely see the improvements in information quality by the number of items in ERRATA decreasing each video. Keep it up!

yey
Автор

I've been learning Rust for a few weeks now and one of the things I've spotted is how well the type checker helps you prevent errors you didn't even realise were possible.

For example, I recently got a compiler error because converting a character to uppercase returns an integrator of characters rather than a single character - it turns out that in some languages, converting some letters to uppercase gives two letters as a result.

Without Rust's type checker and its spectacular support for Unicode I never would have considered that edge case, which for some kinds of code is going to lead to massive bugs - you've probably heard of all the crashes on iOS and Android due to text rendering issues (if not, Tom Scott has great videos on it). I wonder how many crashes would have been prevented if the text-rendering engines for our operating systems were written in a safe language like Rust.

miguelguthridge
Автор

The voices, the script is so fascinating to watch & listen. 😊😊 you are the one who inspire me to try rust.

SochetraNOV
Автор

the rust compiler is a real friend, instead of hiding things from you, it shows your mistakes in a comprehensible way.

qwyfzst
Автор

I'd love to see how one might take formal specification (such as TLA+/PlusCal) and bring it over to the invariants and typing of Rust

leegeorg