Rust Crash Course | Rustlang

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 1 тис.

  • @TraversyMedia
    @TraversyMedia  5 років тому +348

    This is an intro to the language. It is long but we go over a lot. Web Assembly with Rust is next. Also guys, check out Eduonix, they are giving my subscribers/viewers an awesome deal on courses.
    TIMESTAMPS:
    Intro - 1:05
    Install Rust - 4:45
    Creating a file - 6:26
    Cargo Init & Build - 7:50
    Print & Formatting - 10:42
    Variables - 19:35
    Data Types - 25:15
    Strings - 33:42
    Tuples - 44:34
    Arrays - 47:14
    Vectors - 55:00
    Conditionals - 1:16:00
    Loops - 1:07:03
    Functions - 1:13:53
    Pointers & Reference - 1:19:14
    Structs - 1:22:00
    Enums - 1:37:59
    Command Line Args - 1:42:00

    • @happyman_smiling
      @happyman_smiling 5 років тому +1

      Please make a video on scala its brilliant programming.

    • @sarangs8441
      @sarangs8441 5 років тому +6

      Looking forward for Web Assembly.

    • @AudioBassetHound
      @AudioBassetHound 5 років тому +2

      Brad continues to be a god among boys in the coding tutorial space.

    • @forex9527
      @forex9527 5 років тому

      VueCLi3+TypeScript for udemy, pls!

    • @marciomafideju1775
      @marciomafideju1775 5 років тому +1

      On your way to 1.000.000 subs. Unbelievable!!!!!! Keep up your pace !!!!

  • @iggy14750
    @iggy14750 5 років тому +1219

    Rust is NOT garbage collected! The assertion at 3:55 is false. Rust has completely deterministic memory management, enforced at COMPILE time. There is no freeing up after reaching a "threshold". This is like, one of the key things of Rust.

    • @jamesnewman9547
      @jamesnewman9547 5 років тому +42

      Yep this

    • @GRAYgauss
      @GRAYgauss 5 років тому +18

      Thanks for the clarification.

    • @FreeScience
      @FreeScience 5 років тому +145

      He said that one advantage of Rust is that it's is NOT garbage collected and then contrasts this to Javascript.

    • @ole4707
      @ole4707 5 років тому +150

      @@FreeScience But then he goes on to explain how Rust works. But what he explains is not reference counting and automatic memory management on the stack. Instead, what he explains sounds very similar to how GC works. He is basically contradicting himself, which is confusing.

    • @no-defun-allowed
      @no-defun-allowed 5 років тому +11

      Bollocks. Memory management is equivalent to the halting problem, and can't be determined before runtime.

  • @gosnooky
    @gosnooky 5 років тому +793

    Been using C++ for over 20 years... Rust is such a more coder-friendly language. Your videos are great, man.

    • @TraversyMedia
      @TraversyMedia  5 років тому +149

      C++ is so powerful but so much code to do the most simple things

    • @AdamsTaiwan
      @AdamsTaiwan 5 років тому +5

      @@TraversyMedia How about Julia Lang.? I heard it coming up on Rust.

    • @DarkLevis
      @DarkLevis 5 років тому +57

      The C++ of 20 years ago (C++98) is a different beast from C++17/20. They often look so different, that without knowing, they don't even seem to be the same language but rather like C and C++ when compared.

    • @shadowagent3
      @shadowagent3 5 років тому +19

      wow you can actually get a job with C++

    • @obinator9065
      @obinator9065 5 років тому +22

      @@shadowagent3
      Like the majority of things that need performance and are not kernels, is written in C++.

  • @0xsajjad
    @0xsajjad 2 роки тому +1

    Simple and straightforward, that's how teachers should have taught us.
    I think Rust is a replacement for C and not C++.

  • @xnoreq
    @xnoreq 5 років тому +78

    At 46:00 you say that i8 goes from 0 to 255 mixing it up with u8.

  • @dabunnisher29
    @dabunnisher29 5 років тому +43

    Brad, I seriously think this was one of the most useful instructional videos for Rust. I am definitely looking forward to your Web Assembly tut.

  • @charlesstepp129
    @charlesstepp129 4 роки тому +13

    Everybody take notice. THIS is what a practical video looks like. The plain stuff you will use all the time.

    • @brainplot
      @brainplot 4 роки тому

      Meh. Rust is not that kind of "pratical" language. You need to understand it well or you're going to get frustrated at the compiler errors because you won't be able to understand them.

    • @zeberast
      @zeberast 4 роки тому

      ​@@brainplot Still you need to have an entry point.
      I've been wanting to learn rust for a couple of years now, but all the lack of accessible resources has turned me away ever single type up to know.
      To learn means to take something you don't know, and try to make it known, and from that point on you can venture deeper.
      That's especially true for programming since an inside out approach isn't really viable with the sheer amount of complexity you'd first have to master.
      I agree that it is important to learn all of this, but it's easier to do it from a point of partial knowledge to be able to put into relation

    • @brainplot
      @brainplot 4 роки тому

      @@zeberast I learned Rust from the book. I was only watching this video because I'm interested in Rust and this ended up in my recommended videos. What's wrong with the book? It seemed pretty accessible to me.

    • @__________________________4597
      @__________________________4597 3 роки тому

      @@brainplot As someone with a severe case of ADHD books dont really do it for me.

  • @piyushupadhyay5652
    @piyushupadhyay5652 3 роки тому +211

    53:10
    "It's always good thing to get rid of STDs"
    😂😂

    • @joakker8820
      @joakker8820 3 роки тому +2

      I mean, that's just good life advice in general 😆

    • @cl3761
      @cl3761 3 роки тому +1

      Have been thinking of that since his first mention of STD and finally..

    • @mokafi7
      @mokafi7 3 роки тому

      yeah thats why lghdtv shouldn't exist

    • @dimitriousdrake
      @dimitriousdrake 3 роки тому

      @@mokafi7 What is that

    • @asprithe1607
      @asprithe1607 3 роки тому

      @@dimitriousdrake abone

  • @rock9203
    @rock9203 3 роки тому +16

    I'm at 1:34:21 and I just want to say that you're awesome. I've had a really hard time learning Rust because the way I learn best is to learn enough not to be overwhelmed, then throw myself in the deep end.
    Thank you so much.
    edit: Just finished. Thanks again!

  • @kamilziemian995
    @kamilziemian995 5 років тому +13

    There is a mistake in description of this video. Conditionals part starts around 1:00:16 not 1:16:00.

  • @codedamn
    @codedamn 5 років тому +251

    Rushing through rust docs these days to get hands on to this new language and saw your video. Good work Brad I'm going through it right now 😂💪 #devtubers

    • @basedfacistman
      @basedfacistman 4 роки тому +8

      stinky poo

    • @shambhav9534
      @shambhav9534 2 роки тому

      You missed such a pun. NoooooooOOoOoOOOOoOOOOoooOOOOOooOOOOo.

    • @i_dont_likevodka3062
      @i_dont_likevodka3062 2 роки тому

      the language is not new actually

    • @thehimalyanexplorer
      @thehimalyanexplorer 2 роки тому +3

      Wow @codedamn also watching Brad UA-cam videos, that's the beauty of internet.

    • @spaceghostmiid
      @spaceghostmiid 2 місяці тому

      @@i_dont_likevodka3062 it was pretty new 5 years ago

  • @hdonahue1934
    @hdonahue1934 3 роки тому +2

    Imagine my delight when I want to explore rust and find the guy that has continually put out fantastic content for years has a crash course on it

  • @Nightlurk
    @Nightlurk 5 років тому +3

    What I love about this channel is that here I can find the only tutorials which I can play at x1.75 just fine!

  • @thechannel2975
    @thechannel2975 3 роки тому +2

    FINALLY, someone who knows how to teach this dam language. Thank you for having a good and clear tutorial for RUST I wish more people explained codes this clearly.

  • @Madinko12
    @Madinko12 3 роки тому +115

    49:58 "it's zero indexed, like any other language" *cries in lua*

  • @conmcdon
    @conmcdon 3 роки тому +2

    Love Traversy's tutorials, been using them a lot lately and they're a great resource. I also love how Brad always sounds like he got into the office late and started recording it immediately.

  • @pkos91
    @pkos91 3 роки тому +8

    A really great intro!
    I will say the technical quality of this video is amazing. Great mic, video quality, readable font size. It sounds simple but I know it's hard to do well -- cheers!

  • @rebelmachine88
    @rebelmachine88 5 років тому +13

    This is a great intro, Brad! I've tried so many "intro to [language]" tutorials that are just so slow and boring, and I liked the pacing of this video. I'm excited to learn more about web assembly from you, as I'm learning what I can to be prepared for the future. It's definitely a different beast from just regular JS.

  • @developedbyed
    @developedbyed 5 років тому +13

    I am a bit rusty with this language, thanks Brad!

  • @realwizardry834
    @realwizardry834 5 років тому +18

    Of all the languages I'd expect to see on your channel, I wouldn't have expected Rust!

  • @ManThermos
    @ManThermos 5 років тому +81

    Thank you, there are barely any resources on rust, consider doing more!

    • @aquaductape
      @aquaductape 5 років тому +3

      checkout 'rustup docs' in your cli ;))

    • @hammerheadcorvette4
      @hammerheadcorvette4 5 років тому +4

      The Rust Programming Language by Steve Klabnik (Author), Carol Nichols (Author)

    • @martinlord5969
      @martinlord5969 3 роки тому

      The rust book is pretty good

  • @cyborg6294
    @cyborg6294 5 років тому +16

    Wow, i need that so much, finally someone makes a good intro to Rust. Thank you so much

  • @monawoka97
    @monawoka97 3 роки тому +3

    As someone who programs in C++ daily for my job this just seems like better C++. Really into it. Excited for the future of this language.

    • @juanbomfim22
      @juanbomfim22 3 роки тому

      Rust is better C++ and Kotlin is better Java

  • @thebiomicroguy
    @thebiomicroguy 2 роки тому +1

    This is Gold.
    This should be #1 to go for beginners.
    I started reading the Rust book, and you nailed it.
    Pure Rust demo.
    Thank you.

  • @thepedzed
    @thepedzed 4 роки тому +5

    You should change the description and replace the timestamps with this:
    0:00 - Advertisement
    1:05 - Intro
    4:45 - Install Rust
    6:26 - Creating a file
    7:50 - Cargo Init & Build
    10:42 - Print & Formatting
    19:35 - Variables
    25:15 - Data Types
    33:42 - Strings
    44:34 - Tuples
    47:14 - Arrays
    55:00 - Vectors
    1:00:16 - Conditionals
    1:07:03 - Loops
    1:13:53 - Functions
    1:19:14 - Pointers & Reference
    1:22:00 - Structs
    1:37:59 - Enums
    1:42:00 - Command Line Args
    Otherwise UA-cam won't divide your video into chapters: support.google.com/youtube/answer/9884579?hl=en

  • @nsd1169
    @nsd1169 5 років тому +16

    on tuples, just to be clear that max size 12 is not a limitation on tuple per-se but rather of println! macro number of arguments

    • @DantalionNl
      @DantalionNl 4 роки тому +1

      Doesn't Rust support variadic macros and if so than why isen't the println! macro using it. And if not why doesn't Rust support variadics as it seems quite essential.

    • @github1357
      @github1357 4 роки тому

      Nope. Tuples have a limit of 12. Atleast from my small reading of tuples docs

    • @github1357
      @github1357 4 роки тому

      Apparently I was wrong. Tuples only have less functionality with size above 12.

  • @revan1139
    @revan1139 5 років тому +35

    40:20 General Kenobi!

    • @OlavLadnav
      @OlavLadnav 5 років тому +8

      I see you're a man of culture, as well.

    • @bobboris9673
      @bobboris9673 4 роки тому

      I see him change it to hello there.. ctrl + f 'General' now i'm here, well done.

  • @alexcantemir3705
    @alexcantemir3705 5 років тому +1

    Brad , i'm in this industry for 12 years ... and i'm learning day by day ... i can't imagine how come do you know all this things lool .... you are like a machine bro :))

  • @jgttech
    @jgttech 5 років тому +4

    It is amazing how much traction Rust is getting. I am really looking forward to learning more about Rust.

  • @ManojSethi
    @ManojSethi 5 років тому +81

    Just a fan query?
    How many technologies do you know in total? You are crazy. Thanks for inspiring millions.

    • @TraversyMedia
      @TraversyMedia  5 років тому +92

      Thanks :) It depends on what you mean by "know". If we are talking fundamentals and enough to create a small project, maybe 12 languages. Enough to work as a professional dev with, I would say 4 or 5. This is just actual programming languages not frameworks, libraries, standards, etc..Once you learn a couple languages, it is easy to learn more, at least on a fundamental level.

    • @AryanGupta-tx6vt
      @AryanGupta-tx6vt 5 років тому +7

      dude i was to going to ask the exact question lol.. i always tell my friends " dude there is this youtuber "traversy media" he knows mostly every frk'n language

    • @Ash-em5pm
      @Ash-em5pm 5 років тому +1

      @Manoj Sethi EVERYTHING

    • @albertoplebani77
      @albertoplebani77 5 років тому +18

      @@TraversyMedia you are one of the most honest developers in the world :D Any senior software developer knows that knowing a language syntax doesn't mean being able to develop software professionally in that language. Mastering a language (which means beeing able to use it professionally) requires knowing and mastering the most important language's libraries and frameworks and the tooling. In my opinion this requires at least 1 year of full professional development in that language. So, you are really really honest.

    • @ZapOKill
      @ZapOKill 5 років тому +1

      ​@@albertoplebani77 true that! i learned over 20 languages, where i know syntax, keywords and so on without looking up... but there are only very few languages I really mastered...

  • @abhishekswain2502
    @abhishekswain2502 4 роки тому +13

    I want to give you a big thanks, Brad! This is what I needed. A very comprehensive crash course. Now I can fly through the rust docs 🤗😄

  • @brilliantphal6646
    @brilliantphal6646 5 років тому +4

    Thank you so much, Brad. Just learning from your tutorials, I become a web developer and Linux administrator. You empower me from code lover to coder.

  • @dabunnisher29
    @dabunnisher29 5 років тому +6

    As usual, amazing stuff Brad. You have me really thinking of whether to start with Rust or Golang. I wonder if anybody reading this would like to give their two cents on which one they like better.... Thank you Brad, and everyone, who comments.
    UPDATE: Screw Go!!! I'm really diggin Rust. I one of the 5 people, who enjoyed C++, and this is very comparable, but better. Thanks again Brad for opening my eyes.

  • @Dieterbe
    @Dieterbe 4 роки тому +3

    Hi Brad. I haven't seen any of your other videos. Stumbled upon this one, and it's awesome! Love how hands on it is, and how you share the code so i have plenty of snippets to refer back to and mess around with! Looking forward to similar videos covering more advanced stuff, cheers!

  • @stephenjames2951
    @stephenjames2951 5 років тому +7

    Maybe a short video covering ownership and pattern matching as these are significant features of rust

  • @richierob62
    @richierob62 3 роки тому

    I’ve said it before but I have to say it again: Your brilliance is in making complex concepts stupidly simple. Thanks again!!

  • @emikili
    @emikili 2 роки тому +5

    I appreciate this was already a lengthy video, though there were a few things I was confused about where a brief explanation of each (or why it's a longer conversation) would have been helpful:
    - The difference between const and an immutable let and why you would use one over the other
    - Why fn full_name has "&self" (referenced) as an argument but to_tuple has "self" (unreferenced) as an argument
    - What a macro is
    - Why you used .clone() in the final section
    Otherwise thank you for a very useful intro video that has spurred me to look into Rust more.

    • @Messmerd97
      @Messmerd97 2 роки тому

      Just putting a comment here because I am also interested in the answer to this question

    • @kacperfilipek8461
      @kacperfilipek8461 2 роки тому +1

      const can only be used for constant expressions, that can be evaluated at compile time, so you can't assign a value from a function call to const variable

  • @teachingtechnologyy
    @teachingtechnologyy 3 роки тому +1

    To be honest, you are one of the best UA-cam instructors in the game. Your Haskell video was superb and this is right up there, best in the backend UA-cam game by far!

  • @ScruffR70
    @ScruffR70 5 років тому +3

    54:40 it would have been good to address the "oddity" that a slice [0..2] or [1..3] only returns two items (0 & 1 or 1 & 2 respectively)
    When reading it as _"element zero _*_to_*_ two"_ then the statement is wrong. It's rather a right-open interval [ 0 ; 2 [ (indexes zero to - but not including - two).
    1:12:15 the same goes for the range in a for loop - the upper bound is exclusive, hence the two examples (while vs for) are *not* doing the same thing. The former goes from 0 to 100 (including) and the latter _only_ to 99 - something also worth mentioning.

    • @GlobusTheGreat
      @GlobusTheGreat 2 роки тому

      Eh that's how python does it, therefore not odd :P

  • @AaronccGuo
    @AaronccGuo 4 роки тому +1

    I'm doing a research on different languages, this is a nice intro on Rust, saved me a lot of time, thx

  • @UstadJi
    @UstadJi 5 років тому +62

    Internet Without Brad Traversy Is Dead.

    • @TraversyMedia
      @TraversyMedia  5 років тому +18

      Haha, thanks but I think we could get by without me...I do :)

  • @shinchikichin
    @shinchikichin 5 років тому +2

    Thank you very much for this. Did the whole course and now I have enough meat on my bones to tackle something with rust.
    Keep up the great work.

  • @mburkhart41
    @mburkhart41 5 років тому +8

    You're the best! Been waiting on Traversy treatment of Rust.

  • @elderofzion
    @elderofzion 5 років тому

    brad is going to set the record as a man that coded in every programming language and framework ever invented

  • @jajaperson
    @jajaperson 3 роки тому +4

    My mind was blown at 19:23. Amazing, Rust is truly the future!

    • @kacperfilipek8461
      @kacperfilipek8461 2 роки тому

      Are you convinced Rust is the future because of the default print formatting?

    • @jajaperson
      @jajaperson 2 роки тому

      @@kacperfilipek8461 it was a joke, rust is nice tho

  • @VitosGramp
    @VitosGramp 4 роки тому +1

    This video is precisely what I needed. Although long, it is direct and explains the basic concepts in a logical manner. Thank you very much for your effort. This old C++,C,Python, Perl, java, assembly language old dog has learned a few new tricks.

  • @ytusr37837
    @ytusr37837 5 років тому +58

    Your explanation of rust memory management is...........questionable

    • @newborn7348
      @newborn7348 3 роки тому

      Your grammar is even more........questionable

  • @flatbedder
    @flatbedder 5 років тому

    You remind me of myself in a way. I struggle with a lot of the things you talk about in your other videos and feel I'm at the point you were at when you started all this. You definitely inspire me, keep up the videos, love it. I listen on my 1hr commute every day.

  • @coorbin
    @coorbin 5 років тому +3

    This is excellent content, easy to follow and exactly what I was looking for as a Java/C#/JS developer looking to get started in Rust. I really need your Rust + WebAssembly course so I'm subscribing so I see it when it lands!

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis 5 років тому

    Not particularly interested in Rust but I have watched it anyways, I have also worked on several of your courses and man do you deliver. Compared to other courses paid or otherwise out there, the difference is light and day. You present the material in a thoughtful and precise manner, no pauses or uhms or whatnot, you know what you want to demonstrate and proceed to do it in a calm and controlled manner. Please do a complete 70-483 course, I would gladly pay for it!

  • @SiliconLight
    @SiliconLight 4 роки тому +63

    The assertions about memory management in C/C++ AND Rust that are made in the first 4 minutes or so of the video are not correct.

    • @Mossmyr
      @Mossmyr 4 роки тому

      What is incorrect?

    • @SiliconLight
      @SiliconLight 4 роки тому +9

      @@Mossmyr C/C++ and Rust share the same memory behavior. Both offer the same ability to use memory in unsafe ways, and both discourage that behavior. Rust's toolchain discourages unsafe behavior more actively whereas C/C++'s toolchains may only provide short warnings about the behavior. It's worth noting that C and C-style C++ will naturally lead to more more opportunities for errors; but it's worth remembering, it's not the language's fault when theres an error, it's the programmer's. Rust is great because it helps the programmers make fewer mistakes by default. To get the same level of support with C++, you often need additional static analyzer and warning level configuration for your compiler.

    • @thepedzed
      @thepedzed 4 роки тому +3

      He might have confused it with the Go lang.

    • @HermanWillems
      @HermanWillems 4 роки тому +7

      @@SiliconLight With C++, you also have the problem that the "best way" to program in C++ can look like alot of things are "bolted" onto the language due to legacy. This is not the fault of C++, but to wanting to stay back compatible + new insights people get. And Rust takes the fruits of those insights. C++ is hard, because you not only need to know the "good way" to program things, but also the bad ways to fully understand everything and to avoid pitfalls which the compiler doesn't complain about. Rust is just lessons learned from the past 40 years + guard rails and the way you program that is the most easy is mostly the best way to do stuff. With C++ the easiest way can be the wrong way. Also move semantics in C++.... i think those things are easier in Rust to deal with memory issues. C++ will stay here, but it has battle scars and warts that you can't remove without making people mad about not being back compatible anymore. And tell me the truth... with soon 64 and 128 cores to be normal. You want to write multi-core programs in C++ or Rust for so many cores? Rust is the only Systems language that makes you feel confident of your multi-core application.

  • @MeerMusik
    @MeerMusik 3 роки тому

    As a Rust Noobie I have a learned a lot. A lot of things are very similar to C++ but a lot of other things are also very different. Thank you very much from 2021 :)

  • @Gabouchet
    @Gabouchet 4 роки тому +5

    Wuaah that language are impressive, I've done many c++ before, and some functional languages. And I.m very familiar with syntax and logic of this paradigm. This is my next 5 year of my future 😂

  • @JuanGarbanzoBean
    @JuanGarbanzoBean 3 роки тому +1

    I followed along with the whole thing over two evenings and it was really instructive. Thanks for sharing!

  • @craigjohnson8279
    @craigjohnson8279 5 років тому +3

    I've only heard great things about Rust: gaming, mobile, web assembly, etc. Thanks Brad for creating this crash course, I'm excited to code along.

  • @enricotrudu6760
    @enricotrudu6760 4 роки тому

    Conditionals starts at 1:00:16. Thanks for this tutorial!!!

  • @drewbradford7608
    @drewbradford7608 5 років тому +3

    YES and WOW! Thank you, very excited to see your Web Assembly video. Be well

  • @remy2295
    @remy2295 3 роки тому

    FYI, If you flip around the timestamps in the description, they'll show up as chapters! (also the first timestamp _must_ be 0:00)
    e.g.
    0:00 - Intro

  • @michelle778
    @michelle778 5 років тому +5

    YES, YES, YEEEEES!!! Thank you for doing this!

  • @6Uriann9
    @6Uriann9 3 роки тому

    The STD pun was the cherry of the cake. Great tutorial.

  • @distrologic2925
    @distrologic2925 5 років тому +5

    4:12 Noone allocates memory manually in C++(using malloc or something), only in very rare special cases! C++ has classes in the stdlib which abstract all of that away. That is the greatest myth about C++, its simply not true.

  • @owendavidmalicsi5900
    @owendavidmalicsi5900 3 роки тому +1

    Played it at 2x and still learned a lot. Thanks man

  • @pomaeb5958
    @pomaeb5958 5 років тому +11

    Thanks Brad, any idea if you could make a video about Rocket (web framework for Rust)?

    • @INT_MAX
      @INT_MAX 5 років тому +1

      This please. If your goal is to make a Rocket API for GETing and POSTing text, it's a breeze to use. For anything more advanced, the documentation is severely lacking. I've even reached out to Sergio Benitez himself, who was not interested in clarifying anything.

  • @myhobbyt6102
    @myhobbyt6102 2 роки тому

    Nice, informative to-the-point Rust tutorial.
    53:11 --> "Always good to get rid of the STD's" --> Enjoyed between-the-lines humor

    • @richardrombouts1883
      @richardrombouts1883 Місяць тому

      If this is about namespaces, it is questionable advice. If about sexual transferable diseases, it is better to prevent them than to get rid of them.

  • @FritzKissa
    @FritzKissa 5 років тому +11

    Still waiting for that WebAssembly video!

  • @abcdabcdabcd317
    @abcdabcdabcd317 2 роки тому

    was able to go through the complete video , along with the programs , . It was a great video. No time wasted at all. Extremely helpful . A definite subscribe and like

  • @avi12
    @avi12 5 років тому +12

    I'd say that the best-known application developed by Rust is Mozilla Firefox Quantum

    • @draakisback
      @draakisback 5 років тому +7

      Quantum only has pieces that are built in rust, mainly the css engine. The browser built completely in rust is called servo. The plan is to eventually replace all of the c and c++ but it's not there yet.

    • @gosnooky
      @gosnooky 5 років тому +2

      And what a great endorsement of Rust. FFQ is so much faster and better than Chrome.

    • @draakisback
      @draakisback 5 років тому

      @@gosnooky that is part of the reason, though both browsers are getting better as far as performance is concerned.

  • @kennystrawnmusic
    @kennystrawnmusic 4 роки тому

    By far the best thing about Rust is “cargo bootimage” - very easy to use Rust to develop OS kernels, although this requires the nightly instead of the stable channel and also requires the core library instead of the standard library.
    Also, one needs to set up the automatic memory management in order to use it in this case - thankfully that’s rather easy thanks to Cargo and the “alloc” crate.
    The os.phil-opp.com tutorial is a fantastic springboard for those who want to get to a level that low after watching this - although I haven’t seen any video equivalents to that tutorial (yet).

  • @konstantinrebrov675
    @konstantinrebrov675 5 років тому +3

    Although this is a relatively good tutorial, it covers the surface level only. There is mostly summarized information about the syntax of the programming language here. This lecture goes little into how or why the language works the way it does, which I think is one of the key things to learning Rust.

  • @EclipseCircle
    @EclipseCircle 5 років тому +2

    I would legit pay for a C++ Crash Course from you.

  • @qadirmasti1
    @qadirmasti1 5 років тому +7

    Hello Brad please do a video for rocket framework for rust

  • @eliastouil7686
    @eliastouil7686 5 років тому +1

    Every time I want to learn something you posted about it the week before, it's amazing, keep em coming :)

  • @nrnoble
    @nrnoble 2 роки тому +4

    Fantastic video. Thanks! ....Being new to Rust, but not new programming languages, what I currently don't understand why "mut" is not inferred. A vast majority of the time the intent of declaring a variable is so it can be modified, otherwise use a constant. The concept of "variable" implies that it's content will vary. My intent is not to be argumentative about the finer details, I am simply trying to understand the design choice behind making variables immutable by default.

    • @RoastLambShanks
      @RoastLambShanks Рік тому +1

      Watch some No Boilerplate's videos. ;-) - basically it makes you write safer code. And the concept. of a "variable" actually comes from maths, in maths x doesn't change, does it. A function doesn't execute steps to get to a result, ie "imperative". A function implies x. f(x), mean this implies that. I'm probably not articulating this very well.

  • @Ghasakable
    @Ghasakable 3 роки тому

    I think you are among the greatest teachers in my list, not for programming language only, the logic the pace the delivery of your contents all 10/10. For Rust, so easy explanation with a nice content to start with. I am so motivated now to learn this language. I wish you can do other languages (e.g., Golang, Julia, C++ ), one think until today scares me is the Cmake and installing third-party libraries in C++.
    As for Rust language, again, thank you very much for your great video very much appreciated.

  • @lordswaggity1213
    @lordswaggity1213 5 років тому +4

    Brad, in which situations would it make sense to use rust over something else?

    • @TraversyMedia
      @TraversyMedia  5 років тому +3

      To me the biggest reason to learn Rust is Web Assembly. It is something that I see being huge in the future. However, it is also great for building systems level projects as it is not as hard as C/C++ but still very powerful.

  • @claytorresgaming7212
    @claytorresgaming7212 3 роки тому

    Probably the best Rust crash course video out there! More RustLang vids please. Awesome and more power to the channel!

  • @baiqing
    @baiqing 5 років тому +7

    I can appreciate some more subtle jokes like the ones at 53:11 haha

  • @bringerod5141
    @bringerod5141 5 років тому

    Sat through this just to get a hunch of how to even work with rust. My first day of compiler class and they do advanced things to make a parser and test functions for it when I've never written a single line of rust. Hope this will give me an edge.

    • @kiraPh1234k
      @kiraPh1234k 5 років тому

      Ooooh, compiler class :)
      Good luck!

    • @bringerod5141
      @bringerod5141 5 років тому +1

      ​@@kiraPh1234k Thanks! After yesterdays class I can say that I really need it. :)
      For those who want to get into parsers, check out nom for rust.

  • @letoan285
    @letoan285 5 років тому +3

    Hi Brad, Could you please make a course of Web API with RUST and MYSQL? i will appreciate it.

  • @streetwear37
    @streetwear37 4 роки тому

    I like that those who construct languages finally understand that assuming a value are immutable are a good thing and we need to declare it specifically if not. Most values in well written code are meant to be immutable, but as for nearly all humans programmers are lazy at will not use 'cosnt' because it is not strictly neasecary to make the code run.
    This leads to code that are hard to fully optimize because the compiler need to use graph theory to solve dependencies of variables since we can't assume anything. On the other hand if we have that most values are immutable by default we can find which values that are not immutable and which functions has side effect by counting. Since it is harder to make a value mutable it will not happen unless we want it to, not the other way around like in js and such. Hence if the compiler can copy paste alot of function bodies instead of system calls, it can optimize much more.
    Mut is even good for readability and self documenting code. Since we kan deduce which values that can be changed by looking at the declaration, not try to trace usage like in js. It also makes a statement from the developer that states just touch this value, but not though. Which give you as a maintainer a easier time alter or update the code base.

  • @SoundAssault
    @SoundAssault 5 років тому +182

    Hahaha... getting rid of STD's... 😂

    • @TraversyMedia
      @TraversyMedia  5 років тому +45

      I had to say it lol

    • @1_nS1d3
      @1_nS1d3 5 років тому +4

      Using std::whatuwant;

    • @skimtiazahmed7415
      @skimtiazahmed7415 5 років тому

      everytime

    • @elicoptericus
      @elicoptericus 4 роки тому +3

      C++ developers all over the world right now don't know if they should be angry or laugh

    • @DantalionNl
      @DantalionNl 4 роки тому +1

      @@elicoptericus Both I guess, some parts of STD are horrendous and hard to work with while others are amazing and make life much easier. Knowing which parts to use and how and which to avoid is 90% of what c++ programming is about.

  • @ramakrishnansubramanian6597
    @ramakrishnansubramanian6597 2 роки тому +1

    Thanks Brad !! The tutorial was very helpful to jump start into rust . One suggestion at ~55:00 mins when explaining array slicing. It looks like the slice ending index is not included in the returned slice. Scratched my head a bit when I was trying it out and went to rust docs to confirm that's indeed the case. I come from C and the end index not being included wasn't very obvious to me. Might be helpful to point that out.

    • @dyslexicsteak897
      @dyslexicsteak897 2 роки тому +1

      tthe start index can also not be present and itll assume 0

  • @SudiptoGhosh
    @SudiptoGhosh 5 років тому +50

    Brad Traversy > IBM Watson

  • @laplace2921
    @laplace2921 2 роки тому

    I believe this 2 hrs worth several rusty courses out there, hence I could not see traits included, looking forward to a 3 hrs intermediate Rust Crash from you, thank you..

  • @adamkarafyllidis9264
    @adamkarafyllidis9264 5 років тому +4

    Full course on Udemy? 😁

  • @Felipekimst
    @Felipekimst Рік тому +1

    awesome video! loved the pacing, the explanations, everything!

  • @X3n0n36
    @X3n0n36 4 роки тому +4

    Brad: Lets do push_str(" world")
    Me: push_str("😩✋💯")

  • @ikromnurrohim
    @ikromnurrohim Рік тому

    uploaded 4 years ago but I just seeing this know, because I want to learn new language😁 Thanks Brad

  • @parasharkchari
    @parasharkchari 5 років тому +25

    This is a poorly named video. The whole point of Rust is to have sufficient memory safety that your code _doesn't_ crash. It doesn't make any sense to have a "Crash" Course when there is no crashing.

  • @PatrickLemiuex
    @PatrickLemiuex 2 роки тому

    This is a great place to start. Well spoken, easy to follow and your Bostonion? accent makes it more interesting.. thanks

  • @nxxxxzn
    @nxxxxzn 5 років тому +3

    Traits..?

  • @kzakaria91
    @kzakaria91 5 років тому +1

    dude you're insane, is it too much to ask for modern c++ crash course? haha thanks for the content brad!

  • @Mempler
    @Mempler 5 років тому +4

    Rust is such a weird language.
    I hate the syntax.
    I hate the way how it handles stuff.
    I hate the packaging system.
    But that's why i want to learn it.

  • @dkarbaev
    @dkarbaev 5 років тому +1

    Left uncovered (yes, I know this is a crash course, it’s just a hint what to learn next):
    1) how to read from stdin
    2) generics
    3) panic, recovering from errors
    4) concurrency
    Now, my questions are:
    1) why do we use pointer (&self) in one case and simple `self` in another when adding impl functions
    2) does capturing variables in closures lead to memory leaks? Do we have to somehow annotate the capture as a weak reference?

    • @Kajenko
      @Kajenko 5 років тому

      I'm not sure about 2, but about 1 - "self" consumes the struct by effectively having the method own itself. &self only uses a reference to it, so the struct can still be used
      so if I call the method A(self) on B, then I can't use B anymore since it's now owned by A
      but if I call X(&self) on B, then I can continue using it.
      if I call Y(&mut self) on B, then Y can modify B since it has a mutable reference to it

    • @dkarbaev
      @dkarbaev 5 років тому

      @@Kajenko but why not use `&self` in `to_tuple` method then? Is it because it returns `first_name` and `last_name` strings so that the struct will not own them anymore and there's no reason to keep the struct?

  • @AdeelImranr
    @AdeelImranr 4 роки тому

    In the description conditionals are Conditionals - 1:16:00 when it needs to be Conditionals - 1:00:00

  • @hgopalkrishnan
    @hgopalkrishnan 3 роки тому

    Thanks Brad. Fantastic video.
    I am just getting started with Rust and looked at couple of videos for a quickstart.
    Yours is the best !!
    Looking forward to future videos.

  • @Noodle999
    @Noodle999 3 роки тому

    Great video, thanks 👍🏻
    29:55 when you got the warning about y and suggestion to call it _y it was actually because you set it and never used it, rather than set it twice. It was suggesting you use the underscore to let the compiler know it was deliberate and thus eliminate the warning.

  • @sdstorm
    @sdstorm 4 роки тому

    It's a nice, easy to follow introduction to the syntax of Rust, however it doesn't help explain why anyone would want to bother with Rust, as opposed to, say, JS. If I was, for example, coming from JS or Python, without knowing C or something like that, I would probably get the impression that Rust brings nothing to the table, yet it has some weird quirks like: what's up with some functions ending with '!', or why does the string type have the '&' sign and i32 doesn't, etc. The answers to these questions are really the difference Rust makes compared to other, higher level languages. Basically, the pointer/reference section (and memory management in general) is the key to Rust.
    Now, I understand this is an intro, and going through the basic syntax is a good starting point, but it is important to note that it's just a start. If you've seen this video and you want to learn more, you should really look at the memory model of Rust. I would recommend the free book they have, and in particular this part: doc.rust-lang.org/stable/book/ch04-00-understanding-ownership.html

  • @duke605
    @duke605 5 років тому +1

    Man... having a background with Golang, Ruby, Python, and C#/Java, this language is all of them combined

    • @AdamsTaiwan
      @AdamsTaiwan 5 років тому

      That's what they say about Julia Lang.

    • @duke605
      @duke605 5 років тому

      AdamsTaiwan never even heard of it

    • @AdamsTaiwan
      @AdamsTaiwan 5 років тому

      @@duke605 Like Python but with the speed of C. Here's what they say, "MIT Julia is designed to combine the speed of C with the usability of Python, the dynamism of Ruby, the mathematical prowess of MatLab, and the statistical chops of R" Check it out: julialang.org

  • @shawnmurdock8059
    @shawnmurdock8059 2 роки тому

    Thanks for this. Having just discovered Rust, and being an older IT Engineer looking to break out into programming, this 'crash course' was great. If you happen to read this comment, could you, or anyone, recommend other courses for Rust.