Get your *FREE 4-Day Rust training* : letsgetrusty.com/bootcamp
@mastrajanis4 ай бұрын
Feels like scammers page.. sends some useless videos every day for 4 days.. how this supposed to teach me rust.. 🤦🏻♂️
@Kiyuja4 ай бұрын
any progress towards a better async experience is meaningful imho.
@letsgetrusty4 ай бұрын
Agreed!
@feschber4 ай бұрын
still waiting for async drop
@TheEvertw4 ай бұрын
The generator syntax is something I was sorely missing in Rust, having learned to love it in Python.
@nathanoy_4 ай бұрын
Same, its such an intuitive way to create lazy evaluated sequences. Real pain in rust rn
@SchmySeymour4 ай бұрын
Wikipedia says: Polonius is a character in William Shakespeare's play Hamlet. He is the chief counsellor of the play's ultimate villain, [and generally] regarded as wrong in every judgment he makes {...}. WHO CHOSE THIS NAME FOR THE BORROW CHECKER????? A genius? A crazy person? Both?!?!?!
@RustIsWinning4 ай бұрын
Matsakis mentioned this in his talk that he gave a few years ago so it's probably him.
@somedooby4 ай бұрын
I'm still waiting for a marker such as #[sensitive] to annotate functions that should have stack bleaching. Last I checked, it still has an RFC in the LLVM repo
@letsgetrusty4 ай бұрын
Interesting feature! First time I've heard about it
@shipweck62534 ай бұрын
what is stack bleaching?
@ThisIsNotAUsername-v3o4 ай бұрын
@@shipweck6253 Tried Bing and Google; still didn't know. Asked ChatGPT, where I was told that it's a way to optimize runtime garbage collection. So I still don't know what it has to do with Rust.
@frozen_spider4 ай бұрын
@@shipweck6253 Erasing stack frames to clean up sensitive computations leftovers that might be accessible by direct memory reads, e.g. via some vulnerability
@LtdJorge4 ай бұрын
@@shipweck6253 zeroing the memory where the stack for a function was, after it completes. Useful for crypto stuff, so no secrets are leaked.
@alexandervantrijffel94354 ай бұрын
I can’t wait for the async closures and parallel front-end compilation to land! Thanks for the video
@SuperJJAlexander4 ай бұрын
Everybody, get ready to fight the Polonius!
@tirushone64464 ай бұрын
"Finally, a worthy oponent out battle will be legandary!"
@tinrab4 ай бұрын
Generators are cool. I wonder how they'll play with streams. I've been using `async-stream` crate to be able to create streams using the `yield` keyword. Async generators could do that too.
@kuqmua7554 ай бұрын
And sorry, I don't think it's more "readable" for me. Just making things hard to understand
@oxey_4 ай бұрын
afaik in async contexts they're supposed to behave just like a stream where you await each item
@rakshith-ravi4 ай бұрын
Yield? I think the current contender for that keyword is yeet xD
@crimsonmegumin4 ай бұрын
@@rakshith-ravi yeet is for error throwing IIRC (ik it's a joke though)
@LibreGlider4 ай бұрын
Yoooo async closures, man!!!
@dmitriidemenev52584 ай бұрын
You already can have closures that return futures.
@eagle2com4 ай бұрын
@@dmitriidemenev5258Sure, but it is so much noise in an already verbose type system .
@dmitriidemenev52584 ай бұрын
@@eagle2com I totally agree but it's still merely a syntax sugar. The good kind of syntax sugar but syntax sugar nonetheless.
@diadetediotedio69184 ай бұрын
@@dmitriidemenev5258 and...?
@nanoqsh4 ай бұрын
@@dmitriidemenev5258 this `fn g(f: impl async Fn(&str))` is a `fn g(f: impl for (impl Future + 'a))` - can you implement this without the sugar?
@yewo.m4 ай бұрын
On the one hand you have a language like Elm run by one dictator (its original creator) who doesn't want to add any new features to it, which limits its adoption. While on the other hand we have a community-driven language like Rust with no single person at its head (the original creator left), and the language becoming very bloated
@JinKee3 ай бұрын
Historically the messier the language the wider the adoption (**cough** javascript) so all rust has to do is hold safety sacred while allowing for There is More Than One Way to Do It.
@meanmole32124 ай бұрын
BRO, WHAT ABOUT THE ALLOCATOR API? You would think it'd be about time to stabilize THAT before adding new syntax and complexity to the language. Functionality and stability over SUGAR, please. Well at least the polonius stuff is good news.
@motozirillo4 ай бұрын
BRO Just because this update doesn't include your feature doesn't mean it's not being worked on?? jfc
@meanmole32124 ай бұрын
@@motozirillo BRO it is over for Rust game development community, it has never been more over than it is now, unless we get revived with allocator api injection immediately
@TheMachina424 ай бұрын
Yeah no allocator API in manual memory managed languages is so backward in 2024, like that should absolutely be a top priority, how can you be expected to write optimal code, when there is no standard way of fine tuning your memory management, like let me use an arena, a heap, a pool, or a GC, I don't understand why this is not the top priority.
@Salabar_4 ай бұрын
@@meanmole3212 Containers from std are no good for games anyway, and implementing your own with your own allocator is like a several thousands lines of code.
@PotatotheTroll4 ай бұрын
@@TheMachina42Isn't it one of Rust's core benefits to make manual memory management unnecessary? Like, no more memory leaks, no garbage collection, and there's no danger of missing a delete statement. I do agree that more data structures being adopted into the language would help make the core Rust library more flexible. I haven't looked into the Bevy crate yet, so I don't know if it has implementations of things like hashmaps. Maybe somebody else has already written up a crate that would specifically help you? I mean, there's already a handful of WASM crates, so anything's possible.
@mahor12214 ай бұрын
Your work is appreciated
@RenderingUser4 ай бұрын
Gen fn is just a couple of characters away from green fn
@maxinealexander97094 ай бұрын
what?
@RenderingUser4 ай бұрын
@@maxinealexander9709 google it
@katazina03 ай бұрын
@@maxinealexander9709green fn
@katazina03 ай бұрын
just wait til you hear about type Shit = ...
@Lege194 ай бұрын
I'm not a big fan of rust's abbreviated keywords, like, for some of them I think shortening things is reasonable, but shortening generator to gen?
@rastaarmando70584 ай бұрын
or "public" to "pub", or "function" to "fn" which is not even a word.
@tirushone64464 ай бұрын
rust syntax are already so verbose you need to cut the key strokes down somewhere or else every line of code would take hours to write
@Lege194 ай бұрын
@@rastaarmando7058pub sure but I think fn is fine
@aheendwhz124 күн бұрын
@@tirushone6446 Never heard of an IDE? Abbreviations in code are ridiculous in 2024. If you're lucky, they don't create problems (like people being unable to figure them out), but they don't really solve problems any more.
@AetherA11y4 ай бұрын
Wish you could do a comparison of Rust vs. Zig. There seems to be a lot of "zealots" (?) for Zig, but from the little I've seen of Zig, I'm not a fan: "null safety" by having to manually annotate your nullables with a ? (really???); having nulls in the language at all -- not so great; possible OOP (anti-)patterns; and arguments like having total "control" over memory allocation/deallocation (is that really necessary nowadays?), and using it when you'd need a lot of unsafe blocks in Rust (aren't these mainly for C interop anyway?). I'm happy/stuck with Dart nulls/OOP for Flutter, but do we really need *another* language (Zig) that continues the null mistake and lets you do what you want with memory? I prefer a language that just doesn't let me make stupid mistakes in the first place, but I guess some would rather spend time debugging memory issues than their applications (Zig... maybe I'm wrong though). Wish you could shed some light and give us some solid arguments to make for Rust because I'm not finding many helpful videos on this topic.
@filipvranesevic87223 ай бұрын
Generators look a lot like Golangs new range over function iterators, just in Go there is no new keyword required
@JJSogaard4 ай бұрын
What site are you seeing this on?
@OfficialViper4 ай бұрын
The article is the official Rust blog. The code, I am not sure. Probably examples from the corresponding GitHub issues?
@Marlon-ld2jx4 ай бұрын
Im looking forward to use the new borrow checker :D
@loicr12434 ай бұрын
Adding completness to the borrow checker is cool, but the major focus should be to make it sound. I can not really trust Rust for what it is supposed to do when I see terrible news like CVE-RS project highlight (for short, sound issue in the borrow checker since 2015, making it accept code that should be rejected).
@RustIsWinning4 ай бұрын
Explain how this is terrible news. Nobody is going to write code like cve-rs.
@loicr12434 ай бұрын
@@RustIsWinning the borrower checker accepts wrongly safe assumed code, it fucks up what the language is supposed to ensure
@RustIsWinning4 ай бұрын
@@loicr1243 The reason why the borrow checker has this specific issue is because of a flaw in the type system. However, this will be fixed in the next gen trait solver aka chalk. You can point out as many flaws as you want in Rust if you filter by the I-unsound label. At least miri can catch some of these issues. Rust wont be perfect but I think it's closer to perfection than any other language.
@loicr12434 ай бұрын
@@RustIsWinning I would be curious of what your "perfection" vision is. Rust loses by far on things like learnability, noob-friendlyness, compilation times, overall speed to develop a prototype to other languages suh as Python. It wins by far on many other concerns. There is no such "perfect language", there are languages that best fit your needs.
@RustIsWinning4 ай бұрын
@@loicr1243 Well, we were talking about soundness holes in the borrow checker so I was mainly referring to memory safety in performant low level code. You are not wrong about all the things you listed compared to GC and dynamic languages. But then again you might not want to compare them to system programming languages because they really solve different problems just like you said.
@Malix_Labs4 ай бұрын
Some features are nice for sure, but it does feel like Rust is fastly going towards the C++ complexity
@illegalsmirf4 ай бұрын
hasn't that always been the intention though? It's clearly an elitist language for people who think they are (or really are) cleverer than everyone else.
@Justin-wj4yc4 ай бұрын
@@illegalsmirf rust is prolly half as complex as C#
@rastaarmando70584 ай бұрын
@@Justin-wj4yc That' a nice joke, buddy.
@Justin-wj4yc4 ай бұрын
@@rastaarmando7058 huh. as a language it is about half as complex as c#. it does not mean it is easier. but go compare their language specifications if you want xd
@toto_frs6204 ай бұрын
Do you have a discord where I can ask you questions about rust?
@venugopal-nc3nz4 ай бұрын
How long it takes to learn rust ?
@ronald38364 ай бұрын
Longer than it takes Rust to become incompatible with the edition you were trying to learn.
@pnk-q9w4 ай бұрын
@@ronald3836 spreading lies is kind of pathetic
@antifa_communist4 ай бұрын
@@ronald3836 wrong.
@tirushone64464 ай бұрын
depends to what level, it took me about 6 months of regular practice until I started to feel like I good get some decent work done without needing to look at stack overflow every 5 minutes
@ronald38364 ай бұрын
@@pnk-q9w It used to be very true, but I just tried and a program I did not touch for some time now still compiles. However, it does generate some warnings and tells me that thise will be "hard errors" in the "2024 edition". So Rust code still literally rusts away over time. I know that when I was writing it and for some time after, I had to fix quite a few things with every new release of Rust.
@toastrecon4 ай бұрын
Just started the bootcamp! So far so good.
@ParkourGrip4 ай бұрын
My biggest pain point with Rust is the lack of default function argument values and inability to call functions using named arguments. So many libraries have to write boilerplate builder patterns to make their API nice to use because of this limitation. One off structs, macros, builder patterns, optional argument types all have their annoying downsides. I just want simple default function arguments, and the ability to call functions using named arguments. This should not be rocket-science.
@ParkourGrip4 ай бұрын
Builder patterns remind me of the horrible days of generating getters, setters, hashcode and equals methods in Java. So much boilerplate, so little actual code that does something meaningful. Later we got Lombok annotations that can generate these at compile-time. This is like using rust macros today but this still feels like fighting against the language itself. Switching to from Java to Kotlin was the true solution that solved the problem entirely.
@dubstepaztec35734 ай бұрын
😂
@meanmole32124 ай бұрын
Agreed but making a dedicated struct for function's arguments and implementing a default function for that struct is not too bad since you can then essentially use default arguments by using "..S::default()" for the fields that you want to be initialized with default value.
@catto-from-heaven4 ай бұрын
@@meanmole3212 Yeah, let's solve boilerplate with even more boilerplate
@nanoqsh4 ай бұрын
I'm too used to a language without implicit function parameters. Now I don't want to see them, even if I were a crate creator. To write a builder was never a problem, it's just typing
@pcfreak19924 ай бұрын
Very excited for the new edition! Now we will have all these amazing features that came out since 2021 wrapped up :D
@stasuchuvadov3 ай бұрын
I'm really miss AsyncDrop functionality Real runtime-independent AsyncDrop
@lufenmartofilia58044 ай бұрын
Still not a big fan of the gen + yield methodology 😬
@andrew.derevo4 ай бұрын
Thank a lot! Not sure who made more progress in last to years rust or your english pronunciation 😅👏
@Maskrade3 ай бұрын
me when gen is an IEnumerable on C#
@surajraika78214 ай бұрын
looks like your looks are updated with rust
@adrian_sp6def4 ай бұрын
What about rust abi?
@fedang4 ай бұрын
Am I crazy or the gen thing could be done by a macro?
@nanoqsh4 ай бұрын
You can done async by macro too. But should it? First class feature would be better. Generators would be very useful for streams/async iterators to replace macros like async_stream
@LtdJorge4 ай бұрын
Macros are useful, but trump the LSP which sometimes breaks the code completion or inference.
@kuqmua7554 ай бұрын
Am i only one who thinks that just implementing iterator is simpler than understanding what yet another keyword do by reading docs? Like isnt adding another implicit logic in language making it harder to understand?
@jackkendall64204 ай бұрын
i feel like you could say this about any language feature. i don't want to implement basic constructs like iterators again, and if i do i'll go write C
@broccoli-dev4 ай бұрын
30-40 more keywords and Rust will be really good
@JorgetePanete4 ай бұрын
isn't*
@norude4 ай бұрын
I know how iterators work in python, I use them all the time. They are so convenient. And you can just, idk, Not use it?? Although a way to de-sugar some parts of the code that use features you don't understand as part of the lap would be cool
@kuqmua7554 ай бұрын
@@norude why I need to use python iterators in rust?
@navi27103 ай бұрын
Linux C++ decs are about to experience an anurism.
@ashwinsolanki65494 ай бұрын
Happy Teachers day from India 😊
@julien20724 ай бұрын
async trait?
@sighup1244 ай бұрын
Isn’t that done for months already?
@dmitriidemenev52584 ай бұрын
Async in traits is already part of the language.
@julien20724 ай бұрын
@@sighup124 You are right I missed the train.
@sunofabeach94244 ай бұрын
don't we have enough ways of making iterators already
@VanStabHolme4 ай бұрын
Traits is the regular way of doing it, `gen` is the shorter and more intuitive way of doing it. PHP, JS, Python have generators, and they're used not only for iteration
@sunofabeach94244 ай бұрын
@@VanStabHolme what bothers me is ambiguous errors we'll certainly get when the compiler desugars this new fancy syntax. Iterators already have a problem when reference capturing is involved
@frozen_spider4 ай бұрын
@@sunofabeach9424 I sure hope they won't release it in such a state
@JMurph20153 ай бұрын
Feels like Rust is heading for C++ levels of bloated 😭.
@FirstYokai3 ай бұрын
Rust is becoming JavaScript. Too many ways to solve a problem
@jongeduard3 ай бұрын
I would rather compare it to C#, because async await and especially yield where long there before in JS, and in a lot less messed up way. Fun is that C# is going to implement Type Unions next year, which are the equivalent to Rust's enums.
@curtispenner24 ай бұрын
Put it on arch Linux and macOS and it doesn’t compile. Issues error.
@meryplays89524 ай бұрын
Imperative syntax??? Sacrilege!
@Davidicus0004 ай бұрын
Fantastic!
@Garush4 ай бұрын
He literally keeps getting hotter wtffff
@obinnaokafor62523 ай бұрын
Hopefully, the Linux community will become less toxic and hazardous towards rust community
@cathyaishu11793 ай бұрын
Gen is suspicious.. could be used to stream in LLM response 🤔.. are they laying road for AI like MOJO does.
@mani_mincraft4 ай бұрын
What about default variables for functions?
@GreatWalker4 ай бұрын
Look up rfcs/issues/323 on the Rust repo. It doesn't seem fruitful yet.
@dubstepaztec35734 ай бұрын
You can use a macro for that if you want
@mani_mincraft4 ай бұрын
@@GreatWalker wow a decade of nothing. I’m not a compilers’ programmer but I am left wandering how hard could it be to implement this feature? Couldn’t they cross it off the list right now and be done with it forever?
@ParkourGrip4 ай бұрын
I'm sick of builder patterns. Give me default argument values and calling functions using named arguments.
@steveoc644 ай бұрын
The one thing Rust will never be able to add to the language is - pragmatic simplicity It’s eventually going to be its downfall
@letronix62434 ай бұрын
Woah
@rasputindasilva8584 ай бұрын
Rust is hard to learn there's not enough literature out there to be proficient in rust, C++ has tons of books about everything can be done with the language.
@frozen_spider4 ай бұрын
And yet C++ is a huge burning pile of crap with infinite complexity, tons of UB and unhelpful compiler. You could read tons of C++ books and still be surprised in the field. I think the thing that got me thinking something is terribly wrong with the language design was enable_if. While you're right that Rust has way less literature, it's also way simpler, less nuanced language, and I'd argue that Rust Book, Rustonomicon and Rust for Rustaceans should get you up to speed pretty fast.
@PhilSamoylov4 ай бұрын
"Major" sounds scary from the semver perspective. Rust project vowed that there will never be a major version increase, meaning no backwards compatibility breaking
@SkegAudio4 ай бұрын
it doesn't break compatibility...
@jonnyso14 ай бұрын
If I understod their approach correctly, between editions is when breaking changes migh happen, like Rust 2023 edition doesn't need to be backwards compatible with 2018 edition
@letsgetrusty4 ай бұрын
Editions are opt-in so they don't break backwards compatability! Also the changes are not that crazy.
@SaHaRaSquad4 ай бұрын
@@letsgetrusty But that kinda makes editions just major versions with another name. Whether you tell the compiler to compile with Rust 4.0 rules or with 202X edition makes no difference.
@gljames244 ай бұрын
You can literally choose which version of Rust you are using in your Cargo.toml. The major revisions just allow the language to develop while old code can still be compiled with the old compilers and interface with the new code.
@thingsiplay4 ай бұрын
Brace yourself. Winter is coming.
@shambhav95344 ай бұрын
Is that a triple reference?
@gljames244 ай бұрын
Hi 👋
@SadSmileGames4 ай бұрын
This is genuinly so off-putting as someone who is learning rust. Rust is quickly becoming as arcane as C++, with the difference being that C++ is widely adopted already. Why would any company willingly switch their tech stack to rust when its gonna be so hard to find qualified rust developers in the future? Sure, the advantages of memory safety is clear, but as any software developer will tell you is that the human component of development plays an extremely important role as well
@dmitriidemenev52584 ай бұрын
The benefit is that even an insufficiently qualified Rust developer will still be able to solve the problem without causing the chaos. His solutions probably won't be as simple and beautiful but he'll get the job done and it'll be harder for him to introduce subtle bugs. Additionally, Rust is still easier to learn.
@nanoqsh4 ай бұрын
Generators are in many languages like C#, Python, JS - this is a fairly high-level feature
@shambhav95344 ай бұрын
"Quickly?" Have you seen what a C++ standard update looks like? They're reserving ONE whole new keyboard. How disastrous! Rust is updated slow and steady. Old code not just compiles (like with C++), but still remains idiomatic and functions cohesively with newer features. Generators, in this case, are very well known programming concepts, and in Rust, they're kind of just iterators. I don't see why you should be so worried.
@MichaFita4 ай бұрын
Nowhere near, starting from the fact Rust doesn't have undefined behaviour.
@antifa_communist4 ай бұрын
How is any of this bad? It's not arcane at all
@paxpax17074 ай бұрын
I do not like these generators. It's just flat_map but harder to read and debug. They could have added a generic FlatMap or a Monad trait instead of this new syntax.
@crimsonmegumin4 ай бұрын
exactly!!!! all of that bs sugar is special syntax for just one monad try/? for Result/Option, async/await for Future and now gen/yield The closest thing we will had for a monad trait is the Try trait, and we can bind with ?
@lufenmartofilia58044 ай бұрын
Agreed...
@frozen_spider4 ай бұрын
Could you elaborate on how can you (efficiently) implement Sieve of Eratosthenes using flat_map? I'm genuinely curious
@wolfymaster4 ай бұрын
Where are all the rust jobs lol.
@Sonyim4144 ай бұрын
If you build it, they will come
@wolfymaster4 ай бұрын
@@Sonyim414 just like all the golang jobs that didn't exist in 2016
@RUGGEDle4 ай бұрын
You have huge audience from india if you create another channel and translate your video to a language called hindi. There are many tools which converts one language to another
@LtdJorge4 ай бұрын
This can be done from one channel too, YT has a feature for multiple audio tracks with a different language each. Although, aren't there many primary languages in India?
@ahmadamindev4 ай бұрын
I am Flutter Developer, Now gonna start learning rust for the first time. Any suggestion/tips would be appreciated. Thanks
@snowii9054 ай бұрын
Use the rust book
@MrMediator244 ай бұрын
Also flutter_rust_bridge quite a useful crate to include Rust into Flutter project
@twelvetican4 ай бұрын
The Rust book is a great place to start 😊
@oxey_4 ай бұрын
rustlings as addition to the rust book is also great. Also if it isn't the reason you're here, check out flutter-rust-bridge, it's fantastic for flutter + rust interop
@billytalentrocks3454 ай бұрын
Rust book, then rustlings code exercises
@markusfischhaber81784 ай бұрын
LOL rust is getting yield and async. Why not use c# and compile to native?
@RustIsWinning4 ай бұрын
Ah yes why not use X language because X language did it before 🤣
@trejohnson76774 ай бұрын
lol 3 years too fucking long
@bartek389120514 ай бұрын
I thought Rust was perfect programming language and does not need any improvements. If there are so many weak points of this language which must be fixed it is not good. I guess Rust language is still under construction...
@RustIsWinning4 ай бұрын
Yea sooo many flaws that make the language totally unusable. What a joke.