Rust makes cents

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

КОМЕНТАРІ • 500

  • @NoBoilerplate
    @NoBoilerplate  2 роки тому +297

    ERRATA
    Tauri hasn't yet release mobile app bundling, though its in their roadmap. Desktop only for now!
    2:31 Though the "80%" header is right, the table below is only for 128MB lambdas
    4:53 The heading reads "Hander" instead of "Handler"

    • @redcrafterlppa303
      @redcrafterlppa303 2 роки тому +11

      Then for now we will just write it in wasm and use a webapp infrastructure. Rust has always a way ; )

    • @FinaISpartan
      @FinaISpartan 2 роки тому +20

      We do have Rust in our kernels now too.

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

      Can't wait. Really wanted to check out Rust's mobile feasibility, but couldn't find anything particularly easy to get the feet wet.

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

      Plus we can write Python dynamic libraries in Rust using PyO3

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

      yeah, I'm really waiting for it because it will cover all my project needs with it (windows, android, linux, ios, macintosh, oculus quest (I hope)).

  • @DoomKaiserGliders
    @DoomKaiserGliders 2 роки тому +89

    "oxidizing your entire stack" what a great line, cheers

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +32

      Here's another, if you've not heard of it: Rust is named so because it's close to the metal!

  • @EdissonReinozo
    @EdissonReinozo 2 роки тому +334

    This is becoming a must watch channel. I don't even read the title anymore. I know it is my reliable rust content.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +28

      Thank you! Keep checking the ERRATA comment to make sure it's actually accurate!

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

      Completely agree. Started watching just a couple of weeks ago and now I click as fast as I can when I see a new video

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

      Same, this channel is always amazing

    • @BikramKumar-uy8nl
      @BikramKumar-uy8nl 2 роки тому +5

      @@NoBoilerplate The fact that you mention this also makes you worth the praise. Thank you for the content.

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

      oui

  • @foobar3770
    @foobar3770 2 роки тому +95

    These videos convinced me to write my latest project in rust. At first I thought the project was too big, too many states to model and too many breaking changes. But having written something once, it never broke. Whenever I added a new thing, I first extended the valid states by changing the type of a variable from String to a parsed struct - and the compiler told me where I had to fix stuff. When there were no more compiler errors, I was done. It's fun to write code like this.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +43

      "When there were no more compiler errors, I was done." this is my experience every time I write Rust too! Isn't it relaxing!

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

      Can you please explain what do you mean by “added a new thing”. It’s so hard to understand what you are working on.

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

      Oh! The same for me!
      I rewrote an old project that never leaves my mind, and now it works at a decent speed and memory usage, while doing what I want it to do.
      It was strange at first, seeing errors and warns I didn't even know the meaning, but with time (just 2 days), once there were no more errors, it was beautiful (actually, as it's image processing, and I have a bad taste, it was ugly, but conceptually working)!

  • @tuskiomisham
    @tuskiomisham 2 роки тому +60

    I read that energy efficiency paper. The reason Java is so high up is because they used Java to execute the power analysis function, and instead of launching the program externally like they did for literally every other language, they just ran the Java program inside the same VM, cutting corners significantly.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +36

      Rude!

    • @tuskiomisham
      @tuskiomisham 2 роки тому +11

      @@NoBoilerplate indeed, but so is academically misleading many people

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +45

      @@tuskiomisham oh I'm so sorry, I meant that them misleading people is rude, not you!

    • @pixelsam123
      @pixelsam123 2 роки тому +16

      Public static void main string args amirite

    • @natew4724
      @natew4724 Рік тому +4

      @@pixelsam123 say it again, public static void main string args
      also you forgot the class

  • @enque01
    @enque01 2 роки тому +193

    The production quality of this is so high. The message is a complex thing made simple, using rudimentary graphics done well, overlaid with a voice that is so pleasant this guy should voice audiobooks. Very much appreciate the level of quality in this!

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +11

      You're too kind! I honed my production skills on a hopepunk, scifi podcast, and I'd love to know what you think! ua-cam.com/video/p3bDE9kszMc/v-deo.html

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

      i mean, he does a fiction podcast, so audiobooks kinda. it's also really good

    • @raymanovich3254
      @raymanovich3254 2 роки тому +2

      @@NoBoilerplate I always wondered why you opted for calling it a podcast.

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

      @@raymanovich3254 what, Lost Terminal? Isn't it a podcast?

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

      @@NoBoilerplate It is - but the meaning of _podcast_ has been lost over time - I certainly found it surprising that a podcast meant _any_ digitally distributed programme, and did not specifically refer to the format of several hosts having a recorded conversation...
      P.s. Lost Terminal is amazing! It's the first podcast I've listened to in a long time (read: ever) and I love it.

  • @jameslugenga9454
    @jameslugenga9454 2 роки тому +318

    will he ever make a video that isn’t amazing probably not

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +27

      You're too kind! I'm always improving.

    • @nicolashumbert8344
      @nicolashumbert8344 2 роки тому +8

      @@NoBoilerplate This one is right. You seem to just not be able to not be amazing.
      Your videos are a real source of inspiration for a lot of us.

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

      @@nicolashumbert8344 Thank you so much, I'm so grateful!

    • @znefas
      @znefas Рік тому +3

      @@NoBoilerplate As others have said, the quality of your videos is high, and I feel like that's also part of why you love Rust so much, because you too care about correctness. And with such, you keep your videos correct, which in the context of YT vids would be considered videos that achieve their goals well and nothing else, and since you're teaching us about Rust, you're fast, concise, and to the point with no meaningless detours.
      This video quality is amazing, and I'm very thankful to have stumbled onto this channel. Thanks for your amazing work!

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

      @@znefas That's so kind of you to say, thank you 🙂

  • @piguyalamode164
    @piguyalamode164 Рік тому +6

    Another thing about rust that makes it very good for writing code: I often find that if I understand what a struct is, I can very often tell what a method does just by its name and type signature. I can also very often find the method I want quickly by looking through the autogenerated documentation

    • @NoBoilerplate
      @NoBoilerplate  Рік тому +2

      This is something you find in Haskell too, rich types are amazing!

  • @LukaSauperl
    @LukaSauperl 2 роки тому +50

    That feeling when he says "Hi friends" and for a moment you feel like you actually have a friend ... and then the video ends.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +15

      Plenty of friends on the noboilerplate.org discord :-)

    • @The88shrimp
      @The88shrimp 2 роки тому +6

      Just program a friend in Rust.

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

      Rust is my best friend

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

      @@somedooby honestly it feels like that when working with the compiler - amazing!

  • @the_kovic
    @the_kovic Рік тому +41

    You've mentioned execution time and memory usage but there is an area you didn't mention: disk usage.
    Rust's compiler is a powerful tool that does a lot of checking for you. This takes a lot of time. The first build in Rust takes a long time, easily in the order of minutes. The authors knew this and so, just like C's object files, the compiler produces a lot of artifacts to remember its progress. And this is where the cost of Rust manifests because nothing in the world is ever completely free. Rust consumes a lot of persistent memory on the developer side to power its magic. Even a simple hello world project will take a couple hundred megabytes, real projects easily number in gigabytes of compile-time artifact data.
    There is a argument to be made that persistent memory is pretty cheap today and that this single-time, developer-side cost of space is a small price to pay for all the good stuff - and I would agree with that. But I felt it necessary to mention it for the sake of completeness.

    • @NoBoilerplate
      @NoBoilerplate  Рік тому +20

      Very good take, it's certainly an are that could be optimised more isn't it? Running a Rust CI pipeline is very different to other languages for this particular reason!

    • @pexoto5093
      @pexoto5093 Рік тому +2

      wait kovic? the_kovic, the one that made the doom eternal ost remaster? You a rustacean too? life is crazy! cheers m8

  • @shreyasjejurkar1233
    @shreyasjejurkar1233 2 роки тому +19

    As Mark (CTO of Azure) correctly tweeted, C/C++ should be declared as retired languages and instead use Rust.
    Am pretty sure, going forward most of the cloud services and data centre infrastructure code will be written in Rust. Fast, energy efficient and of course cheap!

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

      All that is required is for people to understand the power that we have today with rust. I'm making progress on that goal 😊

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

      Rust is very new to me, and I wonder: Do you use unwrap()s if you are certein that a variable is Some or Ok?

  • @angeldude101
    @angeldude101 Рік тому +16

    In exchange for making code fast, you generally have to sacrifice some space to hold the compiled binary. While your code may not get to the size of a shell-script one-liner, Rust has plenty of tools available that let you get down to an absurdly small binary, even forgoing the entire C runtime, while still being confident that things won't break.

    • @NoBoilerplate
      @NoBoilerplate  Рік тому +4

      17k on windows, is the record I've seen!

    • @Heater-v1.0.0
      @Heater-v1.0.0 7 місяців тому

      I'm not sure what you mean by "In exchange for making code fast, you generally have to sacrifice some space to hold the compiled binary." Whilst it is true that sometimes one can optimise a compilation for speed and get a bigger binary as a result or vice-versa, I would say that in general the differences are not very big. More common is things like Java, Javascript, Python where one gets extra memory usage, thanks to the way they maintain variables and use garbage collection and at the same time slow performance, for much the same reasons. That's before we have added on the memory consumed by their run-rime systems/interpreters. Anyway, yes, Rust can produce binaries that are as small and performant as C or C++ can, there are many embedded projects running on micro-controllers to test to that. By the way, what do yo mean "forgoing the entire C runtime, "? C pretty much does not have a run time beyond what is needed to initialise the stack and such before jumping to main(), but even that is not running once your program is started.

    • @angeldude101
      @angeldude101 7 місяців тому

      @@Heater-v1.0.0 That comment was largely in reference to replacing a shell invocation that took a few dozen bytes with a 2kiB binary (which was optimized for size). And yes, C _does_ have a runtime and Rust by default links to it, and the dynamic linking alone actually increased the size of the binary more than reimplementing the necessary parts myself.

    • @Heater-v1.0.0
      @Heater-v1.0.0 7 місяців тому

      @@angeldude101 Well certainly it nice to be able to write one line of shell to get some quite complex task done. The comparison with a 2K compiled binary is of little relevance usually. I mean, that line of shell script can be dependent on millions of lines of code, in the shell interpreter, in the commands it is invoking, in the libraries they depend on, in the operating system the whole thing runs on. Perhaps if you wanted to do that same task on a memory constrained system, like a micro-controller, the 2K compiled binary would be the way to go.
      No, C does not have a run-time. Sure your C code may depend on library functions defined in the standard library. Or it may depend on other libraries. Or it mat depend on syscalls to the operating system. It mat even achieve all that via dynamic linked libraries. Non of that is a language run-time. That is just library dependencies. After all consider the kernel of your operating system, often written in C, there is no language run-time underneath that, it is running on the bare metal. In fact that kernel provides run time facilities that all your applications need. Yeah, I know there is often something called "crt" something or other, as in "C run time" that is typically very small and only initialises the stack, processor registers, static variable, etc before jumping to your main(). It can be as small as a handful of instructions. It's also not running when your C code is.
      Whilst it is true that Rust links to the standard functions provided by lib C on Linux, Windows, Mac etc, that is not actually necessary to run Rust programs. Many people are using Rust on bare metal systems that have none of that.

  • @dixaba
    @dixaba 2 роки тому +17

    When I first tried Rust in 2016, I was repelled by its weird syntax and borrow checker - C++ seemed much more familiar. Later (in 2019) I decided to try it once more, maybe write something small and simple. And it clicked. Since then I'm using Rust for all my personal projects. I don't remember last time when my program crashed NOT on my own unwrap(), which is just quick dirty hack to make program compile. But unlike said C++, I know that I can just grep for unwrap()s and replace them with proper error handling, not re-reading whole code 50 times.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +12

      THIS IS EXACTLY IT
      Rust can panic like other languages, but you can SEE when it's going to. Fantastic!

  • @cylian8422
    @cylian8422 2 роки тому +81

    Can we get a complete Rust tutorial for begginers?
    You have an amazing writing style and your voice is very pleasant to listen. I'd love to see a good Rust tutorial series

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +42

      Thank you! I did that once, have you seen this ua-cam.com/video/br3GIIQeefY/v-deo.html
      My focus for the moment is shining a light on all the incredible features of Rust. Once you're excited, The Book is all you need to learn, it's written brilliantly!
      doc.rust-lang.org/stable/book/

    • @zakstephens9297
      @zakstephens9297 2 роки тому +15

      @@NoBoilerplate This is low value and high effort, but the Rust Book with your radio voice would probably come out like a fun bedtime story.

    • @RMy4v5aPte
      @RMy4v5aPte 2 роки тому +2

      @@zakstephens9297 It's ridiculous to call the rust lang book "low value", meanwhile learning any language is going to be high effort if you want to be fluent in it. The rust lang book is probably the single highest quality resource I've come across learning ANY language, with an imbedded compiler and multiple examples and explanations for every single rust concept.

    • @zakstephens9297
      @zakstephens9297 2 роки тому +16

      @@RMy4v5aPte Nah, I mean getting old mate to read it out is low value. The Rust Book is fantastic, I have a copy on my desk right now.

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

      @@NoBoilerplate The Book is my bible for the past month.. What an amazing doc is that!

  • @SimGunther
    @SimGunther 2 роки тому +8

    Jean Young's talk on Strange Loop was amazing for bringing attention to system rationality and not just saying "your local program is the only system you ought to be concerned about" knowing there's plenty of tooling for proving local state to not only be correct, but for invalid state to not be representable. Proving that our code can be glued together to talk to other systems correctly would be a huge win in my book for engineers everywhere! :)

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

      Nice! I'll watch, thank you

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

      Some projects use pact for this when the language is JavaScript. It is used to shard type definition, test cases and mock code between systems. Ones systems mock code are the expected values for the test cases of the other system. This shows that a rich type system together with sharing the type definition goes a long way to securing compatibility. Perhaps there's something like pact for rust, which would also share the tests.

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

      You can see the full talk here: "Building Observability for 99% Developers" by Jean Yang (Strange Loop 2022)
      ua-cam.com/video/UJA4PGKny2k/v-deo.html

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

      @@LowestofheDead Nice, thanks for the link!

  • @defnlife1683
    @defnlife1683 Рік тому +5

    “5x faster… If you single thread them.”
    Vito Corleone “ Look at what they did to my boy.”

  • @user-qw9yf6zs9t
    @user-qw9yf6zs9t Рік тому +4

    the rust compiler is a real friend, instead of hiding things from you, it shows your mistakes in a comprehensible way.

  • @yey0072
    @yey0072 2 роки тому +12

    You can definitely see the improvements in information quality by the number of items in ERRATA decreasing each video. Keep it up!

  • @SochetraNOV
    @SochetraNOV 2 роки тому +7

    The voices, the script is so fascinating to watch & listen. 😊😊 you are the one who inspire me to try rust.

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

      Thank you so much! If you want something relaxing to listen to in my voice, I recently started season 10 of my hopepunk scifi podcast, Lost Terminal ua-cam.com/video/p3bDE9kszMc/v-deo.html

  • @leegeorg08
    @leegeorg08 2 роки тому +11

    I'd love to see how one might take formal specification (such as TLA+/PlusCal) and bring it over to the invariants and typing of Rust

  • @penguindrummaster
    @penguindrummaster 2 роки тому +11

    Everytime I see your videos, it inspires me to push forward with Rust. It beats me up everytime I try to journey forth, but I'm sure it'll all click eventually.
    Some of the development experience with Rust isn't perfect. An example is the examples.provided with Yew, where I spent 2-3 hours debugging a framework I had never used before to just get their example (written for an older version) working with the latest.
    Ultimately, I'm hopeful for the future of Rust, but I'm also held back by my colleagues that are scared away by the unfamiliar nature of Rust. I'm hoping I can forge a new chapter in my company's history, and move to a bright future in which much of our infrastructure is written in Rust.

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

      Sound like Stockholm syndrome to me. Getting beat up and coming back for more.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +7

      You and me both my friend!
      Yeah, I hit that problem with Yew too, their documentation could be better :-( But once I got it working, I LOVED hot-reloading in-browser. That was an unexpected treat!

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

      I too had this experience, with all the tutorials being so simple it gives you the idea that all will be simple from now on. But then when you try making your own thing that is not a tutorial, the compiler beats you up! It is frustrating - "I just wanna use the thing I just created! Why can't I even REFER to it, you silly compiler?!"
      But I find, now after a while, that stops happening. I kind-of just started placing things in memory more consciously, more deliberately, and when I mutate things i tend to do it in a more structured way than before. And slowly the compiler stopped being an annoying brat. Now I even prefer doing "quick and small" tools in Rust, over Python.

  • @youpie
    @youpie 10 місяців тому +1

    no boilerplate is the not just bikes of the programming world

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

    Another great video! I love that "oxidization of the stack" is a term. Very clever :D

  • @miguelguthridge
    @miguelguthridge 2 роки тому +16

    I've been learning Rust for a few weeks now and one of the things I've spotted is how well the type checker helps you prevent errors you didn't even realise were possible.
    For example, I recently got a compiler error because converting a character to uppercase returns an integrator of characters rather than a single character - it turns out that in some languages, converting some letters to uppercase gives two letters as a result.
    Without Rust's type checker and its spectacular support for Unicode I never would have considered that edge case, which for some kinds of code is going to lead to massive bugs - you've probably heard of all the crashes on iOS and Android due to text rendering issues (if not, Tom Scott has great videos on it). I wonder how many crashes would have been prevented if the text-rendering engines for our operating systems were written in a safe language like Rust.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      Right! The whole community cares about correctness, this is SUCH a huge force!

  • @sadikkadom9566
    @sadikkadom9566 2 роки тому +9

    Currently in the process of learning speed (coming from a Javascript background). I do find it quite challenging, but I hope it'll all pay off in the end. When I do get something write, I feel like I just wrote a magic spell.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      It's a tough start, you're doing well so far! I recommend:
      - fasterthanli.me/articles/a-half-hour-to-learn-rust
      - My rust series (10 other videos)
      - The Book doc.rust-lang.org/stable/book/
      Good luck! Ask for help on my discord if you need it, loads of nice people there! links on noboilerplate.org!

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

      @@NoBoilerplate Thank you very much for the recommendations. I'll stick with it. I know I'll be turning to nice people like you when in need of help!!

  • @xXJM01Xx
    @xXJM01Xx 2 роки тому +2

    "Oxidizing your entire stack" I like that! :) Great channel, just found this today. I have been looking to see if any languages out there have been picking up traction in the coding space and Rust keeps popping up for me. I will definitely be learning Rust as soon as I can.

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

      Fantastic! Do check out my other videos for incredible features to get excited about. You'll need that to get over the initial learning curve! 😁

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

    Roc language is probably going to be in 3-4 years my main "productive language" while still being "safe enough".
    Every time Feldman makes a new video about it's progress I am quite amazed. He takes ELM unrivaled developer experience and "faster than GO" as his main objectives for his pure functional language. My hope is that he can go in terms of speed more to rivaling C# and Java. Then it's truly going to be an incredible language.
    His full type inference approach is very interesting.
    - Richard Feldman, Pushing Boundaries with Roc - latest talk is the reason I'm so excited about it.
    Most of the comparisons in his video are with Rust and Typescript.

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

      Very impressive! But, so is Haskell, and as you say, Elm.
      I'm excited by Haskell not just because of it's technical qualities, but because it's *popular* and I can hire a team and get working with it TODAY.
      When Roc passes Common Lisp (dead center) I will start to pay attention. redmonk.com/sogrady/2022/03/28/language-rankings-1-22/

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

    Just to clarify, it is very possible to write logic errors in rust that will compile. Just because the types match in a statement doesn't mean that it is logically sound. You can for example accidentally write "or" instead of "and", the compiler wouldn't be able to see that that one is incorrect just from the types, it would have to know the programmers intention, which it do not.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      Very true, of course. It's much easier to find these errors, when you don't have to wade through the marsh of uncertainty that other languages have, however!

  • @BsktImp
    @BsktImp 2 роки тому +2

    This man's delivery could convince you night is day.

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      I promise to only use my powers for awesome

  • @Dominik-K
    @Dominik-K 2 роки тому +2

    Very interesting and actually the main reason I'm learning Rust currently. If I need a highly efficient language, especially as cloud providers will charge you for all inefficiencies too, for critical code it's imperative to be efficient. Otherwise the whole system can become unnecessarily slow or Ressource hungry

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

      That's it! And, unlike C++, we get this with a pleasant to use high-level language too!

  • @PaleyBlog
    @PaleyBlog 2 роки тому +6

    Thank you for the video. The style of your videos feel like a breath of fresh air. Interesting topics presented in a simple to understand and short enough format. No boilerplate indeed.
    I wish other content creators would learn from you

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

      You're very kind! I try to make it as good as I can.

  • @IronCandyNotes
    @IronCandyNotes 2 роки тому +16

    "The human cost of writing Rust" 😆

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

    Short precise and to the point - hard to be anything than Impressed.

  • @doktoracula7017
    @doktoracula7017 2 роки тому +2

    5:42 This makes me wonder, how many things we could automate and improve to make dev lives better, but we never thought about doing it? Automated upgrade of code to new library versions? Maybe graph based documentation that is compile time checked, so it's never out of date? Maybe automated scaling where code works without changes no matter if it runs on one cpu, multiple cpus, multiple local network machines or cloud?
    There are many ideas coming to mind, though most are taken from "Features of a dream programming language 2nd draft"

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

      If you made just one of these, I'd buy it :-D

  • @eboubaker3722
    @eboubaker3722 2 роки тому +29

    It's a good day whenever he uploads 😀

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

      Yep, always feels such a long wait for the next one..

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

      I feel the same! So nice to chat to everyone :-)

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

      Currently it's fortnightly, but if the Patreon takes off...!

  • @OoXNikoXoO
    @OoXNikoXoO 2 роки тому +8

    Can you talk about the implications of adding Rust to the Linux Kernel and how it affects code safety e.g. when a kernel panic occurs from whatever cause
    could Rust handle that better than existing C implementations?

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      I too am looking forward to the discussion on this topic. I'm not a kernel developer, so I'm not the right person to talk about it I'm afraid!

    • @lucky-segfault
      @lucky-segfault 2 роки тому +5

      rust doesn't inherently handle panics better, but it does require programmers to clearly mark everywhere where a panic can occur using the `panic!()` macro, the `.unwrap()` method, or something similar.
      In theory, if a programmer can replace all `panic!()`s and such with code that compensates for the issue, you code can become panic-proof. You can even use a macro called `no-panic` to make sure a method is incapable of panicking or it will fail to compile.
      In practice, I suspect panics will still happen sometimes, but they may be so rare as to only effect driver developers with non-rust languages and the like.

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

      @@lucky-segfault Indeed, I did a video on this very topic! ua-cam.com/video/sbVxq7nNtgo/v-deo.html

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

      I haven't looked at the latest iteration in detail, but as far as I'm aware the kernel doesn't panic. That's not a thing it wants to ever do. In light of this one of the things that were required to put rust into the kernel was to provide better support for non-panicking data structures/functions. For example Box::try_new tries to allocate a new Box, but if it runs out of memory and the allocator can't do that, then it gives an Err instead. So Rust's normal enum and rich type system actually makes the same patterns even better. In C you would perform the allocation and simply receive a null pointer in the cases where it runs out of memory, and it's up to the developer to check each pointer returned by malloc.
      In Rust that's as easy as ?

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

      In fact Asahi Lina (whose live streams are on youtube) has just written a GPU driver for the M1 mac in Rust, which is where I saw these patterns

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

    Great and exciting vid! Really like the channel format!

  • @TheEvertw
    @TheEvertw 11 місяців тому +1

    While Rust forces you to prevent errors, the compiler usually tells you exactly how to fix the problem, and gives pointers explaining the problem very clearly.
    The problem with learning Rust is on the level one up from getting the syntax right. It is getting rid of unsafe constructs that other languages advocate. Like callbacks or back-pointers etc. But it are exactly those structures that make our software so brittle.

    • @NoBoilerplate
      @NoBoilerplate  11 місяців тому +1

      Agreed, and rust's unsafe system makes this process as easy as it can be!

  • @sputnick1
    @sputnick1 2 роки тому +6

    Can we get a video describing your workflow when creating a video like this if you have time? what software do you use. Why and how do you do things?

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      Have a look at the middle of my 'lightsaber' video - I use obsidian.md!

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

      @@NoBoilerplate Rust and obsidian! Tis a beautiful way to live

  • @wChris_
    @wChris_ 2 роки тому +2

    Rust in the kernel is really exciting, to finally see another language in the kernel that is memory safe! But there are still a lot of problems, mainly the use of unstable features in kernel rust. That is to say that rust is not yet mature enough to be stable for kernel needs. But what is most exciting is the comparison of the NVME driver which is just as fast the C implementation, thwarting any concerns about speed!

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      "mainly the use of unstable features in kernel rust."
      I'm not sure that's quite right there.
      Unsafe isn't any worse than C, it just means you can defeference a raw pointer, plus 4 other pointer-related superpowers. (see the book for them).
      ...C can do all these unsafe operations with no oversight already, and we already write the linux kernel in that XD

    • @wChris_
      @wChris_ 2 роки тому +2

      @@NoBoilerplate Im not talking about unsafe, i mean feature like 'global_asm' or 'allocator_api' which are currently unstable that means the build could break in any verison which is a huge nogo. There are talks of having a dedicated kernel rust version, but that would lead to stagnation, like with C, where they had C89 for the longest time as the kernel C version, they only updated it because of a speculation bug, which couldnt be fixed in the version they had, so they went straight to C11 Wich is also a decade old but its atleast more modern than what they had.

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

      @@wChris_ oh! sorry I read 'unstable' as 'unsafe'. My bad!
      Unstable features get stabilised pretty quickly, even in the short time I've been following things. The Editions system perhaps could help here?

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

    Your Videos always make me want to try Rust out even more! I started a lot of smaller tests with rust here and there, but I still need to work myself up to work through the Rust Book to get fully started with the language.
    What is your stance on "the right tool for the job" with Rust? Would there still be Projects you wouldn't recommend Rust for?

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      I think the biggest category where Rust wouldn't be the right choice is applications where having a big runtime is an asset, not a feature.
      The one that comes to mind first is Data Science. Playing around with datasets in a repl is a huge part of doing data science, and it's not the types that matter but the values, so a rich compiler won't be as much help as building a larger app.
      Julia is a language i'm excited about for this sort of work!

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

      @@NoBoilerplate Oh absolutely, especially doing Uni work, it’s nice to just script things and play around with data. I’m using Python for that :) But Julia or R are also present in some fields. There’s really a lot of languages to choose from haha

  • @porky1118
    @porky1118 2 роки тому +2

    8:45 "Look how simple a hello world" is in Rust. At least compared to more popular languages like Java/C#.
    No need to use classes, static methods, string arrays, return types.
    In the beginning you wouldn't need to know static, arrays, string types, and any class specific stuff. You only want to know functions, maybe.
    And that's basically what a "hello world" in Rust looks like. Just a function, and a macro. No types at all.
    I still think, a simple hello world has some value.

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

      Now compare that with Python...

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

      @@CristiNeagu Same for scopes. Probably shorter. It's just this line:
      print "Hello World"

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

    Ok damn that answers my question about aws. Thanks for linking this in your comment!

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

    "You can trust compilers" Meh, debatable, I've read a very interesting paper that was saying that compilers could inject malware or bad code into your code, take care of what compilers you download. But I get the point! great vid as usual

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

      Oh sure, everything is possible, but I'll take my chances with an extremely well-reviewed piece of open source software ;-)

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

    Hey, awesome content as always. Was just wondering: I have a hard time differentiating your videos from afar when I see them appear in my recommended, mainly because they're so similar visually (thumbnail). I'm sure you're aware, so have you thought about how you could have more diversity in your thumbnails apart from keeping the same icon and changing the text? I mean, your thumbnails *are* recognizable, I immediately know it's your video, so I guess that's good, and given they're not really about any visual topic, I also struggle to come up with a good alternate design without making them annoyingly clickbaity or cluttered. I don't know! What are your thoughts?

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      My rust series won't go on forever. I will eventually run out of features to hype up! :-) And then, I might try a different colour logo.
      It's entirely possible I'll need to figure out the art of a YT thumbnail later on, and you might find big changes!
      I'd welcome any and all suggestions.

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

    hi friends. my name is tris and this is no boilerplate, focusing on fast, technical videos.

  • @picklypt
    @picklypt 2 роки тому +7

    You got me into rust and now I'm building two project with it. Thank you so much!

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

      I'm so pleased! This is why I started this series!

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

    Listening while at Costco this is fun. I love these videos.

  • @ericng8807
    @ericng8807 2 роки тому +2

    Was that blue line at the bottom always there? I can't unsee it anymore

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

      It's a progress bar for people who watch in full screen.
      Reveal.js has it as a feature, and I quite like it!

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

    11:08 Flesh is unpredictable, silicon is certain.

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

      You've been listening to Lost Terminal haven't you XD
      ua-cam.com/video/p3bDE9kszMc/v-deo.html

  • @rajm.5819
    @rajm.5819 Рік тому +1

    The best Rust videos live here. Great accented voice over. ❤

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

    Another great video - one of my favorites yet! I mainly write of Typescript for work, but have to admit that you got me to read up on Rust and I love it. Starting Rust for Rustaceans now. Just wish GCP had integrations with rust (apart from running containerized in Cloud Run or GKE).

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

      Google back Go, of course, and have made a carbon copy of Rust, called Carbon. I'm deeply suspicious of their motives there! -.-

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

      ​@@NoBoilerplate 😆😆

  • @hc1770
    @hc1770 2 роки тому +6

    After using Rust for a project and spending the time to understand new concepts like borrowing, lifetimes, I started to enjoy coding in Rust.
    The start was frustrating as the compiler just doesn't compile! It was very different with how development was with NodeJS. Which even if the code or syntax was wrong, NodeJS compiles and only when you execute that function it fails. I can totally relate with the narrative in the video whereby in Rust, if the compiler compiles, it just works.
    Unfortunately I'm working on a NodeJS project (not typescript) and always thinking about the type system, enums and lifetime.
    Writing in Rust really changed the way I handle my codes now.

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

      Rest is good for our mental health isn't it!

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

    I urge the Rustaceans to give Lost Terminal a try - it's gonna be up the alley of most of you!

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

      You're too kind! I also think so!

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

      The podcast? Not sure if I am looking at the right thing

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

      @@serioustr This is Lost Terminal, written by a geek for geeks 🙂
      ua-cam.com/video/p3bDE9kszMc/v-deo.html

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

    Alright you got me. I'm learning Rust today

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

      Fantastic! Do watch my other videos on Rust, there's astonishingly good features there that you'll NEED to know about!
      Start here fasterthanli.me/articles/a-half-hour-to-learn-rust
      Then hit The Rust Book, and Rustlings. Good luck!

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

    What are your thoughts of Clojure, a dynamically typed functional programming language that runs on JVM. Rich Hickey, the creator of Clojure, have very strong opinions about why to not use static typed language. I am curious. What are your thoughts?

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

      Love it. Before I discovered Rust, I was a professional clojure developer for 2 years, I even made a video about it! ua-cam.com/video/k_4rLyqQeAA/v-deo.html
      Rust has taken so many of the features i love from Clojure:
      - Expression-based language
      - Real lisp macros
      - fluent interfaces everywhere
      - Instant feedback (albeit from the compiler instead of repl)
      I searched for years for a way to make typing work with clojure. Typed clojure just never clicked for me, it was so much overhead, no-one really uses it, and it wasn't very powerful, clearly an after-thought.
      Finding Rust (which is Lisp in C's clothing with Haskell's type system) has been revolutionary!

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

    Your channel is just a giant Rust advertising. And it's working freaking well!

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

      This is intentional.
      I've noticed a lack of clear, well-explained introductory videos to Rust topics. There's loads of people making really great technical tutorials, but not stuff to get EXCITED about.
      I crashed out of writing Rust TWICE in 2020, and I only came back because I had a mentor to help me. Most people don't have this luxury.
      Rust has a BRUTAL learning curve, compared to other popular languages (though not as bad as Haskell et al), and so you need to know ALL of the great features that you simply can't get elsewhere, in order to push yourself through the initial learning period.
      Have you tried Rust? Thanks for your comment!

    • @SeresHotes25
      @SeresHotes25 2 роки тому +2

      @@NoBoilerplate I actually started learning because of you. Moreover, I watch your videos sometimes when I lose my motivation. It really helps! :3

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

      @@SeresHotes25 I'm so pleased, thank you 🙂

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

      ​@@SeresHotes25 And imma start because of this guy

  • @ameypendokhare3832
    @ameypendokhare3832 2 роки тому +2

    Hello Mr.Tris , here's a thing for you : when Joe Armstrong said Erlang is 'write once, run forever' and as Erlang's main strength is support for concurrency
    (also its functional ❤️) .
    And as far the journey had we knew Rust⚙️ is known for the FEARLESS CONCURRENCY ⚡.
    Could you please make a next video on concurrency and the parallel stuffs ... taking Rust and other buddies in comparison.

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

      Love it, good comparison topic erlang-rust. Thank you!

  • @StefanH
    @StefanH 4 місяці тому

    "You can always trust the compiler" he says totally not paid by big compiler. Remember to live in fear everybody!!

    • @NoBoilerplate
      @NoBoilerplate  3 місяці тому

      I *wish* I was getting that big compiler money (mozilla call me! 🤙)

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

    How does rust targeting arm on lambda compare to rust targeting wasm-wasi. I think I remember a blog post saying wasm was way faster

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

      I don't understand your question, this sounds like Apples and oranges. Do explain more?

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

    When you said there is nothing to stop you oxidizing your entire stack I realized why its called Rust; It's inevitable...

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

      Oooh! that's a good one.
      I heard recently that 'rust is close to the metal'

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

    The downside I can see with the "correct now" principle is that it can harm velocity when prototyping and iterating. You often don't know what product you need to build, so it's important to get some kind of prototype in the hands of a user as quick as possible, so you don't waste time building a product that no-one needs. In those cases it usually doesn't matter if there are bugs in edge cases, since you just want to know if the entire idea is crap or not.
    There are of course still shortcuts you can use in Rust like using unwrap and clone liberally and there's also the risk of prototypes ending up in production, but I still think this is a real downside to using languages like Rust and Haskell, which forces your programs to be correct from the start.

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

      I don't think your concerns actually manifest in practice. Once you know Ruby on Rails, you can rapidly prototype, once you know React you can rapidly prototype, and once you know Rust, you can rapidly prototype.
      A newbie in any of these would be slower at first.
      And even on top of that: Compiler-driven development has the potential to be FASTER than iterating in traditional tools because so much more is checked for you by the compiler. I've got a draft video on this topic coming soon!

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

    I'm currently learning Go as I think it has more appeal on the market right now, but I can't wait to start writing some Rust, your amazing videos really convinced me to buy the Rust book. I will ASAP

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

      Go's a great language too, you'll have a good time! Absolutely no harm in learning both, as developers, that's what we do!
      The book (also in epub) is free, don't forget doc.rust-lang.org/stable/book/
      (dead tree formats don't have working links ;-) )

    • @fabiobregasi5290
      @fabiobregasi5290 Рік тому +2

      @@NoBoilerplate I agree 100% :) thanks for the link!

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

      @@fabiobregasi5290 HAVING SAID THAT here's two features that you can't get in Go ;-) ua-cam.com/video/PuMXWc0xrK0/v-deo.html

  • @adamd0ggg2
    @adamd0ggg2 2 роки тому +2

    Was able to write a rust rocket app today. It was 100% a challenge but I learned a lot. What advice do you have for writing good idiomatic rust? I find myself cloning strings and objects often to get it to compile. It works, but it feels like I'm taking the easy way our or not thinking rusty enough.

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

      Adam, you're doing it right, cloning strings and objects is absolutely fine when you are getting started. Rust is 80x faster than Python, you'll get fine performance XD
      Come ask questions on the noboilerplate.org discord - there's a channel #newbie-advice just for this!

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

      "most apps should be written in a higher level language until you can no longer do so" Telling a newbie this is very mean and closed-minded. Please learn more.

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

      ​@Christopher Grant Chris, look at the context of your statements:
      You're commenting in a thread where a newbie is excited about Rust and has written a simple web app and is starting to ask intermediate questions about cloneing.
      You're too late with all this advice! Adam is excited about Rust and has already breezed past the problems that that paper's authors seem to think are too difficult. They're not, ownership is easy.
      Python's a fine langauge to learn to code in, so is javascript or ruby.
      For me, Python was my boat. It's got me to the other side of the river, but I'm not taking it with me as I climb the mountain.

  • @frazuppi4897
    @frazuppi4897 2 роки тому +2

    I just want to say, I love your content man. Cheers from Switzerland

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

    Didn't realise "oxidising" would be a valid word for "rewrite it in Rust".

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

      I've also heard "Carcinisation" DX

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

      @@NoBoilerplate Yep, always go for the fancier one. My choice: Ferrous oxide proliferation.

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

    Building a large project with any Rust framework is extremely energy intensive though.
    Just the initial Yew/Rocket/what have you build downloads ~400-500 dependencies, spinning all cores at 100% for 5-15 minutes depending on how new your computer is. That number shoots insanely high once you get everything else you need (db drivers, auth, caching etc).
    I would use Rust a lot more if it wasn't for tiny one off projects taking ~6 gigabytes of storage after draining my battery by 20% before I even get to open my editor.

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

      Compile times are a huge focus for the core team. And maybe you're a little out of date? I remember such compile times when I first started using Rust in 2020, but every version they get faster and faster!
      I just tried the Rocket hello world demo, and it uses ~100 crates. On an M1 mac this takes 10s to compile cold, and 0.1s to recompile.
      Do try the same and let me know how you get on!

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

      ​@@NoBoilerplate
      I don't know about Rocket now, I used it around the same year you mentioned.
      Yew however comes at this size, presumably for all the wasm deps.
      Following the Yew tutorial, it took me ~30 minutes before I could open my editor, downloading and install trunk, wasm, bindgen, yew and what not.
      Those 30 minutes were 80-100% CPU usage on all cores, and drained a fifth of my battery. This has been my experience with all Rust frameworks 2019-2021 (ish).
      But happy to hear! I know there's been some fuzz around linkers and debug builds coming down. That is awesome news.

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

      @@Honken Yeah, do try out Rocket again, you'll be pleasantly surprised!
      Yew did take a lot to set up didn't it? Trunk was especially weird too when I set it up, downloading some binary blobs that I wasn't keen on . HOWEVER I don't actually mind those setup costs - they're one-time. They should be faster, you're right, and they're getting better, but at least they're one time.
      Once I got yew installed for the last video, and started playing around with it, the experience was SO FAST, even hot-loading code into the browser when sourcecode changed and compiled. WOW!
      Please don't let the long compile times put you off, and if they still do, just try again in 2 months, they're getting better every release 🙂

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

      @@NoBoilerplate Thank you for always being so positive and encouraging in your comments. I'll take you up on that, and subscribe :)

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

      @@Honken My pleasure! I'm trying to help people out with the videos, it'd be weird if I didn't also do that in the comments 🙂
      There's 10 other videos in the series right now, have you seen them? Here's the playlist ua-cam.com/video/Q3AhzHq8ogs/v-deo.html

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

    This channel is the reason I finally decided to learn Rust. Since then, every new project I have language choice over has been in Rust and I could not be happier!
    Coming from primarily Python, I tend to echo your statement that the language's simplicity causes more problems than solutions at scale

    • @NoBoilerplate
      @NoBoilerplate  2 роки тому +2

      And the less we talk about the GIL the better!

  • @magfal
    @magfal 2 роки тому +2

    How does rust and native compiled dart code compare on arm for performance?
    My company's Flutter app is already fast enough to not appear on our heavy users' battery monitors.

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

      Most languages are fast enough. Even Python's 80x slower than C doesn't hold it back from being the #2 language in the world!
      I don't know of ARM benchmarks, but according to the paper referenced in this video, Dart is 6.67x slower than C, just behind Javascript. For comparison, Rust is 1.04x slower than C, and C++ was 1.56 slower.
      So your dart app uses probably a similar amount of power to a javascript app, but the CPU-bound parts use 6x more than Rust.
      This is only pure cpu tasks, most app time is waiting for IO, which is why most languages seem fast enough - they're not executing most of the time!

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

      @@NoBoilerplate Flutter projects are compiled to native arm machine code for mobile devices. It also leverages GPU acceleration a lot for the GUI layer
      The near JS performance is likely when it's transpiled from dart to JS for use as a JS alternative like typescript.
      We're actually doing a lot of heavy lifting in the Flutter client.

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

      By the way your videos are great!

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

      @@magfal Oh cool! I didn't know that. I hear only good things about Flutter.

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

      @@magfal Oh thank you so much! I'm learning every day 🙂

  • @m.hosseinmahmoodi
    @m.hosseinmahmoodi 2 роки тому +1

    I agree that rust is “Good Fast Cheap” but as an C\C++ I have 2 problems that make it hard for me to use rust:
    1. No support for C++ libraries (as far as I know)
    2. Rusts syntax is just too different, and I don't know, for me, it feels weird to write a type of variable right of it instead of left.
    Thing that I probably would like if I switch:
    1. Compiler errors
    2. More memory protection
    BUT in my case, “no support for C++ libraries” out weights every other thing.

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

      1. You're right, though Rust's C support is excellent (doc.rust-lang.org/nomicon/ffi.html) calling C++ functions requires a C wrapper. This is how C++ libraries are wrapped (such as GTK crates.io/crates/gtk)
      So it's not impossible, certainly easier than with Python, it's not as direct as with C.
      Check crates.io, you may find that someone has done the work for you for the library you want to use!
      2. Syntax is syntax. Some people prefer type on the left, some on the right. Many people have it even harder, and are coming from dynamic languages and ask me why it needs to be there at all! This is a matter of style, and one you may have to get used to if you want to try new languages, as it appears to be the prevailing style.
      My take is that the NAME of the variable is something I look at much more often than the type.
      Because the Rust compiler does type inference based on both sides of the = sign, in most cases, only the function signature needs to be typed.
      I am sure that you will have no problem learning Rust, coming from a C++ background you're already familiar with many of the low-level features I had to learn (My background was Python).
      This article was revolutionary for me
      fasterthanli.me/articles/a-half-hour-to-learn-rust.md
      So much so that I got permission from the author to make a video version ua-cam.com/video/br3GIIQeefY/v-deo.html (though the article is better)
      I have written about 10 other Rust videos showing the remarkable features of this language. The playlist is here ua-cam.com/video/Q3AhzHq8ogs/v-deo.html
      I'd give them a watch, and I hope you will see that small differences in syntax will seem like a small price to pay :-)

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

      Oh! I just found cxx.rs - which seems to do what you want! There's also bindgen, but I don't know much about that.
      Come and chat to me and the community on my discord if you like, the people over in #programming would be delighted to talk C++ / Rust integration discord.gg/mCY2bBmDKZ

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

    Looks like a good written promotion) but honestly, everything you are saying is totally true imo

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

      I should hope so! I'm certainly making hype videos

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

    I still can't see the advantages of lifetimes. I can def see the need for them considering how the compiler overall works, but I still can't see a single scenario where the lifetime allows me to do something I wouldn't be able to do without.
    Something that should be told, till you aren't proeficient in rust, rust is a headache cause you spend 20 hours on compiler errors for every 1 hour without. But once you are fluent in it, everything you said is pretty correct.

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

      No denying the learning curve, but that's why I'm here to get you (and me!) excited enough to push through to that point you mentioned, where you're fluent in it. It's a hard road initially, though. I crashed out twice in 2020. Glad I pushed through!
      The benefit of lifetimes (to us, not to the compiler) I can't yet explain clearly enough, though I'm nearly there. I'm writing the video, stay tuned!
      The tldr is that if your type system has lifetimes, you can model not just what your data is, but WHEN. (what sequences of your data are valid). Come ask on my discord, links on noboilerplate.org, and those smarter than me may give a better answer!

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

      @@NoBoilerplate Thx

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

    Like how you mentioned Neovide I've been using it recently it's so awesome :)

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

      Nice! Did you see my setup video for it? (my 'lightsaber' video)

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

    Another great video, I always look forward to the next video!

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

    you have convinced me to learn rust

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

      Wonderful! Honestly this language sells itself! Have you seen my video on how to learn Rust? ua-cam.com/video/2hXNd6x9sZs/v-deo.html

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

    Looking forward for "When not to use Rust". Currently I'm curating some references about when Rust become problematic for my study and amusements because making technical decision is hard and sometime biased.
    (keyword: Rust is not Panacea)

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

      I won't be making that video. However I can get you started: The biggest domain where you shouldn't use rust is where a large runtime is an asset, not a liability. Data science is a huge field where this is true. Julia is a really exciting language for these applications!

  • @JBBell
    @JBBell 2 роки тому +2

    Great stuff. Keeps this cranky old Python programmer motivated to continue learning Rust and to use it. There's something especially optimistic and soothing about the delivery, too.🙂

    • @herrpez
      @herrpez 2 роки тому +2

      Just don't buy into the "70x more efficient" part from right at the beginning. It's perhaps 70x faster to run, but what are Python scripts generally for? The language not meant for heavy lifting, so those comparisons are unfair, so to speak, unless you do come across a Python script that ends up crunching numbers at max speed for minutes (or higher) on end.
      But yes, do learn Rust! It's a great language. Just don't forget about scope and scale.

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

      "python scripts" is not what we call the second most popular language in the world. Despite what you or I think about Python's applicability, people are using it for EVERYTHING!
      Also 70x slower than C speed, is Python's pure cpu single-threaded benchmark. It utterly crumbles in multithreaded benchmarks due to the GIL.
      Yes speed doesn't really matter. But when it's HUNDREDS of times slower, it starts to matter.
      As I said in the video, unit tests are 100% cpu with no waiting for IO, so it's especially noticeable there.

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

      Thank you so much! Perhaps you'd like my delivery of Lost Terminal too? ua-cam.com/video/p3bDE9kszMc/v-deo.html

    • @herrpez
      @herrpez 2 роки тому +2

      @@NoBoilerplate No, python scripts are what you create with Python. And if you want more performance with similar ease, Nim is a fine alternative. If you want actual performance you go for a more suitable language.
      I don't think we'd disagree on this.
      I write Python for things where bash doesn't cut it, but still in the same domain as bash scripts. Beyond that, other languages are far more suitable.

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

      @@herrpez I am aware of nim, I am a maintainer of inim, the most popular repl ua-cam.com/video/Qa_9vut4TzQ/v-deo.html
      Please understand most people don't use python in the way you do. It's not the second most popular language in the world because people write scripts "where bash doesn't cut it".

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

    Could you guide me for building microservices with rust?

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

      Come chat to the community on the discord, links in the description!

  • @PandaNuker
    @PandaNuker 2 роки тому +2

    I just looove your channel so much. I wish I could work with Rust in my day-to-day job.
    The reality I've gotten used to is that for fullstack web dev (+ serverless), using e2e typescript in a monorepo saves incredible amounts of time: shared types, strong generics (close to rust), linters, shared libs, and one language design.
    But ngl I just love rust and wish I could use it professionally

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

      I too take what I've learned from Rust into my day job to improve the Ruby we write!

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

    As a complete newcomer to low-ish level languages from python who doesn't even know what the use cases for Rust are, is the Rust book still a good place to start, or do I build my beginner level experience elsewhere first? I want to be future-proof, since I hear a lot of buzz about Rust replacing C++ in the years to come.

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

      You've got a very similar background to me!
      I'd recommend:
      - fasterthanli.me/articles/a-half-hour-to-learn-rust
      (or my video made on this article)
      - github.com/rust-lang/rustlings
      and the book.
      Come ask in #newbie-advice on my discord server, there's a thousand lovely people who can help! (me too!)

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

    Another eloquent video. Thanks for the excellent work!

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

    "what does a developer do?" -- made me waste 5 minutes wondring... found out 90% of my mental stamina goes to waste into dealing with the anxiety of not knowing what I don't know yet but will get me stuck mid project. For I quite enjoy thinking about the problem and the route I will approach it, but I cringe to the thought of everything crashing in front of me

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

      Developers are paid to think, managers are paid to worry.

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

    #1 reason why I want to learn Rust:
    Not because of any of the great things you’ve talked about on this channel.
    But because since macros are denoted by a !, the macro to terminate the program because of a detected bug is *panic!*

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

      I wonder if there is a calm! crate...

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

    Rust's learning curve is about the same learning curve it takes to write safe C++ code on/near the level of Rust, only it's steeper due to the language enforcing safety onto you. You need to know ownership, borrowing, lifetimes, etc. before you can write a sizeable Rust project, while in C++, you need to learn pass by value, reference or pointer, null checking properly, and lifetimes. However, because it's not required, you don't need to do it, making the learning curve for general C++ code much shallower, at the large cost of possibly segfaulting/crashing code.

    • @KohuGaly
      @KohuGaly 2 роки тому +2

      The way I like to put it is Rust has V-shaped difficulty curve. It's hard to learn, easy to get proficient and hard to fully master. With C++ it's an ever-steepening hill all the way up.

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

      Ooh, that's very interesting. I think of it like this:
      In most languages Easy things are Easy, and hard things are possible. In Rust, Easy things are possible, hard things are Easy.

  • @dr-maybe
    @dr-maybe 2 роки тому +3

    I’m already convinced that rust is amazing, and use it for pretty much all of my new projects. Still I really like these videos, as they help me articulate why I actually like rust as much. Great content!

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

      My goal is to get as many people excited about rust as possible, and while they're learning, to stay excited 😊

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

    Anyone knows what's the font used in the examples?

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

      It's defined in the first line of the source code.
      (it's FiraCode Nerd Font)

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

    Make invalid states unrepresentable in your system is exactly how F# works too.

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

      I hear great things about F#! If I were in the dotnet ecosystem, I'd be using it for sure.

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

    As a person whose never coded in their life, how does one go from "hello world" to translating their favorite open source program written in C+ into Rust?
    I have a hunch OpenToonz's "buggy" reputation is mostly memory errors. Because it works fine for me (with ancient quad channel memory) but crashes fairly frequently for everyone else.

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

    Thanks for motivating me to keep learning rust :)

  • @edems131
    @edems131 Рік тому +2

    Nice video, i hope now I can finally convince my boss to use Rust in the next project after i will force him watch this video :D

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

      This is EXACTLY why I made this video! I have a few others that are also very boss-compatible too, check them out!

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

      @@NoBoilerplate Nice :D, good job!!!

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

      ​​​@@NoBoilerplate it would be nice if you made playlist called something like "For boss" where in right order all reletad videos would be to convince him :D

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

      @@edems131 DONE ua-cam.com/video/4dvf6kM70qM/v-deo.html

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

      @@NoBoilerplate :D awesome

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

    What do you actually use rust for yourself, do you use it for work? Hobbies? What kinds of projects do you work on?

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

      I built critical national infrastructure in it while working at the Government Digital Service, here in the UK, in 2020, that was my first taste. The experience was really profound for me: the whole first day nothing was compiling, and I thought the language was insane, but at 4pm we got it compiling and then no further changes were required and it's currently sitting in production, receiving dependabot security updates, code passing tests in CI and building with no changes.
      I genuinely think it could run for ever, this language is so focussed on uncompromising rock-solid backwards and forward compatibility.
      This commenter said it better than I ever could: ua-cam.com/video/ZFDqh3slQfU/v-deo.html

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

    with your videos i feel myself as some rust aristocrat... thank you for video

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

    yet somehow a rustc hello-world takes almost 4MB...

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

      That's the debug build, a release-optimised hello world build (I just tested this) is 256k.
      That 256k overhead doesn't balloon as your program increases in complexity, either, that's it. The rest of the program filesize will be your app.
      A real-world example is that a release-optimised build of the axum web framework's 'hello world', that includes ssl, a web server that is so fast you don't need a reverse proxy to host your static files, is 605k.
      Here's a short playlist of videos I've made that get to the heart of why Rust is something special that is changing the world from amazon, to microsoft, to linux. ua-cam.com/video/oY0XwMOSzq4/v-deo.html

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

    I don't know rust.
    I don't write rust.
    I don't plan to learn rust in the near future.(maybe i would learn when i get some free time)
    All i have is small experience with python.
    But your videos are therapeutic to watch.

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

      Thank you so much! I hope to inspire people to try it out!
      If you like my style of video, perhaps you'd like Lost Terminal: ua-cam.com/video/p3bDE9kszMc/v-deo.html

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

    "Our web frontend could be written in you" - 12:20

  • @SharukhKhan-sd7xg
    @SharukhKhan-sd7xg 2 роки тому +1

    Hi it was such a great video man loved it 🤙
    I have a question🙋
    I am a web developer more specialized in frontend development and nodejs( I love js/ts 😄)
    I am thinking about learning rust but confused between rust and go.
    What do you think I should go with that will help in my career.
    Thanks in advance. 🙏

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

      Both! Go is a fine language that if rust didn't exist, I'd be writing. These are not the last two languages you'll be learning in your career either, so start today 😊
      Try rocket.rs and yew.rs, and go through Rustlings and the Book. Hit up my discord and ask for help in there. Good luck!

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

    I like that JS is not even on the Mb list.

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

    I honestly don't get it, but is this video extolling the virtues of static typing vs dynamic typing and compiled languages vs interpreted languages?

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

      I didn't set out to do so. Perhaps I make assumptions that the audience has watched the previous videos in my rust series?
      There's far more to Rust than static typing: ua-cam.com/play/PLZaoyhMXgBzoM9bfb5pyUOT3zjnaDdSEP.html

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

      @@NoBoilerplate Well, the thing about prevoius videos is that it's entirely reliant on the UA-cam algorithm. It recommended this video to me without telling me there were others.
      From what I can tell after spending 10 minutes with an installed compiler, it's a convoluted language combinging the arcane syntax of C++ with an extensive pythonesque library.
      I mean, that's not necessarily a bad thing, but I have to wonder if it's a gatekeeping language intended to scare away new developers with its unnecessarily complicated syntax.

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

      @@YDV669 I should make it clear that these are part of a Rust series! Good point, thank you.
      Oh it's TOUGH isn't it! I also hated the syntax when I started learning in 2020, I gave up twice, but luckily had a mentor that put me back on the right track!
      Here's the way to think about it: C or Python or other popular languages don't have all this syntax because they don't support the FEATURES that rust has that they don't.
      Three clear examples of this are the Result type, often seen in return values, lifetime annotations (which state that reference x must live at least as long as reference y), and references themselves.
      A recent video where I showed an example of why this extra syntax is needed was Rust on Rails ua-cam.com/video/sbVxq7nNtgo/v-deo.html
      I'd love to know your thoughts after watching this.

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

      @@NoBoilerplate Book follows. :)
      So I watched your video, and I still don't really agree that such syntax complexity is necessary, despite all the things Rust seems to do for you at the compiler level.
      let mut x = 1
      let y = 1
      Why force the use of two keywords for almost every single variable? Mutable function variables would normally be the default, with immutables the exception, wouldn't they?.
      mut x = 1
      let y = 1
      Or to more clearly identify the immutables,
      let x = 1
      imm y = 1
      The constant abuse of the exclamation mark(!).
      The apparently forced use of the question mark(?) to unwrap the actual result from a return payload.
      "Your code will never crash." That's like the worst thing to tell companies. Maybe it won't crash, but is it correct? It's bad enough remembering having a manager with the unshakable belief that code is production-ready the moment it cleanly compiles and after a few sanity-check runs(yes, even batch update cycles). This kind of thought corrodes development budgets.
      I have no problem with the language enforcing safety at compilation time, but does it need to be so needlessly and thoughtlessly convoluted? It sounds great at the "I designed a language to impresse my girlfriend" stage, but when you're debugging a program at 3am(or even compilation errors) after already being awake for 20 hours, the ivory tower intellectualism embedded in the core of this language isn't going to win you any friends due to issues with arcane syntax potentially obscuring critical logic errors with badly placed question marks or somesuch.
      I say all this as someone who grew up on a language that literally did not believe in division by zero being any sort of error, where string comparisons were all essentially right-trimmed(empty string is equivallent to ' '*x where x is any integer from 0 to MAXINT).
      None of this is intended in any way as a criticism of you personally. Your videos are well-written and narrated, and I appreciate learning about Rust.

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

      @@YDV669 Thank you for a very coherent comment! I'm DELIGHTED to help you here, you're on the right track, but have misunderstood a few things, I think. If that's due to my video, my apologies. You wrote me a book, I'll write one for you:
      1. Mutability.
      Mutable variables are indeed the default for most languages. Rust chose to make immutability default because it's *better*. Immutability is the default in functional languages, you'll see this in Haskell and similar. Rust is a functional language.
      Look at any modern javascript tutorial, you'll find more `const` declarations than `let`. For instance, here's the first React tutorial reactjs.org/tutorial/tutorial.html the first code blocks that have variable declarations in use const. There are more `const`s on that page than `let`s
      My understanding is that in JS, the advice is is "use const by default, if you need mutability, use let".
      And why is this?
      One reason is Immutable variables are much easier to reason about and debug, we can't accidentally shadow them and mutate them, causing surprises.
      2. "Constant abuse of exclamation mark."
      The compiler enforces that macros must end with a question mark, and nothing else may. If you see a !, you are looking at a macro, simple as that.
      Macros are STAGGERINGLY powerful, they can:
      1. Rewrite syntax at compile time, and
      2. Execute arbitrary code at compile time (even disk and network access)
      You'll never have come across this power before, except if you've use lisp. Other languages have things they call macros (or templates or comptime etc) but they are very rarely able to do both the above superpowers.
      Macros have a bang ! at the end because it's important we know where they are so we aren't surprised.
      3. "Forced use of question mark to unwrap"
      Functional error passing is very different to exception handling and I understand why you are confused. It's not forced, nor does it unwrap the errors. My video on Rust's error handling is here, and I'm very proud of it, do take a look ua-cam.com/video/sbVxq7nNtgo/v-deo.html
      4. (related) "Your code will never crash"
      I think after you watch the above video about error handling, you'll understand why I say this more. Rust CARES about not crashing at runtime (it is this feature that made it perfect for Linux kernel development, something that is THIS WEEK official), and has the complex syntax and compiler to find nearly every case where it could. (edge cases that require more care to handle are OOM errors and unchecked maths, but they both have simple solutions for if you need them, say in an embedded environment)
      5. "arcane syntax potentially obscuring critical logic errors"
      I understand the syntax is unfamiliar, I really do. I hated it for the longest time, I kept crashing out of learning Rust. But I came back for the world-leading features that you simply can't get anywhere else. If you want a hard, realtime language that doesn't use a GC, and you ALSO don't want manual memory management, you're going to NEED the borrow checker. There's simply no other language available!
      The good news here is that the syntax is there for a reason. Other languages don't have borrows, so we need two symbols for a read-only borrow, and a mutable borrow [& and &mut]. OK, and now the compiler needs to know how long the programmer wants these borrows to live for, when can they be cleaned up? let's use ['a 'b 'c], name the lifetimes with simple names, you can use 'longer 'names, but most of the time there's only one or two lifetimes in a function, if any, so 'a and 'b are fine.
      Types are annotated with HashMap angle brackets as normal.
      The way I learned Rust's syntax was by reading the BRILLIANT Amos's blog post: fasterthanli.me/articles/a-half-hour-to-learn-rust
      I was so impressed by this post I made my own video version (after asking permission) ua-cam.com/video/br3GIIQeefY/v-deo.html
      Depending on if you are a reading person, or a watching person, you could try either of these to grok the syntax fast? (I'm, ironically, a reading person!)
      I wish Rust had simpler syntax too. Just as I wish for proper self-driving cars. For now, I'll have to drive a normal car, and program using a bit more syntax! Both get me where I want to go.
      It's worth noting that the rust core team add more and more places where lifetimes don't need to be explicitly stated - the goal isn't to have zero lifetimes, but to have as few as possible, while being unambiguous.
      Thanks for reading all this and chatting with me, I think this video of mine, doing a deep-dive into unsafe and macros explains these two features pretty well - and you simply can't get them anywhere else, AND THEY'RE SO GOOD I didn't know I wanted these features when I was writing Python! ua-cam.com/video/PuMXWc0xrK0/v-deo.html
      Thanks friend!

  • @Gamemake
    @Gamemake 11 місяців тому +1

    Ok ok, ill learn rust..

    • @NoBoilerplate
      @NoBoilerplate  11 місяців тому

      gottem!
      Start here, but make sure you've watched the whole short playlist ua-cam.com/video/2hXNd6x9sZs/v-deo.html

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

    Rust is cheaper, The company just need to pay for the entire training of the developer and attach rust programs to their pipeline with duct tape. Until some company spends hard on making full solutions with rust that interact well with older tech stacks (specially java and javascript stuff: java is still used in a lot of servers and javascript is impossible to get rid of), it'll just be too expensive to maintain a department just to solve rust problems while the rest of the firm runs with older software

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

      Rust's FFI in C and Javascript is terrific, but you're right about Java.
      If there's a huge legacy of Java code, would I be right in saying it might be better to use something like Kotlin or Clojure to modernise the code?