Get your *FREE 4-Day Rust training* : letsgetrusty.com/bootcamp
@mastrajanis2 ай бұрын
Feels like scammers page.. sends some useless videos every day for 4 days.. how this supposed to teach me rust.. 🤦🏻♂️
@Kiyuja2 ай бұрын
any progress towards a better async experience is meaningful imho.
@letsgetrusty2 ай бұрын
Agreed!
@feschber2 ай бұрын
still waiting for async drop
@FastRomanianGypsies2 ай бұрын
Bro please let me pass async fn as function pointers ffs I have to do crazy type defs + Send + Sync + 'static bs adn a macro in order to do "async callbacks".
@SchmySeymour2 ай бұрын
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?!?!?!
@RustIsWinning2 ай бұрын
Matsakis mentioned this in his talk that he gave a few years ago so it's probably him.
@TheEvertw2 ай бұрын
The generator syntax is something I was sorely missing in Rust, having learned to love it in Python.
@nathanoy_2 ай бұрын
Same, its such an intuitive way to create lazy evaluated sequences. Real pain in rust rn
@alexandervantrijffel94352 ай бұрын
I can’t wait for the async closures and parallel front-end compilation to land! Thanks for the video
@somedooby2 ай бұрын
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
@letsgetrusty2 ай бұрын
Interesting feature! First time I've heard about it
@shipweck62532 ай бұрын
what is stack bleaching?
@ThisIsNotAUsername-v3o2 ай бұрын
@@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_spider2 ай бұрын
@@shipweck6253 Erasing stack frames to clean up sensitive computations leftovers that might be accessible by direct memory reads, e.g. via some vulnerability
@LtdJorge2 ай бұрын
@@shipweck6253 zeroing the memory where the stack for a function was, after it completes. Useful for crypto stuff, so no secrets are leaked.
@SuperJJAlexander2 ай бұрын
Everybody, get ready to fight the Polonius!
@tirushone64462 ай бұрын
"Finally, a worthy oponent out battle will be legandary!"
@LibreGlider2 ай бұрын
Yoooo async closures, man!!!
@dmitriidemenev52582 ай бұрын
You already can have closures that return futures.
@eagle2com2 ай бұрын
@@dmitriidemenev5258Sure, but it is so much noise in an already verbose type system .
@dmitriidemenev52582 ай бұрын
@@eagle2com I totally agree but it's still merely a syntax sugar. The good kind of syntax sugar but syntax sugar nonetheless.
@diadetediotedio69182 ай бұрын
@@dmitriidemenev5258 and...?
@nanoqsh2 ай бұрын
@@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?
@tinrab2 ай бұрын
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.
@kuqmua7552 ай бұрын
And sorry, I don't think it's more "readable" for me. Just making things hard to understand
@oxey_2 ай бұрын
afaik in async contexts they're supposed to behave just like a stream where you await each item
@rakshith-ravi2 ай бұрын
Yield? I think the current contender for that keyword is yeet xD
@crimsonmegumin2 ай бұрын
@@rakshith-ravi yeet is for error throwing IIRC (ik it's a joke though)
@mahor12212 ай бұрын
Your work is appreciated
@yewo.m2 ай бұрын
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
@JinKee2 ай бұрын
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.
@RenderingUser2 ай бұрын
Gen fn is just a couple of characters away from green fn
@maxinealexander97092 ай бұрын
what?
@RenderingUser2 ай бұрын
@@maxinealexander9709 google it
@katazina0Ай бұрын
@@maxinealexander9709green fn
@katazina0Ай бұрын
just wait til you hear about type Shit = ...
@FastRomanianGypsies2 ай бұрын
I really wish they had a cargo tool that lets you split projects while maintaining references. The number of times I work on work on projects that reference types defined in each other and I wonder why I'm building my home in dependency hell. Maybe it's a skill issue on my part and I should just learn protobuf already, but I'm like really lazy man.
@Marlon-ld2jx2 ай бұрын
Im looking forward to use the new borrow checker :D
@meanmole32122 ай бұрын
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.
@motozirillo2 ай бұрын
BRO Just because this update doesn't include your feature doesn't mean it's not being worked on?? jfc
@meanmole32122 ай бұрын
@@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
@pierreollivier12 ай бұрын
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_2 ай бұрын
@@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.
@PotatotheTroll2 ай бұрын
@@pierreollivier1Isn'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.
@filipvranesevic87222 ай бұрын
Generators look a lot like Golangs new range over function iterators, just in Go there is no new keyword required
@toastrecon2 ай бұрын
Just started the bootcamp! So far so good.
@stasuchuvadov2 ай бұрын
I'm really miss AsyncDrop functionality Real runtime-independent AsyncDrop
@loicr12432 ай бұрын
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).
@RustIsWinning2 ай бұрын
Explain how this is terrible news. Nobody is going to write code like cve-rs.
@loicr12432 ай бұрын
@@RustIsWinning the borrower checker accepts wrongly safe assumed code, it fucks up what the language is supposed to ensure
@RustIsWinning2 ай бұрын
@@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.
@loicr12432 ай бұрын
@@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.
@RustIsWinning2 ай бұрын
@@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.
@Lege192 ай бұрын
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?
@rastaarmando70582 ай бұрын
or "public" to "pub", or "function" to "fn" which is not even a word.
@tirushone64462 ай бұрын
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
@Lege192 ай бұрын
@@rastaarmando7058pub sure but I think fn is fine
@JJSogaard2 ай бұрын
What site are you seeing this on?
@OfficialViper2 ай бұрын
The article is the official Rust blog. The code, I am not sure. Probably examples from the corresponding GitHub issues?
@TomGDrAccessibility2 ай бұрын
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.
@toto_frs6202 ай бұрын
Do you have a discord where I can ask you questions about rust?
@pcfreak19922 ай бұрын
Very excited for the new edition! Now we will have all these amazing features that came out since 2021 wrapped up :D
@Malix_Labs2 ай бұрын
Some features are nice for sure, but it does feel like Rust is fastly going towards the C++ complexity
@illegalsmirf2 ай бұрын
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-wj4yc2 ай бұрын
@@illegalsmirf rust is prolly half as complex as C#
@rastaarmando70582 ай бұрын
@@Justin-wj4yc That' a nice joke, buddy.
@Justin-wj4yc2 ай бұрын
@@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
@venugopal-nc3nz2 ай бұрын
How long it takes to learn rust ?
@ronald38362 ай бұрын
Longer than it takes Rust to become incompatible with the edition you were trying to learn.
@pnk-q9w2 ай бұрын
@@ronald3836 spreading lies is kind of pathetic
@antifa_communist2 ай бұрын
@@ronald3836 wrong.
@tirushone64462 ай бұрын
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
@ronald38362 ай бұрын
@@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.
@ParkourGrip2 ай бұрын
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.
@ParkourGrip2 ай бұрын
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.
@dubstepaztec35732 ай бұрын
😂
@meanmole32122 ай бұрын
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-heaven2 ай бұрын
@@meanmole3212 Yeah, let's solve boilerplate with even more boilerplate
@nanoqsh2 ай бұрын
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
@MostafaSobh-p9x2 ай бұрын
what is civ of thos algorithm that you mentioned ?
@Eyepatch132 ай бұрын
Sieve of Eratosthenes is an ancient way to generate prime numbers. Its from the same guy who made Geography. Its not as simple as a perfect formula. Its more like a algorithm
@andrew.derevo2 ай бұрын
Thank a lot! Not sure who made more progress in last to years rust or your english pronunciation 😅👏
@surajraika78212 ай бұрын
looks like your looks are updated with rust
@lufenmartofilia58042 ай бұрын
Still not a big fan of the gen + yield methodology 😬
@ashwinsolanki65492 ай бұрын
Happy Teachers day from India 😊
@JMurph20152 ай бұрын
Feels like Rust is heading for C++ levels of bloated 😭.
@FirstYokai2 ай бұрын
Rust is becoming JavaScript. Too many ways to solve a problem
@jongeduardАй бұрын
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.
@Maskrade2 ай бұрын
me when gen is an IEnumerable on C#
@adrian_sp6def2 ай бұрын
What about rust abi?
@Davidicus0002 ай бұрын
Fantastic!
@navi27102 ай бұрын
Linux C++ decs are about to experience an anurism.
@meryplays89522 ай бұрын
Imperative syntax??? Sacrilege!
@obinnaokafor62522 ай бұрын
Hopefully, the Linux community will become less toxic and hazardous towards rust community
@Garush2 ай бұрын
He literally keeps getting hotter wtffff
@fedang2 ай бұрын
Am I crazy or the gen thing could be done by a macro?
@nanoqsh2 ай бұрын
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
@LtdJorge2 ай бұрын
Macros are useful, but trump the LSP which sometimes breaks the code completion or inference.
@letronix62432 ай бұрын
Woah
@cathyaishu11792 ай бұрын
Gen is suspicious.. could be used to stream in LLM response 🤔.. are they laying road for AI like MOJO does.
@steveoc642 ай бұрын
The one thing Rust will never be able to add to the language is - pragmatic simplicity It’s eventually going to be its downfall
@julien20722 ай бұрын
async trait?
@sighup1242 ай бұрын
Isn’t that done for months already?
@dmitriidemenev52582 ай бұрын
Async in traits is already part of the language.
@julien20722 ай бұрын
@@sighup124 You are right I missed the train.
@sunofabeach94242 ай бұрын
don't we have enough ways of making iterators already
@VanStabHolme2 ай бұрын
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
@sunofabeach94242 ай бұрын
@@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_spider2 ай бұрын
@@sunofabeach9424 I sure hope they won't release it in such a state
@kuqmua7552 ай бұрын
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?
@jackkendall64202 ай бұрын
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-dev2 ай бұрын
30-40 more keywords and Rust will be really good
@JorgetePanete2 ай бұрын
isn't*
@norude2 ай бұрын
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
@kuqmua7552 ай бұрын
@@norude why I need to use python iterators in rust?
@curtispenner22 ай бұрын
Put it on arch Linux and macOS and it doesn’t compile. Issues error.
@mani_mincraft2 ай бұрын
What about default variables for functions?
@GreatWalker2 ай бұрын
Look up rfcs/issues/323 on the Rust repo. It doesn't seem fruitful yet.
@dubstepaztec35732 ай бұрын
You can use a macro for that if you want
@mani_mincraft2 ай бұрын
@@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?
@ParkourGrip2 ай бұрын
I'm sick of builder patterns. Give me default argument values and calling functions using named arguments.
@rasputindasilva8582 ай бұрын
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_spider2 ай бұрын
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.
@PhilSamoylov2 ай бұрын
"Major" sounds scary from the semver perspective. Rust project vowed that there will never be a major version increase, meaning no backwards compatibility breaking
@SkegAudio2 ай бұрын
it doesn't break compatibility...
@jonnyso12 ай бұрын
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
@letsgetrusty2 ай бұрын
Editions are opt-in so they don't break backwards compatability! Also the changes are not that crazy.
@SaHaRaSquad2 ай бұрын
@@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.
@gljames242 ай бұрын
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.
@thingsiplay2 ай бұрын
Brace yourself. Winter is coming.
@shambhav95342 ай бұрын
Is that a triple reference?
@gljames242 ай бұрын
Hi 👋
@RUGGEDle2 ай бұрын
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
@LtdJorge2 ай бұрын
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?
@SadSmileGames2 ай бұрын
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
@dmitriidemenev52582 ай бұрын
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.
@nanoqsh2 ай бұрын
Generators are in many languages like C#, Python, JS - this is a fairly high-level feature
@shambhav95342 ай бұрын
"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.
@MichaFita2 ай бұрын
Nowhere near, starting from the fact Rust doesn't have undefined behaviour.
@antifa_communist2 ай бұрын
How is any of this bad? It's not arcane at all
@paxpax17072 ай бұрын
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.
@crimsonmegumin2 ай бұрын
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 ?
@lufenmartofilia58042 ай бұрын
Agreed...
@frozen_spider2 ай бұрын
Could you elaborate on how can you (efficiently) implement Sieve of Eratosthenes using flat_map? I'm genuinely curious
@wolfymaster2 ай бұрын
Where are all the rust jobs lol.
@Sonyim4142 ай бұрын
If you build it, they will come
@wolfymaster2 ай бұрын
@@Sonyim414 just like all the golang jobs that didn't exist in 2016
@ahmadamindev2 ай бұрын
I am Flutter Developer, Now gonna start learning rust for the first time. Any suggestion/tips would be appreciated. Thanks
@snowii9052 ай бұрын
Use the rust book
@MrMediator242 ай бұрын
Also flutter_rust_bridge quite a useful crate to include Rust into Flutter project
@twelvetican2 ай бұрын
The Rust book is a great place to start 😊
@oxey_2 ай бұрын
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
@billytalentrocks3452 ай бұрын
Rust book, then rustlings code exercises
@trejohnson76772 ай бұрын
lol 3 years too fucking long
@markusfischhaber81782 ай бұрын
LOL rust is getting yield and async. Why not use c# and compile to native?
@RustIsWinning2 ай бұрын
Ah yes why not use X language because X language did it before 🤣
@bartek389120512 ай бұрын
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...
@RustIsWinning2 ай бұрын
Yea sooo many flaws that make the language totally unusable. What a joke.