Rust is even harder than you think

preview_player
Показать описание
In this video, I will show you how Rust elegantly hides much of the complexity from us.

Chapters:
0:00 Intro
0:16 The hidden code
0:53 Breaking down the code
2:06 Rust Standard Library
2:35 Print line macro
3:32 Running the expanded code
3:47 Conclusion
Рекомендации по теме
Комментарии
Автор

This is true for every programming language. Writing to console eventually happens through the system calls.

oleksii
Автор

*People* : complain that C++ is too complex
*Rust* : "hold my beer"

trekkie
Автор

That villainous stare at the end killed me

nicholas_obert
Автор

They're about to release the alpha for Cosmic, a DE written entirely in Rust.

CjqNslXUcM
Автор

That's mostly how all programming languages work. But the crate and dependency handling is bliss compared to the hell that statically linked libraries are in C.

BogdanSerban
Автор

A big part of this complexity comes from the fact that "simple" Hello World program is in fact ridiculously complex from low-level perspective as it involves strings.
And Rust is one of a few languages that don't try to hide that complexity under convoluted behaviours, but hands out the control to the user with String, &str... or with synctatic sugar of println!()

el_quba
Автор

For important system level tasks I can see Rust replacing C or C++, but beyond that I think it's just too complex.

megawavez
Автор

If you go further and disable the main function, you need to manually specify the entry point of your rust code.
If you disable c runtime, you even need to use assembly to define the entry point for your program. It's cool.

denizsincar
Автор

Prey-lude or prelude? 🤔 Rustacian fight!

Onyx-itgk
Автор

At what point will dtolnay be classified as a strategic national asset?

doresearchstopwhining
Автор

I would love to see more from behind the curtains, specifically about memory management. Like how is Box<> implemented, which hidden functions are called to actually create the memory on the heap, does it end up being an extern C call to malloc?

Mane
Автор

NOT to start dumb language beef, because I like Rust and I use SO many tools from its ecosystem (WezTerm, Nushell, Helix, Starship, Deno, Salvo, Tauri), but this is the reason why I personally gravitate more towards C and Zig. Like the Zig homepage says, I'd rather spend my time debugging my code than my programming language knowledge. I still find this interesting though, so maybe I don't mind debugging my language knowledge so much after all, but still.

UliTroyo
Автор

Rust is the hardest language that I tried to learn . Experienced in c++, I’m struggling . The syntax is very weird … writers trynna sell that Rust is easier, what a shame

Lapatate-sl
Автор

Your villain underslept mug makes it even harder to code Rust.

franciscogerardohernandezr
Автор

vscode and neovim that uses rust analyzer can invoke rust analyzer built in command to rebuild macro and expand macro,
which i think is much preferred choice than using cargo-expand since cargo-expand would literally expand all macros on your codebase
also note that you can control what to expand using the rust analayzer config, you can ignore some macro if you dont want it to get expanded
e.g. using leptos.

Having been able to use macro is both a blessing and a curse. Its a blessing since you dont need to write all the code. But Its a curse since it makes compilation times longer.

GigachadRustacean-lubo
Автор

Yeah, I read about the macro exclamation in the rust documentation.

victorpinasarnault
Автор

For sake of fairness one must notice that this is quite similar for C and C++, and most compiled languages, AFAIG.

There are some differences. Like macros impl.
C++ way is std::format, std::print. Which are functions.
C and C++ will also include library items (depending on version, vendor) and do optimizations under the hood. As most compiled languages.

I agree that Rust has better approach with unified cargo/build system and buildin linter.
C/C++ have different implementations of those and those are quite diverse.

danielmilyutin
Автор

man what was that smirk in the end? 😓😂😂

samansamani
Автор

why did you use the word harder instead of complex in the title?

ordinaryoreo
Автор

I want to learn rust and i didn’t understand a thing 💀 what should be my next step?

Xnight-X