Rust for TypeScript Developers

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024
  • Let me know in the comments if you want more "rust beginner" videos!
    shaky.sh

ความคิดเห็น • 172

  • @mk72v2oq
    @mk72v2oq ปีที่แล้ว +182

    Good code. Maybe worth mentioning that expect/unwrap is viable only for fast prototyping, but in production you should avoid panic. Even if the error is not recoverable. This is important because beginners may think that this is like an exception, but it is not. Panic actually crashes your program right away, Rust has no exceptions.
    Also minor tip: you can use inbuilt lines() instead of split('
    '). As a bonus it also accounts different line endings (LF/CRLF).

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +23

      That’s great to know, thanks!

    • @hc1770
      @hc1770 ปีที่แล้ว +5

      Didn't knew about lines() thanks for sharing!

    • @verified_tinker1818
      @verified_tinker1818 ปีที่แล้ว +12

      `expect()` should be avoided by libraries and apps that should never crash, like web servers, but it's fine in other applications; for example, games.
      Let's say you have a function that applies a force to objects that go off-screen to bring them back on-screen. It requests the window resource, which holds the screen dimensions. Theoretically, there could be no window-an app can be run without it-so the request returns an option, but your game requires a window, so if it returns `None` at that point, something has gone _very_ wrong. So, it's fine to use `expect()` here.

    • @climatechangedoesntbargain9140
      @climatechangedoesntbargain9140 ปีที่แล้ว

      @@verified_tinker1818 how much wrong is necessary to use expect?

    • @caerphoto
      @caerphoto ปีที่แล้ว

      @@climatechangedoesntbargain9140 there's no single answer to that, it really depends on the application and how important it is for it to not crash.

  • @adicandra9940
    @adicandra9940 ปีที่แล้ว +13

    Please do more of this. Your explanation is very intuitive.
    This is exactly what I'm looking for. Rust for Typescript devs

  • @Matt23488
    @Matt23488 ปีที่แล้ว +12

    I'm also new to Rust and I'm absolutely loving the language. I made it about halfway in Advent of Code before I ran out of time (I got started late). But then I decided to jump into a rather large project with multiple interoperable components and I have learned an absolute ton. Futures with the Tokio runtime, procedural attribute macros, MPSC channels across thread boundaries... It's been a blast learning so much so fast. Rust is quickly becoming a contender for my favorite language.

  • @adamdrake39
    @adamdrake39 ปีที่แล้ว +10

    As a casual rust learner with a bit of knowledge, these videos are nice to see because I know enough to follow along without getting lost. Also good to see someone go through the same learning path. Good luck!

  • @shashydass4114
    @shashydass4114 ปีที่แล้ว +48

    Fantastic video - great idea to use AOC to show a small concrete example that you solve with a second part that the viewer can solve too. Using Typescript as a reference point of comparison to Rust works really well. Would definitely watch more videos like this.

    • @fallingseasy
      @fallingseasy ปีที่แล้ว

      Agreed!

    • @tmangner
      @tmangner ปีที่แล้ว

      Yes. I would love to see more of these!

    • @somerandomchannel382
      @somerandomchannel382 ปีที่แล้ว

      Is there any video wher you show how to setup rust and make it look that amazing like that?

  • @ViliamVadocz
    @ViliamVadocz ปีที่แล้ว +16

    I recommend configuring your language server (most likely rust-analyzer) to run cargo clippy instead of just cargo check. You'll get a ton of good hints regarding correctness, performance, and best-practices.

  • @sneakytowelsuit
    @sneakytowelsuit ปีที่แล้ว +6

    This is exactly what I've been waiting for, been trying to learn Rust and there are definitely some hurdles as a primarily TS and Java dev. Please keep these coming, I'll be watching for sure!

  • @MaybeBL1TZ
    @MaybeBL1TZ ปีที่แล้ว

    i was trying to learn Rust two months ago and i didn't find any single video that helped me more than this one
    thank you 🙌

  • @mluevanos
    @mluevanos ปีที่แล้ว

    As a TS developer, I like ths format, short and concise.

  • @TheEuphoricism
    @TheEuphoricism ปีที่แล้ว

    I am a typescript guy -- did quite enjoy this, great explanations. Not sure how its 'for typescript developers' -- but it did get you on my feed, and a +1 to the subscriber count!

  • @dimitrimitropoulos
    @dimitrimitropoulos ปีที่แล้ว +1

    ABSOLUTELY FANTASTIC of you to start doing this. keep it going!!

  • @viridianite
    @viridianite ปีที่แล้ว +8

    Keep these videos coming, Andrew! I haven't touched Rust before so it's interesting to look at someone solving problems in it.
    I'm still surprised you don't have more subscribers because your videos are top-notch: Straight to the point, packed with information, good explanations, code is the focal point, etc.

  • @webhedz
    @webhedz ปีที่แล้ว +1

    Great video, I'd love to see more of these types of videos. I'm also looking to learn Rust this year.

  • @otisrancko
    @otisrancko ปีที่แล้ว

    I liked the explanation of your Rust video. I wish I could get a full tutorial on how to get started with the language. Its a thumbs up!

  • @dvlden
    @dvlden ปีที่แล้ว

    Yes please. Keep it up. I like everything related to Rust and TypeScript, so feel free to record any videos on these topics. Good luck! ❤

  • @dandcodes
    @dandcodes ปีที่แล้ว

    You're an excellent teacher, I'd love to see more Rust content on your channel!

  • @cg219
    @cg219 ปีที่แล้ว +1

    Holy snap Andrew Burgess!! I didn't know you had a TH-cam channel. Blast from the past from the Envato days

  • @introvertsgo
    @introvertsgo ปีที่แล้ว

    Great video. I've been playing about with rust, but didn't grasp some of the concepts you've covered here until watching this. Very useful

  • @Nonsense116
    @Nonsense116 ปีที่แล้ว

    Great stuff! I spend my work day in typescript and I've been learning rust over the past month or so. I wish a video like this was out there when I started!

  • @g_dfe1
    @g_dfe1 ปีที่แล้ว +6

    PLEASE keep going with this series!!! x 10000000

  • @marcelarmada-castellon1863
    @marcelarmada-castellon1863 ปีที่แล้ว

    I study currently Rust and your video give a understandable lesson. Thanks man. I wait for more videos. ☺

  • @EldorJ10
    @EldorJ10 ปีที่แล้ว

    Great video for me as a Dev who uses Typescript and wants to learn Rust.

  • @DanelonNicolas
    @DanelonNicolas ปีที่แล้ว

    I love the video format. Also the way you explain things. Will subscribe hoping to see more like this one. Thanks!

  • @jgttech
    @jgttech ปีที่แล้ว

    I would love more things like this as I do not have a lot of time for Rust, at the moment and I feel like this is done in small enough bits and good enough expansions that I can absorb the information reasonably well.

  • @dubble_cuppachino
    @dubble_cuppachino ปีที่แล้ว

    This is exactly the title I’ve been searching for

  • @keent
    @keent ปีที่แล้ว +1

    offtopic but cheezus krist that vim setup is so neat.
    Been using vscode my whole life and never considered vim as a primary editor. i think i'll try one soon.

  • @hansschenker
    @hansschenker ปีที่แล้ว

    Very good presentation style! I like that you leave your personal camera on (buttom right round). As a watcher you have the feeling that you speak to me (while you just watch into your camera) and that is motivating.
    Rust is a functional language and strong typing. Syntax feels a bit "rusty"!

  • @irlshrek
    @irlshrek ปีที่แล้ว

    love that youre doing this series!! I definitely want more Rust!

  • @csells99
    @csells99 ปีที่แล้ว

    Great explanation. I’ve spent time on my own learning Rust and you filled in a bunch of details. Thanks!

  • @NoName-1337
    @NoName-1337 ปีที่แล้ว

    I like to see more of this kind of rust videos. It's very interesting.

  • @FauzulChowdhury
    @FauzulChowdhury ปีที่แล้ว

    A good start to the channel. I would say since you lured the TypeScript people here you could do a more comprehensive explanation on how typescript would have done it. You did say in few places but also missed one or two.
    I will be following, and cheering for you.
    Good Luck

  • @hello-AZIZUR
    @hello-AZIZUR ปีที่แล้ว +1

    It would be great to have a dedicated playlist of "Rust for TypeScript Developers"

  • @lucasa8710
    @lucasa8710 ปีที่แล้ว +1

    I loved it, very good content your ability to organize thoughts is amazing

  • @apidas
    @apidas ปีที่แล้ว

    I'm excited for your rust journey. you're really smart

  • @ryan_t_brown
    @ryan_t_brown ปีที่แล้ว

    This is so crazy I just typed in "Rust for Typescript developers" and Andrew has a video posted today.

  • @mumk
    @mumk ปีที่แล้ว

    enjoyed it and subbed. Definitely learned a thing or two from this short video, keem em coming! cheers

  • @chrisjames278
    @chrisjames278 ปีที่แล้ว

    Would be a cool series to explore rust. Something I would follow along with

  • @ynokenty
    @ynokenty ปีที่แล้ว

    Really great content here! Been eyeing Rust for a while, guess it's time to start learning it :)

  • @juanditoro8901
    @juanditoro8901 ปีที่แล้ว

    Really liked this video! Currently one day in learning rust, pretty excited for the next 😁

  • @returncode0000
    @returncode0000 6 หลายเดือนก่อน

    Could you please do more rust videos? Your rust videos are fantastic, especially the traits explanation 🔥

  • @wiseskeshom4673
    @wiseskeshom4673 ปีที่แล้ว

    Thanks for this great video, I'm learning TypeScript and also Rust is the next in my long list. Please do more video like this.

  • @SilvestreVivo
    @SilvestreVivo ปีที่แล้ว

    I loved the content. Please more Rust videos like this!

  • @pedro.balbino
    @pedro.balbino ปีที่แล้ว +1

    Great content! To help others following along, please include the keys currently being pressed while using Neovim.

    • @estranhokonsta
      @estranhokonsta ปีที่แล้ว

      That is specific to the editor (there are tons of them) and has little to do with the theme of the video. There are other videos about Neovim out there.

  • @josephizang6187
    @josephizang6187 ปีที่แล้ว

    If you will teach rust like this, I am subscribed already. Wonderful explanation man.

  • @loodinek
    @loodinek ปีที่แล้ว

    I enjoyed your video a lot. Looking forward to the next one.

  • @iSaac-kp5lk
    @iSaac-kp5lk 11 หลายเดือนก่อน

    I find that copilot really helps when learning a new language...
    Almost like training wheels...

  • @SuperQuwertz
    @SuperQuwertz ปีที่แล้ว

    Please do a series: Rust for Tyepscript devs, where you allow viewers to transfert or at least use as much as possible of their Typescript knowledge to Rust

  • @Muaahaa
    @Muaahaa ปีที่แล้ว +2

    For your `map` method that parses the str to usize you could use `filter_map` instead of unwrapping and have something like: `filter_map(|row| row.parse().ok())`

  • @mikeriv9229
    @mikeriv9229 ปีที่แล้ว

    usize as a type is more for things like array/vector indices rather than just as a regular numeric type. It's 32 or 64 bits based on the system because that's how long memory addresses would be so it's meant to line up with that.

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Ah, interesting! So what would you use as a numeric type?

    • @caerphoto
      @caerphoto ปีที่แล้ว

      @@andrew-burgess in this example usize fine, tbh. It's only when you need to think about performance, or are dealing with numbers bigger than 2 or 4 billion, or are developing for much more limited hardware (i.e. 16 or 8 bit) that you really need to think about it. And of course if you expect negative numbers, there's always isize.

    • @mikeriv9229
      @mikeriv9229 ปีที่แล้ว

      @@andrew-burgess u32 and i32 are the “default” int types, there's also 8, 16, and 64bit versions for when you need different sizes for optimization or whatever

  • @SuperQuwertz
    @SuperQuwertz ปีที่แล้ว

    This video was so good. Please do more!

  • @fardeenpanjwani-si7yv
    @fardeenpanjwani-si7yv ปีที่แล้ว

    Amazing video!! Love your neovim setup! Do you have a repo with your neovim/vim co fig?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      Thanks! It’s pretty close to stock lunarvim. More details at shaky.sh/tools/

  • @limitlesskode
    @limitlesskode ปีที่แล้ว

    You just intimidated me with your vim motions 😮

  • @ExpDev69
    @ExpDev69 ปีที่แล้ว

    Rust really is a beauty

  • @diogoanjos3160
    @diogoanjos3160 ปีที่แล้ว

    Really nice content, Andrew!
    Can you please also share your editor/IDE configs? I've found those quick suggestions/docs really helpful!

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      That’s part of the lunarvim configs! shaky.sh/tools/
      But it should be part of any rust plugin for your editor.

  • @AmitErandole
    @AmitErandole ปีที่แล้ว

    This is amazing. Please do a series

  • @MaxProgramming
    @MaxProgramming ปีที่แล้ว

    I had been waiting for this!

  • @joaquimley
    @joaquimley ปีที่แล้ว

    Thanks for the video.
    I really liked your pace and the way you explained.
    A Small piece of feedback thought, it seems like we can hear some noise whenever you type (beyond the key presses) maybe you have your mic sitting at the table? It is a bit more noticeable with headphones. I'm saying this because I had that issue with the Blue Yeti, moving it to an arm with a shock mount sovled the issue.

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Thanks for the feedback! I do have the yeti on an arm, but I should try adding the shock mount. Appreciate it!

  • @killymxi
    @killymxi ปีที่แล้ว

    One unexplained jump was how the `parse` function works. Does it infer the type to parse from context?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Great question! I’ve got a video all about this coming out in about an hour!

  • @LinuxForLife
    @LinuxForLife ปีที่แล้ว

    Very interesting. Go on like this! Your little mistakes will feed our knowledge ... 😉😉😉 So nothing is lost for everyone! 😁😁😁

  • @itznukeey
    @itznukeey ปีที่แล้ว

    Wow this language looks so good, I'll have to try this once after exams lol

  • @andrefilipefonsecaborba4989
    @andrefilipefonsecaborba4989 ปีที่แล้ว

    Where I click to set up one thousand of likes?! Amazing video!!!

  • @khairulhaaziq2332
    @khairulhaaziq2332 ปีที่แล้ว +1

    What editor are you using? Interested to know how you setup it

  • @LielAlmog
    @LielAlmog ปีที่แล้ว +1

    Hi guys,
    What is this IDE it looks awesome.
    Can you make a video about configuring it like this?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      It’s neovim with lunarvim configs! Check the description for a link to the setup!

  • @JavierHarford
    @JavierHarford ปีที่แล้ว

    Hello Mr.Burgess, can you share your awesome LSP setup? Wondering if your dotfiles are already out there. Everything looks so stable and my rust config feels a bit janky

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      Yeah, they’re all out there! See the link in the video description.

  • @Luxcium
    @Luxcium ปีที่แล้ว

    Some people are wizards… other are just superhero… and then we have people like Andrew Burgess who looks like they are working as a journalist for the Daily Planet.

    • @Luxcium
      @Luxcium ปีที่แล้ว

      I am not a TypeScript superhero, just someone who is also kind’a learning Rust!!!

  • @indylawi5021
    @indylawi5021 ปีที่แล้ว

    thx, great practical intro to Rust.

  • @ndanzzid566
    @ndanzzid566 ปีที่แล้ว

    Do I need to read the book first? I'm not comprehending well.

  • @anandmt7459
    @anandmt7459 ปีที่แล้ว

    Extremely helpful. Thank you.

  • @NoonKnite
    @NoonKnite ปีที่แล้ว

    thanks for your video. looking forward to more.

  • @orlandofury
    @orlandofury ปีที่แล้ว

    thanks for the video!!! the format is great

  • @muhrizqiardi
    @muhrizqiardi ปีที่แล้ว

    Please do more of this!

  • @officemax3977
    @officemax3977 ปีที่แล้ว

    good stuff, I'm definitely interested! keep going

  • @franklemanschik_de
    @franklemanschik_de ปีที่แล้ว

    Looks great as long as you do not fall into the lisp macro hell and avoid them total your good to go i would advice you to play around with deno and v8 so you can run your rust code in a more modular fashion

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      Wait, I’m not sure I follow. What’s the connection between deno/v8 and rust?

    • @franklemanschik_de
      @franklemanschik_de ปีที่แล้ว +1

      @@andrew-burgess deno is only a Rust Binding and Minimum runtime written in Rust for v8 so you can use IT Like lua to Connect your Rust modules to v8 and use Them with typescript

    • @diadetediotedio6918
      @diadetediotedio6918 ปีที่แล้ว

      There is no problem with macros in Rust at all, they can make the code writting easy and succint

  • @mayassalman
    @mayassalman ปีที่แล้ว

    Good work, please keep going 💯

  • @jeanchindeko5477
    @jeanchindeko5477 ปีที่แล้ว

    Great video to motivate looking at Rust. Thanks

  • @eyesight2073
    @eyesight2073 ปีที่แล้ว

    Which editor? Vim?emacs?
    Looks nice....

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      Neovim! Details here: shaky.sh/tools/

  •  ปีที่แล้ว +1

    Can you share your vim config, extensions, and terminal?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Check out my video from last week, and this: shaky.sh/tools/

  • @SeanLazer
    @SeanLazer ปีที่แล้ว

    This is great stuff, subbed

  • @matej2714
    @matej2714 ปีที่แล้ว

    great great great great great explanation!

  • @RyanWaite28
    @RyanWaite28 ปีที่แล้ว

    Hi. How was this video recorded? (camera, microphone, etc)

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      iPhone 14 and blue yeti, using QuickTime and OBS.

    • @RyanWaite28
      @RyanWaite28 ปีที่แล้ว

      @@andrew-burgess Thanks! and great video btw! This video quality with just an iPhone?

  • @Antilli
    @Antilli ปีที่แล้ว

    As someone that just started learning Python, with the goal of then trying to learn Rust, this is Chinese to me.

  • @dolevgo8535
    @dolevgo8535 ปีที่แล้ว

    this is great, please keep this up!

  • @forinda
    @forinda ปีที่แล้ว

    Which editor are you using

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Neovim. Link in the description for the details.

  • @gleweistam6663
    @gleweistam6663 ปีที่แล้ว

    Yes please keep them coming

  • @enkioki
    @enkioki ปีที่แล้ว

    What editor are you using?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Neovim! More details at the link in the description.

  • @antonpegov2745
    @antonpegov2745 ปีที่แล้ว

    I like it s lot! Super easy to fallow ❤

  • @nirajkhatiwada6696
    @nirajkhatiwada6696 ปีที่แล้ว

    Good insight. Thanks.

  • @shecodes94623
    @shecodes94623 ปีที่แล้ว

    Which code editor are you using?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว

      Neovim! More info at the link in the description.

  • @souravdhar47
    @souravdhar47 ปีที่แล้ว

    I absolutely love this type of content

  • @abishekkumar316
    @abishekkumar316 ปีที่แล้ว

    which extension are you using?

  • @idiakosesunday3806
    @idiakosesunday3806 ปีที่แล้ว

    Defo want more

  • @michah3956
    @michah3956 ปีที่แล้ว

    Rust is typescript killer.

  • @Phildiculous
    @Phildiculous ปีที่แล้ว

    good explanation!

  • @bryson2662
    @bryson2662 ปีที่แล้ว

    keep em coming.

  • @Metruzanca
    @Metruzanca ปีที่แล้ว

    How, the fuck is your (presumably living room) looking so cozy.

  • @jvcmarc
    @jvcmarc ปีที่แล้ว

    What editor is that? is that helix?

    • @andrew-burgess
      @andrew-burgess  ปีที่แล้ว +1

      Neovim with the lunarvim configs. See the link in the video description for more details.

    • @jvcmarc
      @jvcmarc ปีที่แล้ว

      @@andrew-burgess thanks!

  • @ivanhale8114
    @ivanhale8114 ปีที่แล้ว

    can you do this for C++

  • @munzamt
    @munzamt ปีที่แล้ว +1

    Or you can just do max call on iterator

  • @Anastasia-cv4ld
    @Anastasia-cv4ld ปีที่แล้ว

    What theme is this?

  • @thiagobitten
    @thiagobitten ปีที่แล้ว

    Nice content.