Rust Is Easy

  Рет қаралды 158,759

No Boilerplate

No Boilerplate

Күн бұрын

Today I propose learning Rust in an unusual way: Let the compiler teach you.
❤️ If you would like to support what I do, I have set up a patreon here: / noboilerplate - Thank you!
📄 All my videos are built in compile-checked markdown, transcript sourcecode available here github.com/0at... this is also where you'll find links to everything mentioned.
🖊️ Corrections are in the pinned ERRATA comment.
🦀 Start your Rust journey here: doc.rust-lang....
🙏🏻 CREDITS & PROMO
My name is Tris Oaten and I produce fast, technical videos.
Follow me here / 0atman
Website for the show: noboilerplate.org
Come chat to me on my discord server: / discord
If you like sci-fi, I also produce a hopepunk podcast narrated by a little AI, videos written in Rust! www.losttermin...
If urban fantasy is more your thing, I also produce a podcast of wonderful modern folktales www.modemprome...
👏🏻 Special thanks to my patreon sponsors:
Affax
JC Andrever-Wright
And to all my patrons!

Пікірлер: 535
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
ERRATA 8:18 the windows installer is a console installer, not graphical, though you can double-click the installer. (or use winget install -e --id Rustlang.Rustup)
@scheimong
@scheimong 2 жыл бұрын
8:18 correction: the Windows installer is CLI, not graphical, although it can be launched with a simple double click.
@scheimong
@scheimong 2 жыл бұрын
Btw KZbin offered to translate this comment into "ERRATUM all!()" which was funny
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@scheimong oh that's fun, thank you I've never tried (I'd use WSL2 probably). Added!
@Michal_Peterka
@Michal_Peterka 2 жыл бұрын
Windows one line installer - if your windows already have winget tool or windows update containing it. winget install -e --id Rustlang.Rustup
@malbacato91
@malbacato91 2 жыл бұрын
another correction: 6:57 - that is, not, what we did. similar, but not it.
@tylerbloom4830
@tylerbloom4830 2 жыл бұрын
Addendum to "If the compiler is happy, I am happy": "If clippy is happy, I am very happy"
@tudbut
@tudbut 2 жыл бұрын
Yes!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Yes! I love running `bacon` (cargo install bacon) in clippy mode alongside my code. This is how I write this videos actually :-)
@jearlblah5169
@jearlblah5169 2 жыл бұрын
@@NoBoilerplate bacon is sooooo cool!!!! you can even do bacon run or bacon test!!!
@dinofrog926
@dinofrog926 Жыл бұрын
@@NoBoilerplate what in gods name is 🥓
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@dinofrog926 your life is about to level up! crates.io/crates/bacon I talk about bacon in my 'lightsaber' video, check it out!
@insideTheMirror_
@insideTheMirror_ 2 жыл бұрын
Find someone to love you as this guy loves Rust
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
I mostly love not being paged by work at 4am :-)
@Mr.Nobody-k3c
@Mr.Nobody-k3c Жыл бұрын
Nailed it
@BlockMag-g5l
@BlockMag-g5l 10 ай бұрын
Impossible
@doods_0
@doods_0 8 ай бұрын
Your mother?
@NStripleseven
@NStripleseven 7 ай бұрын
The transition from “your code doesn’t work, figure it out” to “your code doesn’t work, try this to fix it” is so extremely helpful that it halfway defines what makes Rust so great.
@theroboman727
@theroboman727 2 жыл бұрын
Two of my own notes that I think are important. 1: Don't rely on the rust error messages that your IDE gives you. IDEs very often take some pieces of the error message but leave a bunch of details out. Whenever its not immediately obvious what an error is saying, go to the terminal and run `cargo check` or just `cargo c`, and you legit often get help messages as useful as the ones in this video. 2: The compiler isn't always correct. The error messages can be extremely good, but the compiler does not know your intention. It can make a best guess, but its not always what you meant.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
REALLY good advice here. I often run `bacon` (cargo install bacon) in a terminal alongside my IDE for this reason
@costelinha1867
@costelinha1867 2 жыл бұрын
"The compliner doesn't know your intention" Yeah, fair enough, but honestly, even then I find these error messages pretty useful. Sure it might not be helpful ALL the time, but at least it's more helpful than the stuff I'd get from Python.
@DaveParr
@DaveParr 2 жыл бұрын
Interestingly new python errors (3.10 onwards I think) have started to look like rust. Multiline outputs with specifically pointy underlines it wants you to fix.
@avidrucker
@avidrucker 2 жыл бұрын
Bacon jokes aside, do you have a video on Rust bacon?
@dixaba
@dixaba 2 жыл бұрын
Most of the time (but not always for sure), rust-analyzer catches -stupid- obvious mistakes and suggests valid solutions for them. One of the best LSP servers I've ever used, across all languages.
@someghosts
@someghosts 2 жыл бұрын
I just want to build something one day that someone loves as much as this guy loves rust.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
what I really love is *sleep*, and not to be paged at 4am ;-)
@agnishom
@agnishom Жыл бұрын
@@NoBoilerplate you have a pager?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@agnishom I *wish*. pagerduty.com calls my phone
@MilanRubiksCube97
@MilanRubiksCube97 2 жыл бұрын
Never seen a compiler so happy while being abused in such terrible ways
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Wild, right?!
@kochkochkoch
@kochkochkoch 2 жыл бұрын
As someone who started coding earlier this year and mostly worked with TypeScript, this honestly makes Rust sound a lot more interesting than I previously thought. JS frameworks have gotten me so used to useless error messages that having the compiler itself tell me what's actually wrong feels like a breath of fresh air.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Give it a go, try Rustlings!
@lucky-segfault
@lucky-segfault 2 жыл бұрын
Rust is so good at turning runtime errors into compile time errors, I often won't run tests until I'm several hours into a project, and somehow it still works right first time (unless I forgot a todo!())
@kochkochkoch
@kochkochkoch 2 жыл бұрын
@@NoBoilerplate I got started with Rustlings yesterday and am continuing it this weekend. Honestly, I'm very impressed with it! Whenever I felt I didn't really know what to do, the hints were pretty helpful, as was the Rust book. I wish more languages had something similar to teach you their syntax and unique features, I love this hands-on approach.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@kochkochkoch I'm going through Rustlings with my team at work and I'm learning something every session too!
@kevinmcfarlane2752
@kevinmcfarlane2752 Жыл бұрын
If you’re in the client scripting space you might want to look at Elm, which has similar error messages. In fact I think Rust May have learnt this from Elm. Even if you can’t or have no intention of using Elm it’s worth looking at it once. We often learn from other tech even if we never actually use it directly.
@AllemandInstable
@AllemandInstable Жыл бұрын
crazy how No Boilerplate's videos are the only ones making me more excited to code, even though I like coding already
@NoBoilerplate
@NoBoilerplate Жыл бұрын
It's RUST doing it to me! It makes me want to build stuff!
@jonyleo500
@jonyleo500 2 жыл бұрын
As a python TA in college I feel that a good chunk of my job is reading error messages with students, that moment of realization is great. But this feels like a whole other level.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Yeah! Its important in python too, up to the limits of the language. Have you tried mypy?
@igorthelight
@igorthelight Жыл бұрын
Python is improving compile errors, inspired by Rust ;-)
@encapsulatio
@encapsulatio Жыл бұрын
Prologue lover?
@della.4593
@della.4593 2 жыл бұрын
As someone who struggled with not just Rust but programming in general for a good while I find your videos second to none. I feel you don't just show how something is done, but also why you do it. Your videos helped me shake off bad habits, one of them being ignoring error messages. I must also say you just are a great lecturer, you can break down complex topics in super understandable language without compromising on info. Something I really admire. Great video as always. ❤
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Thank you so much for saying so Della, I really appreciate it! :-)
@fabiolean
@fabiolean 2 жыл бұрын
I love this modern language design decision of having the language itself instruct the programmer. Elm does this spectacularly, and I'm excited to try it out in a lower-level language like Rust.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Great news! Though contrary to what most people will tell you, Rust isn't JUST a low-level language, it's also higher-level than Elm. Check out my video on this here kzbin.info/www/bejne/hqawiYqZZd2lgZI ALSO if you love elm, you might like Yew, which as the name suggests in inspired by Elm: yew.rs
@Shnugs
@Shnugs 2 жыл бұрын
I've been doing Advent of Code using Rust because your series inspired me. I was kind of nervous picking up a systems language* because I made the mistake of trying to learn coding initially via C++. I've got a few years professional experience using JS, Python, and PHP now and have found learning Rust to be a delightful challenge. Keep up the excellent work!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Fantastic! Don't forget to .clone() if you get in a pickle, the performance hit will be *fine*. What did I say about it not being a systems language :-P Ok, I guess more accurately, is it's a universal language - systems AND high-level. Good going! come chat to me and the community on my discord server, there's an advent of code thread!
@dinofrog926
@dinofrog926 Жыл бұрын
are we the same person? I am also doing advent of code to learn rust because this guy’s series inspired me! I am currently on day 7 :)
@Shnugs
@Shnugs Жыл бұрын
@@dinofrog926 Bruh. Day 7 hit like a truck after 6.
@dinofrog926
@dinofrog926 Жыл бұрын
@@Shnugs haha yup! I started out researching how to do trees in rust. with ownership and no null pointers and everything it seemed difficult. then I gave up and continued reading the book instead :)
@b_dawg_17
@b_dawg_17 Жыл бұрын
This video reminds me of something my math teacher once told me: "my pen is smarter than I am". She meant that by writing down what I know about a problem, I give myself help by being able to see the problem one step further along. Helpful error messages are the unsung heroes of programming.
@thatlittlefrog.
@thatlittlefrog. Жыл бұрын
I've been trying to learn rust on and off for a month now, your channel is really helpful, the videos are fast, straight to the point, and simply amazing.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you! If you've not seen it, here's how I recommend you learn Rust kzbin.info/www/bejne/aJm7f5dsrZ6mkNU
@olafbaeyens8955
@olafbaeyens8955 2 жыл бұрын
Errors are also not always clear (for new people). I had a fight with "Futures" error and it turns out that the only thing you needed to do was to add ".await" The "borrowing" is also a big fight I once in a while have. In a lot of cases it is a trial and error until it compiles. Then you wonder what I did wrong and in the end Rust compiler is right all along. It is showing me potential errors I am not even aware of.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
There's work to be done, but its worth it!
@TAINCER_
@TAINCER_ 2 жыл бұрын
Also very nice to use cargo clippy once in a while or use it in CI for bigger projects. It feels like a code review, only you don't need to wait for someone to actually do a code review :D Often with really nice code styling suggestions.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Yes! I love running `bacon` (cargo install bacon) in clippy mode alongside my code. This is how I write this videos actually :-)
@justriding119
@justriding119 2 жыл бұрын
I am a javascript web developer (with some small knowledge of python and php). Just started learning rust and IT IS INCREDIBLE. A whole another world coming from javascript.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Isn't it lovely! I'm a python webdev and its like a new world!
@tudbut
@tudbut 2 жыл бұрын
i cannot believe it knows what other languages look like and can tell you how to translate.
@wackender9542
@wackender9542 Жыл бұрын
Also just started learning rust, and I noticed the compiler almost immediately becaus of it's quality. But didn't know it was that good.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
so lovely, isn't it!
@cerulity32k
@cerulity32k Жыл бұрын
The errors you get from `cargo check` are better than the ones rust-analyzer gives you because the window that pops up when you hover over a red squiggly has less formatting than the console, which is a feat.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Agreed, and `cargo clippy` even better! I run clippy in a separate window, even when I use my IDE, using crates.io/crates/bacon Check out my 'lighsaber' video for more info on my toolkit
@sitton76
@sitton76 2 жыл бұрын
I often describe the rust compiler as a helpful nanny, walking you through your mistakes and giving suggestions on how to correct them.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Absolutely, in other of my videos I've described it as a driving instructor, helping you navigate the dangerous highway. Similar!
@io_inc
@io_inc 2 жыл бұрын
Thanks to you and @Primeagen, i'm actually learning rust and hoping to port all my production applications to rust!!! Great Content!!!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
He's fantastic too, also check out Code To The Moon!
@seraaron
@seraaron 2 жыл бұрын
As someone who's still learning programming, I'm happy to say that I haven't gotten into the habit of *only* reading the first line of an error code yet, though I do often duck it if I can't figure out what the rest means, so these error codes in rust seem like a godsend to me!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
They really are!
@ahuman32478
@ahuman32478 Жыл бұрын
Started coding in Rust yesterday. I'm working on the PNGme practice project. The compiler doesn't make coding as easy as this video makes it seem. The compiler keeps on giving me weird errors about Boxes, Dyn, etc, and most of the time doesn't spoonfeed me the answers like I was expecting. Plus, I'm struggling with using iterators. Also, there's a lot of nuances to the language, like when to use into_iter or iter, when to use unwrap or expect or the ? operator. The only thing that keeps me going is knowing that this is way easier than C++, yet just as performant. I struggled with CMake, Dlls, etc. trying to import the SFML graphics library into a C++ project. Soon, I just decided to give up on it. With Rust, I know that Cargo has my back to make importing and using dependencies a breeze. Plus, I'll never get a SegFault. All I gotta do is keep on going, even when it feels like I'm wasting my time on this
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Pause right now and complete Rustlings, then go back. My recs here: kzbin.info/www/bejne/aJm7f5dsrZ6mkNU
@ahuman32478
@ahuman32478 Жыл бұрын
@@NoBoilerplate Hello, I am enjoying Rustlings. I got stuck on the Clippy exercises, but then found out that I just have to compile the exercises to get the Clippy feedback
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@ahuman32478 You've got it! run `rustlings watch` to get the nice feedback (bacon style), and don't forget to run `rustlings lsp` once to set up vscode's hints and such, with Rust Analyzer.
@chrissaltmarsh6777
@chrissaltmarsh6777 2 жыл бұрын
It is like C but without the danger - this is because modern machines can do all that cool analysis without your having to wait an hour for the compiler to strain through. I very much like it; gets me close to the metal where I am playing without the occasional frustration of working out why my foot is smashed up.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Yeah! I'm having so much FUN!
@chrissaltmarsh6777
@chrissaltmarsh6777 2 жыл бұрын
@@NoBoilerplate I had a lot of fun back in the day hitting CAMAC interfaces to our particle detectors. But boy could you fall down the hole. Now I'm doing stuff on raspberry PI and I do not have to hobble around anymore. Rust is very clever.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@chrissaltmarsh6777 Cool! I'd love to do bare-metal on the pi
@chrissaltmarsh6777
@chrissaltmarsh6777 2 жыл бұрын
@@NoBoilerplate You need to ask the compiler politely - 'I Really Really want to hit this address' And then you are cooking. Mind you, doing it with C was lots of fun as well. That frisson of fear.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@chrissaltmarsh6777 hehe I prefer less fear. I'd never have picked up a language with pointers if it weren't for Rust!
@jumbledfox2098
@jumbledfox2098 Жыл бұрын
I'm 16, always been programming, from scratch to python to C++, but I've always felt that something was missing. You've shown me rust, and it not only feels like the missing piece has found, but a whole other darn contraption
@NoBoilerplate
@NoBoilerplate Жыл бұрын
If you are very lucky, you could use JUST RUST for your whole programming career - web, bare-metal chips, and everything in between. I'm hoping to only use Rust, now, for the rest of my career :-)
@jumbledfox2098
@jumbledfox2098 Жыл бұрын
@@NoBoilerplate Thanks for the reply! I hope to also only use Rust, it's really brilliant. Just wondering, I've been meaning to recreate this simple little scratch game as a rust web game for a little while now, do you have any pointers for me?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@jumbledfox2098 Oh fun! Yes, though I've not done much game development, whenever I hear "game" and "Rust" in the same sentence, I also hear "Bevy". bevyengine.org/ Come chat on my Discord (noboilerplate.org), there's loads of folks who could help you with it! Tag me and say hi 🙂
@jumbledfox2098
@jumbledfox2098 Жыл бұрын
@@NoBoilerplate Thank you!
@kaisershaik
@kaisershaik Жыл бұрын
​@@jumbledfox2098did you just say… POINTERS?
@ElectronicaSovietica
@ElectronicaSovietica Жыл бұрын
This is a fantastic demonstration of the help you can get from the rust compiler. Also thanks so much for the link to rustlings - such a great way to learn: by debugging!
@Felix-ve9hs
@Felix-ve9hs 2 жыл бұрын
I'm not a programmer, but IMHO this is what all compilers should do. Error messaged should have a meaning. Without that It's like a firewalls that logs "I guess someone is attacking your network" or or syslog telling you that "one of your programms stopped working".
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Wild that most languages dont, right? I think the langues with the best errors also have a lot of syntax - which makes sense, I think, as that gives more clues to the compiler
@nightbane2889
@nightbane2889 Жыл бұрын
I only just bumped into this channel. I been itching a bit to try programming again...and not gonna lie, this is sounding VERY nice. Sure the complier isn't perfect as the comments pointed out...but the fact that the complier at least attemps to help you learn the language is something else
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Check out the rest of my Rust videos, I have them in a playlist, and then get cracking with The Book doc.rust-lang.org/stable/book/
@justcodingjumperbot_
@justcodingjumperbot_ 2 жыл бұрын
I am now fully tempted to learn Rust like how I learn other languages: Mess with the compiler. And yes, I'm tired with sub-millisecond Java code now. Maybe I'll just finish that feature I was working on and then migrate the whole UFB project to Rust.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You'll have a terrific time. I know what you mean, compiler-driven development is fun, especially so in Rust. Here's my recommendation on how to dive in: kzbin.info/www/bejne/n5fEfZ5rq5iKb5I
@miguelguthridge
@miguelguthridge 2 жыл бұрын
I genuinely love Rust's helpful compiler messages, but sometimes its design is still far more difficult than other languages. For example, a few weeks back, I was trying to create a system where struct instances could register one of their FnMut methods with a plugin manager to use it as an event callback if certain criteria were met, but the lifetime requirements sadly got too out of hand for me to implement it in a reasonable amount of time. I'd really appreciate a video explaining how to tackle the more complex (usually lifetime-related) issues that the compiler can give, since although Rust makes the easier parts very easy, it can make complex systems much more challenging to write when you don't know how to tackle these sorts of issues.
@philippecholet9484
@philippecholet9484 2 жыл бұрын
Yeah lifetimes are not easy. I'm still in the "is the compiler happy with this lifetime change? Or this one?" phase.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
clone everything my friend! Though you sound like you know how to do it. In your case, I'd re-consider your design, it sounds like you're working against the compiler - Rust has a way of doing things that is very strict, what we get is compile-time verification of our model, what we lose is the ability to write anything we want. I'm happy with this compromise!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
instead of using references, try .clone()ing everything while you're learning :-D
@miguelguthridge
@miguelguthridge 2 жыл бұрын
@@NoBoilerplate yeah I think the issue is that I need it to be stateful, so if I'm cloning everything I lose the shared state for all the callbacks associated with one struct
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@miguelguthridge You, my friend, do not need my help! Come ask in #programming on my discord server if you like, there's some geniuses over here!
@alfaromeocharliehotelbravo928
@alfaromeocharliehotelbravo928 2 жыл бұрын
Dude this was an exciting video! I can't wait to watch more like this. I'm currently at my 3rd day(77/94) on the Rustings exercises and It's damn good.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Nice! I love rustlings so much. Have you seen my whole Rust series? kzbin.info/www/bejne/h2Skma1-pp2indU
@alfaromeocharliehotelbravo928
@alfaromeocharliehotelbravo928 Жыл бұрын
Yes, some of them. The more I learn about Rust, the more I like them 😃
@2raddude
@2raddude 2 жыл бұрын
Thanks again for another great video. I feel inspired to mess around in my IDE every time you publish. Having such powerful tools at my disposal really compels me to build something cool. Because Rust is so fast, I almost have the urge to build a program that crunches a ton of numbers on many different threads, just because I can :D
@2raddude
@2raddude 2 жыл бұрын
Sometimes having fantastic tools around can provide the inspiration for amazing projects. Woodworkers feel this sometimes, if you have a lathe sitting around in your shop maybe you'll get the idea to turn a gorgeous bowl or vase.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
RIGHT! This is how I feel about the Rayon library crates.io/crates/rayon you can make any iter a parellel iterator with par_iter() - WHICH I WANT TO DO NOW!
@2raddude
@2raddude 2 жыл бұрын
@@NoBoilerplate WHAT!?!? That might just be the coolest crate ever
@blueninja012
@blueninja012 8 ай бұрын
this video made me realize that I have some weird deep-rooted fear of reading error messages
@Hohmlec
@Hohmlec 2 жыл бұрын
I started learning Rust with lovely videos made by Tris. Thanks a lot
@NoBoilerplate
@NoBoilerplate Жыл бұрын
My pleasure, and thank you! Do join my Discord if you'd like help!
@ChannelSho
@ChannelSho Жыл бұрын
I remember doing the tutorials from the Rust book and got to the point where they deliberately made an error so the compiler would catch it and as soon as I saw what the compiler spit out I immediately went "okay, I'm sold"
@NoBoilerplate
@NoBoilerplate Жыл бұрын
This is the way!
@SimGunther
@SimGunther 2 жыл бұрын
Very much the same as a dojo instructor giving you instant feedback, but they're not a mind reader, so being clear about your intentions helps them give you better feedback. Too bad that it can't tell whether or not I "meant" for the program flow to go one way only for it to go a completely different direction as far as high level program design is concerned.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Agreed, though with sum types (ie, Rust's enums), you can express your intent much better than in languages that don't have sum types!
@nikolausluhrs
@nikolausluhrs 2 жыл бұрын
I think this is going to be the video that finally gets me to learn rust.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Give it a go! Rustlings is such a great resource to teach through doing
@duckhuntergaming4713
@duckhuntergaming4713 Жыл бұрын
I've been working on designing a system's programming language for a couple of months now, and I have to say your videos made me heavily interested in Rust. Being a long time C programmer who has worked on kernel development, nothing has rocked my understanding of imperative languages and type systems as much as Rust has. The main areas we have identified in our PL design efforts are the type system (classes and oop stuff is a sub category), primitives for pre emptive/cooperative/distributed parallelism, structured programming primitives (loops, branching mostly), error handling, meta programming (generics, macros), syntax + semantics and most importantly increasing cohesion and decreasing inter component coupling. Rust addresses most of these problems so well that we're left wondering if there's still meaningful room for improvement. I would love to discuss these aspects of the language as well as generally, and I would love to know what you think are some shortcomings of Rust and other system's languages you may be familiar with.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I'd love to chat about this too, join my discord (links in video description) and ping me in #programming - there's lots of smart folks who are interested in language design! Here's a tip to start off: Because Rust has a proper lisp-style macro system, you can write your language INSIDE rust, not just USING rust. That way you get all of the language features you love for free (including lsp ide support). Here's an example that might blow your mind: github.com/JunSuzukiJapan/macro-lisp
@KohuGaly
@KohuGaly Жыл бұрын
The one area where big improvements are due in Rust is the implementation of its type system. At the moment, it has some nasty limitations. Do you want to make a trait method const? or async? or use impl in return type? or make async closure? well, too bad, not supported yet.
@felixfourcolor
@felixfourcolor 9 ай бұрын
I love the idea of giving rust a completely different language and follow the compiler's error messages to transform it into valid rust. Can you make another video that expands on this idea, but with a less trivial codebase, like 100 lines?
@martinemanuel8239
@martinemanuel8239 2 жыл бұрын
This channel gives me a feeling of love to a low level language like C when I started learning to program, I will go for rust.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Its really incredible isn't it!
@AzureFlash
@AzureFlash 2 жыл бұрын
"You need to add an ampersand here, dummy" - Rust compiler, millions of times a day across the world (I'm exaggerating for comedic effect, the Rust compiler is actually very nice about it)
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
It's so patient!
@philippecholet9484
@philippecholet9484 2 жыл бұрын
I like your videos so much that I get out of my rss feed to like the video, every time, and read some nice comments. I did Advent of Code 2021 in two weeks last month (I'm might have too much free time though) and doing AoC 2022 🎄 in rust again, the compiler is my buddy.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Fantastic, and thank you very much! Have you tried bacon? (cargo install bacon) so good for running in a terminal while you code!
@philippecholet9484
@philippecholet9484 2 жыл бұрын
@@NoBoilerplate Not yet, the error messages in my IDE (Sublime Text) when I save a file (with rust-analyzer I think, I don't remember how I installed it) are usually enough. But I'm gonna try it considering how much you like it.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@philippecholet9484 I don't think it has any complex dependencies, so you could test it out quite easily with a cargo install. I dive into my toolkit recs here kzbin.info/www/bejne/n5fEfZ5rq5iKb5I
@philippecholet9484
@philippecholet9484 2 жыл бұрын
@@NoBoilerplate I've seen all your videos (hopefully/sadly shorts enough) and this one **multiple** times. I tried bacon since my last comment: I like the "press one SINGLE key to change bacon job", I'll dive into its customization.
@olafbaeyens8955
@olafbaeyens8955 2 жыл бұрын
One of the big resistance to Rust is the fact that Rust code can look very messy. Full of ".unwrap().unwrap().to_string()." For new developers that look at it, it is scary. And also gives the impression that it produces bloated code hard to maintain. It is hard to convince managers that you are not wasting time but also your fellow developer colleagues. However I did manage to create (currently sloppy code) that can execute 1000 parallel threads to test a web site. Not only did I do this in a faster development cycle than any C# program would, I suddenly have the freedom to go beyond any C# capable code. I develop faster because I trust the Rust compiler to catch any mistakes I make.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
The way I look at it, unwrap()s are for protyping code - take a look at my vide Rust On Rails for my recommendations here
@thomasfrans1185
@thomasfrans1185 2 жыл бұрын
These videos are so good. They make Rust even better!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Other way around - rust is so good I am doing everything I can to make it more widely known
@thanatosor
@thanatosor Жыл бұрын
What a lovely compiler ! 99% reason behind my pick on Rust, beside borrow-checker, no GC, high perf and every other nice things.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
even macros! What a delightful language.
@Big-Chungus21
@Big-Chungus21 Жыл бұрын
Definitely going to have to learn Rust at some point then. I like how useful the errors output by the interpreter in Python are for example, and this is even better. Errors in C++ from my experiences so far are… not very useful by themselves.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You'll have a really great time, here's a little playlist to get up to speed quickly, though I have plenty of videos elsewhere! kzbin.info/www/bejne/pYqTiaqDhLitp5Y
@donparkison4617
@donparkison4617 Жыл бұрын
Honestly, this is why I have always leaned towards C# and avoided Javascript. It might not have the best explanation of compile errors, but it beats the heck out of everything else I have used. Just started my Rust journey, and I am excited to code again.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You're in for an absolute TREAT Don, make sure you've watched at least this playlist, and my "how to learn rust" video kzbin.info/www/bejne/pYqTiaqDhLitp5Y
@dragon_pi
@dragon_pi 2 жыл бұрын
error: Ferris cannot be used as an identifier let 🦀 = ""; | ^^ help: try using their name instead: `ferris` ^ this is an actual compiler error
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
oh that is ADORABLE
@FryuniGamer
@FryuniGamer 2 жыл бұрын
Rust doesn't guarantee that there are no memory leaks on any piece of code. Leaking memory is entirely safe. You can make a cycle of Rc/Arc You can Box::leak You can Box::into_raw and never get the box again You can mem::forget something that holds any smart pointer All of those are entirely safe operations. It was never the goal of Rust's model to ensure that there are no memory leaks.
@gamechanger1222
@gamechanger1222 Жыл бұрын
I love the voice of this guy, now as go programmer i love rust too.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You're too kind! I've perfected my voice on 11 seasons of my hopepunk/scifi podcast, Lost Terminal, what do you think of it? kzbin.info/www/bejne/pmTFdXhvoNitg8U
@qm3ster
@qm3ster Жыл бұрын
Would be good to see some clippy rubbed on this exact example, as part of the video, or a follow-up. By default, it got rid of the unnecessary `return`, but with #![warn(clippy::pedantic, clippy::nursery)], it also told us to accept &str instead. Seems like it hasn't yet been taught to see `format!("hello {name}")` as preferable here, though.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Very correct! I was ignoring a lot of clippy errors during my testing here, in order to get the most bare-bones rust experience, for newbies. I love clippy, and run it with those and many other options inside a `bacon` session, alongside my ide!
@bil4x467
@bil4x467 2 жыл бұрын
This is so true! I noticed this coming from C languages to Rust.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Best errors in the business!
@TonyUnderscore
@TonyUnderscore 2 жыл бұрын
2:35: "It doesn't seem like we are writing a method" I'm assuming you meant to say "a *self* method", love your channel!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
functions are not called methods in Rust, unlike in Ruby. I don't think I'm wrong?
@TonyUnderscore
@TonyUnderscore 2 жыл бұрын
​@@NoBoilerplate Ah I see what you mean. Did not realize that they actually mean a different thing. So methods are those attached to structs while functions are not? In any case, you could probably make a clarification for those that are unaware.
@avidrucker
@avidrucker 2 жыл бұрын
My understanding is that methods bound to classes/objects, whereas functions are not. Similar to attributes/member data and variables.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
@@TonyUnderscore exactly, methods are functions attached to types doc.rust-lang.org/rust-by-example/fn/methods.html
@TonyUnderscore
@TonyUnderscore 2 жыл бұрын
I see, I never realized they actually mean different things because I heard them used interchangeably in some languages, good to know I guess.
@warisulimam3440
@warisulimam3440 Жыл бұрын
This video was convincing enough to get me to start learning Rust immediately.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Wonderful! I felt that way when reading the fasterthanli.me article, I based the video one! Here's my short playlist of the best rust features, and how I recommend learning it: kzbin.info/www/bejne/pYqTiaqDhLitp5Y
@LukasMosser
@LukasMosser Жыл бұрын
Important to note that the help statements where only available after updating to rust 1.65
@stxnw
@stxnw 2 жыл бұрын
Yes, "cannot borrow `x` as mutable more than once at a time" is soooo helpful.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
That sounds pretty clear to me?
@OzoneGrif
@OzoneGrif Жыл бұрын
I'm a Java dev and I want to learn Rust so badly; it seems like an amazing language.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
That's great news! You'll have no problem learning it, it's very easy to learn. Many of Rust features are shared with Java (such as the Optional type), but Java, by it's complicated nature, can't implement them properly. Try : 1. The Rust Book. 2. Rustlings 3. everything on fasterthanli.me
@BurzowySzczurek
@BurzowySzczurek Жыл бұрын
My main language is java too, and I plan to learn rust too. I had started reading the rust book around a month ago. I finished the chapter 2. and started reading 3. But then I got busy and forgot about that. But now after two of your videos i'm lying in my bed at 23:48 (11:48 pm) and thinking about going back to learning rust tomorrow. Thanks for the hints.
@ReedoTV
@ReedoTV 2 жыл бұрын
1 crucial piece of advice: If you end up using an Arc, delete everything and start again.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
heh, certainly in application code, you'll not have to do that
@yondaime500
@yondaime500 2 жыл бұрын
I love how some people say it's a bad thing that Rust does all that, and that "real programmers" don't need it. It's hilarious. Rust also makes it really easy to define and enforce quality standards in your project. In your lib file: #![forbid(unsafe_code)] #![warn(missing_docs)] #![warn(clippy::unwrap_used)] #![warn(clippy::todo)] #![warn(clippy::panic)] Then in your CI: cargo fmt --check --verbose cargo clippy -- -D warnings You can add plenty of other lints (rust-analyzer gives you a list with explanations on what each one does when you start typing). The warn level lets developers take some shortcuts while working with the code locally, but reminds them to clean everything up before pushing. And the pipeline ensures that code doesn't get merged until it's basically flawless. There's also cargo-deny, which searches your dependencies for known vulnerabilities and incompatible licenses. And probably many other tools I don't even know about yet.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
I dig this a LOT. Have you seen no-panic, a macro that forces the compiler to prove that no execution paths could panic? crates.io/crates/no-panic
@yondaime500
@yondaime500 2 жыл бұрын
@@NoBoilerplate I saw it on one of your previous videos, but I haven't tried it yet. I imagine it gets hard to use when you have lots of dependencies, since most of them do not guarantee that there are no panics, and often you have to turn on optimizations for the panics to be optimized out. I kind of wish there was a keyword for that in the language itself, like unsafe but the other way around ("extra_safe"? IDK), so it would get checked at compile time rather than link time, and maybe more crates would adopt it. But maybe an attribute that keeps you from using basic arithmetic operators on integers or clamp() on floats would be so annoying that no one would bother with it. Who knows...
@NoBoilerplate
@NoBoilerplate Жыл бұрын
​@@yondaime500 Yeah, we have to draw the line somewhere, for me in normal code I use checked maths and never .unwrap() (enforced with clippy) and then don't worry about oom panics or other rare stuff.
@steffahn
@steffahn Жыл бұрын
Missed opportunity: Follow up by using clippy to make this code more idiomatic. Doesn’t give too much in this particular case, but clippy certainly “teaches” some things really well, too. (It doesn’t help you go all the way in this case; arguably, the argument type of this function should become `&str`, and there’s no compiler or `clippy` telling you, AFAICT.)
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Very correct! I was ignoring a lot of clippy errors during my testing here, in order to get the most bare-bones rust experience, for newbies. I love clippy, and run it with those and many other options inside a `bacon` session, alongside my ide!
@steffahn
@steffahn Жыл бұрын
@@NoBoilerplate Yes, `bacon` is indeed very useful.
@chakibchemso
@chakibchemso 10 ай бұрын
I remember moving from c# to c++ and it was a horrible experience with the compiler and linker, especially template errors and linking. The messages are nearly of no use at all :/
@ex0ja
@ex0ja Жыл бұрын
As a beginner I do feel like rust is the easiest language I've tried so far, mainly because of the way cargo works and the errors.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
This is a very heartening take - I've got plans for a series of videos about how to go from zero to rust, without learning any other languages first. And it's for this exact reason - Rust helps you SO much at the start!
@ex0ja
@ex0ja Жыл бұрын
@@NoBoilerplate I'd greatly appreciate that as that's what I'm doing!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@ex0ja It might be a few months before I get to it, however make sure you've seen my 'getting started' video for now, I've got my learning recommendations there: kzbin.info/www/bejne/aJm7f5dsrZ6mkNU
@ex0ja
@ex0ja Жыл бұрын
@@NoBoilerplate yes I have and I'm following your advice, I've just finished Ultralearning yesterday ☺️
@ahuman32478
@ahuman32478 Жыл бұрын
Hi. I've been watching your Rust videos for a while and I want to start programming in Rust now. I installed Rustup and am trying to configure my workspace right now. Rust is asking me to install MSVC build tools, but they're also offering me the option to skip ahead if I'd rather use the GNU ABI. Would you recommend using the MSVC toolchain or go the GNU pathway? I believe that software should be able to support all platforms, so I want to make sure my applications support Windows, Mac, AND Linux
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Cross-compilation is trivial in Rust, so you can usually code on one platform, and make binaries for any other platform. I'm uncertain about developing on windows, however, I've heard that it's best to use WSL2, to give a much nicer experience. WSL is really great these days, and will side-step this, and many other issues you'll face learn.microsoft.com/en-us/windows/wsl/install
@ahuman32478
@ahuman32478 Жыл бұрын
@@NoBoilerplate Tbh my computer is on the verge of running out of memory, less than 10 gigabytes left. Got no room for a Linux subsystem. But I will take your advice that cross-compilation is easy no matter the platform and use MSVC since it's the recommended toolchain for Windows. Thanks
@nichtgestalt
@nichtgestalt 10 ай бұрын
I know nothing about programing and I'm not sure if I have the talent for that but it is tempting to give it a shot.
@porky1118
@porky1118 2 жыл бұрын
One of your best videos so far.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Thank you so much, I'm so pleased with it - I ditched the video I was going to produce this fortnight, and instead did this one - rewriting everything on Tuesday!!
@aryabp
@aryabp 2 жыл бұрын
you not come to RUST, RUST come to you
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Ah yes, rule # of our cargo cult XD
@coldtech06
@coldtech06 2 жыл бұрын
no one is safe from oxidation...
@borat1
@borat1 2 жыл бұрын
holy crap, you actually run LT? I've been binging it after I found it on another one of your vids. Great podcast!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Sure do! And Modem Prometheus, though I don't voice it, I'm producer. And a new podcast in pre-production coming in the new year... STAY TUNED!
@FishyBearBeer
@FishyBearBeer 2 жыл бұрын
I feel like a child being walked through homework. It's that easy!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
The compiler really holds your hand!
@vullkani
@vullkani 7 ай бұрын
I am an absolute begginer into coding, I've started with Python, but than I looked into Rust and your videos are compelling me to learn Rust first. I watched your other video, I started reading the book, but it seems it is not for absolute beginners. I wish you had a course for someone like me with adhd who wants to start with code at 35 years of age.
@woosix7735
@woosix7735 7 ай бұрын
I hope ALL the other programming Languages are talking notes here
@navjotsingh2251
@navjotsingh2251 2 жыл бұрын
Imagine if they incorporate an alternative to GitHub copilot to the rust compiler, so that the help will use the power of machine learning similar to copilot that recommend solutions as well based on code it has trained from. Would be interesting to see using that to help you develop using rust too.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I see them as two distinct projects - the ML algorithm is probably right, but the compiler is DEFINITELY right!
@navjotsingh2251
@navjotsingh2251 Жыл бұрын
@@NoBoilerplate it was just a thought. Would be interesting to maybe get two recommendations, a compiler recommendation and maybe a machine learning recommendation (based on the best code solution it could find) to help you fix an error. Not sure how easy it is to add this directly to a compiler and make it run smoothly, but it was a little idea in my head 😅 Maybe this could be researched to see it's practicality in the real world.
@TheCollectiveHexagon
@TheCollectiveHexagon 10 ай бұрын
8:10 ik the link is on screen but would be nice to have it on description/on the pinned comment so people can find it(if they got low vision/blindness/any other reason) too :)
@gigacool30
@gigacool30 Жыл бұрын
Coming from C++, Rust compiler output is a miracle
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Hell, coming from python, js, ruby etc, it's still a miracle!
@Thorhian
@Thorhian 2 жыл бұрын
Thanks for the awesome video! Also, is this a Norg slideshow lol?
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Obsidian.md slideshow! See the description for source repo
@Thorhian
@Thorhian Жыл бұрын
@@NoBoilerplate Obsidian sure does look nice. I don't think I really need it that badly, and no commercial use or FOSS version is kind of a turn away.
@Techieadi
@Techieadi Жыл бұрын
Once a legend said "read the error AGAIN!!"
@4sat564
@4sat564 Жыл бұрын
Best Rust preacher ever
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Welcome to the cargo cult! XD
@eboatwright_
@eboatwright_ Жыл бұрын
Cargo is _literally_ the best package manager I've ever used, and probably will ever use.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Let's not get religious - we'll continue making better languages forever! But Rust is the best for now :-)
@eboatwright_
@eboatwright_ Жыл бұрын
@@NoBoilerplate Definitely
@neoney
@neoney Жыл бұрын
rustc is the compiler :p
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@neoney fair, though I think it's reasonable to wrap up rustc, check, clippy etc into "cargo" 😂
@gkvikram
@gkvikram Жыл бұрын
Whats your opinion on natural intuitive value on designing distributed concurrent systems when we are forced to choose between rust on one aile(or C++n java on the same aile)and functional programming languages like Haskell,scala on the other side
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Don't forget Go - though I think Rust is better than Go, go is still extremely good (though it has a GC, no macros, and no super powers). I'd say Rust has a lot of functional flavour built-in - the original compiler was writtin in ocaml, and even at one point had an functional purity system, though it was removed, as the Result passing convention works so well. You can see the functional influence in both the iterator system, and the monads `Result` and `Option` which are foundational to the Rust standard library and ecosystem.
@caiosym3009
@caiosym3009 Жыл бұрын
Just found your channel and really appreciate the video's structure! Quick errata, but on 6:58, thats not exactly what we did. We fixed the functions return type, not the type of the argument being passed to it or the argument's type itself. Kindly,
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you!
@olafbaeyens8955
@olafbaeyens8955 2 жыл бұрын
In RUST we TRUST.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
This is the way!
@jaha9329
@jaha9329 2 жыл бұрын
Hey, I don't have any experience with writing code, I only work as a software QA. Is Rust possible to learn without any academic background or would you recommend starting with other languages? Is Rust viable for creating games?
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
I believe you're commenting on a video where I showed that no experience was needed to get started - it's not a trick! :-) Check out my other videos, especially kzbin.info/www/bejne/mKOWeHx_hsqYnLs For more background. A lot of game devs on my server love bevyengine.org - but come and ask them yourself!
@andyp123456
@andyp123456 Жыл бұрын
There are several game engines that are written in Rust, the most popular being Bevy.
@catbb
@catbb 2 жыл бұрын
will do rust for sure on my wasm project. so i could interact module through flutter. 🦀 Q : is there any difference between standalone wasm modules created by assemblyscript / emscripten and rust wasm modules ?
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Great question, sorry I don't know the answer. Come ask that exact question on my discord in #programming and you'll get a lot of good answers.
@chronosVR.2763
@chronosVR.2763 2 жыл бұрын
i like compilers like this
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Me too. Haskell's pretty great too
@RemizZ
@RemizZ Жыл бұрын
It's insane that even though you *just* told me to actually read the error, my immediate reaction to the first error dump was to not even read the first line properly. This will be a very hard habit to break...
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Whatever language we use, I bet this is a good habit to break!
@JulienLucca
@JulienLucca 2 жыл бұрын
After a few years using it and a week or so using both, I feel like Elm's compiler is WAY better. Rust is the second best!
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Fun! Could you elaborate?
@JulienLucca
@JulienLucca 2 жыл бұрын
@@NoBoilerplate Sure! I mean, it's a KZbin comment. But on Elm the error messages are even less cryptic. The video shows how to follow the compiler helps us find the solutions to the compilation errors. But on Elm it's spot on! I ran into an unexpected symbol: 27| type alias Model = Int | String ^ I was not expecting to see a | here. Try deleting it? Maybe I can give a better hint from there? Some other: Something is off with the body of the `init` definition: 32| "" ^^ The body is a string of type: String But the type annotation on `init` says it should be: Model LAST EXAMPLE, Check it out This `case` does not have branches for all possibilities: 46|> case msg of 47|> Increment -> 48|> model + 1 49|> 50|> Decrement -> 51|> model - 1 Missing possibilities include: SomethingElse I would have to crash if I saw one of those. Add branches for them! Hint: If you want to write the code for each branch later, use `Debug.todo` as a placeholder. Read for more guidance on this workflow. You can just elm-lang.org/examples/buttons and fiddle around making compilation fail somehow by experimenting. Its more straightforward
@JulienLucca
@JulienLucca 2 жыл бұрын
and that being said, both are very different, Elm is for a very narrow context: web applications. Rust is way more flexible. Having working a lot with Elm, I do think it's similar to how Rust works in some areas like error handling. Compiler messages are just friendlier and easier to read
@caseykawamura8718
@caseykawamura8718 Жыл бұрын
I’m curious how well you could prompt chat gpt with the rust compiler. Might be a good AI automation language.
@yiyoascen
@yiyoascen 2 жыл бұрын
How would you recommend to get the first remote rust job? I'm in México and most companies don't need it and I'm kind of sick of web dev
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Keep an eye on Microsoft and AWS especially, they're HUGE hirers of Rust. Also, contact every one on this list www.rust-lang.org/sponsors
@axa993
@axa993 2 жыл бұрын
Well this looks really impressive
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
You've not seen anything yet - check out my other rust videos!
@jaroslavhuss7813
@jaroslavhuss7813 2 жыл бұрын
If there is a Rust's mascot, it should be Tris, not the crab :) God I love these videos.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
I'm more of a cheerleader XD
@awwastor
@awwastor Жыл бұрын
The compiler being happy doesn’t mean there are no memory leaks. Box::leak is safe, although it makes it obvious that memory is being leaked. But, creating an Rc cycle will also leak memory and might well be accidental
@NoBoilerplate
@NoBoilerplate Жыл бұрын
True! A few people have reminded me of this. Would you say in general terms, you'd have to TRY HARD to leak memory in Rust?
@awwastor
@awwastor Жыл бұрын
@@NoBoilerplate Well it's easy if you want to leak it (which is good, it's sometimes useful). I think it really depends on the abstraction you use, if you use the Rc type to make graphs or other complex shared ownership data structures, especially intrusive ones, you may well encounter some leaks. If you don't then it is quite rare
@KohuGaly
@KohuGaly Жыл бұрын
@@NoBoilerplate I'd say in Rust, memory leaks are as unlikely to happen by accident as in most GC languages. You can do it on purpose with Box::leak. You can do it by accident with Rc-based graphs. But littering Rc liberally is already a red flag, tbh.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@KohuGaly Righto - makes sense! Yes, Rc is useful, but spooky - I think in normal use, we'd just use references and not have a problem!
@IvanArdillo
@IvanArdillo Жыл бұрын
I'm a C# developer and you are making me feel I need Rust. I don't know I could use it on my daily job or for doing some side project. Do you have any advice? I do consultancy, so the well known webapp/database stuff for companies
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I'd say start with either backend web development with rocket.rs, or frontend web development with yew.rs, depending on your experience and interest. Some more of my advice is in this video, if you've not seen it: kzbin.info/www/bejne/apXZl2mhgpxjp68 And how to learn rust is in the latest video here kzbin.info/www/bejne/aJm7f5dsrZ6mkNU Come talk to me on my discord, over in #newbie-advice, links in the description, Good luck! :-)
@IvanArdillo
@IvanArdillo Жыл бұрын
@@NoBoilerplate 🙏🙏🙏
@IvanArdillo
@IvanArdillo Жыл бұрын
@@NoBoilerplate 🙏🙏🙏
@deekshantwadhwa
@deekshantwadhwa 2 жыл бұрын
If the compiler can produce suggestions for what might work instead of what we've written, wouldn't it be easier if we could just press a button to try out if that suggestion works without manually changing our code and another button to accept those changes if they do? Instead of manually trying it out and undoing it if it didn't work.
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Maybe! The compiler doesn't have all your context though
@cno9984
@cno9984 2 жыл бұрын
While in this case the function does produce the correct result, it is not optimal. It would be better if the function took a string slice as an argument to prevent unnecessary cloning or constructing a String instance. fn hello(name: &str) -> String { "hello ".to_owned() + name }
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Of course, but I'm going for very specific beginner code here - we often tell beginners to not worry too much about performance until they've got the hang of it. .clone() for eg.
@ocircles738
@ocircles738 2 жыл бұрын
It's like C# at a Halloween party dressed up as Python and pretending to be nice to everyone
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
I've always though of it as Haskell and lisp sneaking into the cool languages party in C's overcoat
@nyuh
@nyuh Жыл бұрын
whoa i knew the compiler was advance but i didnt know it is THIS advance. maybe i need to try to start learning it again...
@NoBoilerplate
@NoBoilerplate Жыл бұрын
It's got SO much better since I started in 2020!
@johnwick2018
@johnwick2018 2 жыл бұрын
STARTED LEARNING RUST :)
@NoBoilerplate
@NoBoilerplate 2 жыл бұрын
Fantastic! Come tell us about how you get on in #newbie-advice on my discord server, ask questions if you get stuck! HAVE FUN!
@humanperson8418
@humanperson8418 10 ай бұрын
Rules for living with Rusts compiler 1. The compiler hurts you because it loves you. 2. The more the compiler hurts you, the more it loves you. 3. Don't fight back, just let it happen. "Remember, the compiler loves you" - No Boilerplate.
@modolief
@modolief Жыл бұрын
No Boilerplate: Can you provide a link to Rustlings in the video description?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Good idea! Will do. It's here too github.com/rust-lang/rustlings I was teaching a class rustlings at work just yesterday and it's SO GREAT for sparking disussion - I learn much every time I take a class!
Rust on Rails
11:34
No Boilerplate
Рет қаралды 134 М.
Rust makes you feel like a GENIUS
10:48
No Boilerplate
Рет қаралды 410 М.
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 3,5 МЛН
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
Rust Data Modelling Without Classes
11:25
No Boilerplate
Рет қаралды 180 М.
The Unreasonable Effectiveness Of Plain Text
14:37
No Boilerplate
Рет қаралды 614 М.
Rust Is Boring
10:37
No Boilerplate
Рет қаралды 193 М.
why rust libraries may never exist.
7:26
Low Level
Рет қаралды 279 М.
Rust is easy... (we make it hard)
10:11
Let's Get Rusty
Рет қаралды 125 М.
Rust makes cents
13:24
No Boilerplate
Рет қаралды 116 М.
Hack Your Brain With Elaborate Coping Mechanisms
11:42
No Boilerplate
Рет қаралды 325 М.
Why You Shouldn’t Build Your Next App in Rust
9:18
warpdotdev
Рет қаралды 101 М.
How Rust rose to dominance (by accident)
11:01
Let's Get Rusty
Рет қаралды 39 М.
RUST Enums ARE Better
5:49
ThePrimeagen
Рет қаралды 145 М.