What Makes Rust Different?

Поділитися
Вставка
  • Опубліковано 17 сер 2023
  • Today's sponsor: Quadratic, check them out at www.quadratichq.com
    Programming is the purest form of applied mathematics.
    The machinery of the Rust language is built on the simple rules of functional programming and borrow checker.
    Starting with good rules is a profound way to build a language.
    You don't have to invent an error handling system in such a language.
    You can discover it.
    ❤️ If you would like to support what I do, I have set up a patreon here: / noboilerplate - Thank you!
    📄 All my videos are built in compile-checked markdown, transcript sourcecode available here github.com/0atman/noboilerplate this is also where you'll find links to everything mentioned.
    🖊️ Corrections are in the pinned ERRATA comment.
    🦀 Start your Rust journey here: • How to Learn Rust
    👕 Bad shirts available here www.teepublic.com/user/no-boi...
    🙏🏻 CREDITS & PROMO
    My name is Tris Oaten and I produce fast, technical videos.
    Follow me here tech.lgbt/deck/@noboilerplate
    Website for the show: noboilerplate.org
    Come chat to me on my discord server: / discord
    If you like sci-fi, I also produce a hopepunk podcast narrated by a little AI, videos written in Rust! www.lostterminal.com
    If urban fantasy is more your thing, I also produce a podcast of wonderful modern folktales www.modemprometheus.com
    👏🏻 Special thanks to my patreon sponsors:
    - JC Andrever-Wright
    - Miah Beach
    And to all my patrons!

КОМЕНТАРІ • 785

  • @NoBoilerplate
    @NoBoilerplate  9 місяців тому +306

    ERRATA
    - "axiom" was not the right word, apologies! "Theorem" is what I think I should have said. My metaphor got somewhat out of hand...!
    - 7:47, on the second line of the first example. sadly rust doesn't allow expression inlining, only identifiers can be inlined.
    - 12:08 "Early ad-free and tracking videos" I promise there's no tracking, woops! It should say "tracking-free"
    - 10:25 variants*

    • @katiejanzen347
      @katiejanzen347 9 місяців тому +25

      12:08
      "Early ad-free and tracking videos"

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +35

      @@katiejanzen347 I CAN'T believe I made that mistake again lol - thanks!

    • @VorpalGun
      @VorpalGun 9 місяців тому +11

      Rust error handling is oversimplified in the video. There is still panic. It is (as an embedded developer) especially annoying for memory allocations. It is a tradeoff between ergonomics and doing it properly, on a case by case basis (e.g. memory allocation, integer overflow, out of bounds access,...). Arguably all of these should have returned options or results instead.

    • @newtonchutney
      @newtonchutney 9 місяців тому +3

      10:28 line 3/4
      // compile error, no *_variants_*

    • @Ruhrpottpatriot
      @Ruhrpottpatriot 9 місяців тому +7

      0:30 - Sorry, but Math doesn't build solely on Axioms. That's actually the problem. Gödel's two incompleteness theorems state that formal systems that are of sufficient complexity a) have unprovable statements and b) cannot prove their own consistency, look no further than Peano Arithmetics[1] as an example. This in turn means that Hilbert's program, i.e. theories to a finite, complete set of axioms, proven to be consistent, does not exist. Some disagree with the last statement, but I think that Gödel is correct.
      [1]: If that is too complex, take the Zermelo-Fraenkel set theory (our current set theory) as an alternative.

  • @kobber69
    @kobber69 9 місяців тому +733

    You lost me at "computers exist", completely outrageous claim

    • @gregoryholder2423
      @gregoryholder2423 9 місяців тому +69

      Ikr, after making such an absurd statement I was simply unable to finish watching the video.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +107

      I WANT TO BELIEVE

    • @haxagonusdyad8981
      @haxagonusdyad8981 23 дні тому

      @@gregoryholder2423 69 Nice

  • @vdeave
    @vdeave 9 місяців тому +1142

    Sorry, as a mathematician I have to disagree that the axioms/rules are not invented. Mathematics is a game of determining the consequences of axioms. You choose the axioms and the consequences follow. The axioms we choose feel "natural", but that is purely a choice.
    Edit: I think your point still follows. But the point about axioms being "determined" isn't right. I love this part of mathematics 😊

    • @BR-lx7py
      @BR-lx7py 9 місяців тому +123

      This. Plus the author should read about Godel.

    • @vdeave
      @vdeave 9 місяців тому +69

      ​@@BR-lx7pythis is a good route to recontexutalise axioms as choices rather than being determined facts. I like the book Godel, Escher, Bach.

    • @0x4849
      @0x4849 9 місяців тому +56

      @@vdeave GEB is great, but maybe a little large to read for a UA-cam comment. I'd recommend veritasium's video on Gödel's incompleteness theorem as it's more easily digestible, and a lot shorter than the multiple hundred page book. If you have the chance however, it's a great read.

    • @seannewell397
      @seannewell397 9 місяців тому +23

      Depends if you believe in your axioms hard enough or not 🤪

    • @jt_hopp
      @jt_hopp 9 місяців тому +4

      I would like, but it got 42 likes rn
      Edit: 230th 👍 hehe

  • @local.interloper
    @local.interloper 9 місяців тому +720

    Hi Tris, I'm Friends

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +96

    • @eamonburns9597
      @eamonburns9597 9 місяців тому +13

      Why have I never thought of this! 👏 👏 👏

    • @speedy-b
      @speedy-b 9 місяців тому +6

      Tris ≠ The Real Integer Sorcerer

    • @vikingthedude
      @vikingthedude 9 місяців тому +7

      Hi Friends, I’m hungry

    • @renegade5942
      @renegade5942 9 місяців тому +4

      @@vikingthedude Hi hungry, im breads

  •  9 місяців тому +275

    the drop function is now my favourite function

    • @mkay2223
      @mkay2223 9 місяців тому +11

      fn main() { drop(main) } 🤔

    • @ZevIsert
      @ZevIsert 9 місяців тому

      If you like drop, you should look up nocode lol

    • @raffimolero64
      @raffimolero64 9 місяців тому +19

      ​@@mkay2223takes a function pointer to main, then doesn't do anything with it

    • @vildis.
      @vildis. 9 місяців тому +7

      No code no problems

    • @cyrusol
      @cyrusol 9 місяців тому

      How would one unit test it? xD

  • @Ciubix8513
    @Ciubix8513 9 місяців тому +224

    The drop function is insane, I always thought there was just some magic sprinkled around in rustc (tho that is arguably magic) but for some things to be that simple, it's insane

    • @dekrain
      @dekrain 9 місяців тому

      Take a look at core::mem::drop_in_place, then.

    • @Westernaut
      @Westernaut 8 місяців тому

      I drop daily, on average.

    • @thalesfm
      @thalesfm 8 місяців тому +15

      @@skulver Trying to argue that C++ does less things behind the scenes than Rust is... crazy. That's objectively not true. Basically the only thing Rust does implicitly is to drop values when they go out of scope (exactly like C++ does with destructors). C++ on the other hand is positively _riddled_ with hidden behavior. Merely declaring a variable in C++ executes arbitrary code by invoking the default constructor of the class. Passing an object to a function could invoke the copy constructor, implicitly performing a deep copy and triggering expensive memory allocations (which is determined by the declaration of the function, so there's basically no way to tell if this is happening by looking at the call site). And I'm not even going to mention exceptions.

  • @DarwinFlinches
    @DarwinFlinches 9 місяців тому +68

    I just started rewriting some of our lab's research code in rust and I had *no idea* the drop function is that simple, that was a wow moment for this rust beginner.

  • @komododragon6126
    @komododragon6126 9 місяців тому +188

    Who knew a No Boilerplate video could finally motivate me to work on that project?

  • @maxdemian6312
    @maxdemian6312 9 місяців тому +37

    Mathematicians do invent axioms and there are a lot of axiomatic systems that you can choose from (ZFC, NBG etc), and they're neither self evident (most famously there have been many disputes about the axiom of choice) nor perfect, as Gödel demonstrated

  • @katie-ampersand
    @katie-ampersand 9 місяців тому +23

    I know someone else already said it - but math's axioms are _incredibly_ a choice, to the point where there are branches of math dedicated to exploring the consequences of different choices for what would be the exact same "type" of math (for example, there are multiple kinds of arithmetic)
    and in any branch of math, you'll find that some statements cannot be proven nor disproven - the axioms simply don't have the ability to say anything about it. whether they're true or not is _your_ choice, and they create two branches of math (one where we choose it to be true and one where we don't). we just pick the useful one

    • @katie-ampersand
      @katie-ampersand 9 місяців тому +1

      These are the invented part of math. The rest is our discovery.

  • @white_145
    @white_145 9 місяців тому +15

    "Computers exists"
    I see, hot takes straight from the start

  • @ransomecode
    @ransomecode 9 місяців тому +31

    The laws of the universe are simply not discovered but rather inferred because, humans have limits and thereby our understanding has limits. So math is not "The Language" of the universe but one that we've inferred for understanding reality.

    • @seannewell397
      @seannewell397 9 місяців тому +4

      I detect an axiom you've presupposed wherein the universe has laws.
      I'd like to petition the universal legislature to amend some of these, when's the next election?

    • @Joker22593
      @Joker22593 9 місяців тому

      @@seannewell397 Imagine thinking even those kinds of laws are real.

  • @davidyoder5890
    @davidyoder5890 9 місяців тому +62

    I feel like Rust is becoming a religion.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +34

      It's more of a cargo cult 😜

  • @Speykious
    @Speykious 9 місяців тому +124

    As I suspected, lots of comments are disagreeing on the "math is discovered" part lol.
    My opinion on this is that we invent math axioms and then discover the properties that emerge from them. There have been several axiomatic systems in the past, they had their flaws and it took a really long time before we got set theory. And even then it wasn't clear cut perfect.

    • @TheRanguna
      @TheRanguna 9 місяців тому +16

      That's an interesting take.
      This video made a connection between math's and rust's "discoverability". Following your comment it makes sense that "features" in both math and rust are discovered based on fundamental building blocks, but those fundamental building blocks are invented, like math's !0 = 1 and sqrt(-1) = i, etc, and rust's None, Option, Infallible, etc.

    • @seannewell397
      @seannewell397 9 місяців тому +7

      I find your lack of faith disturbing

    • @angeldude101
      @angeldude101 9 місяців тому +33

      To quote Vi Hart: "Mathematics is about making stuff up and seeing what happens." "Making stuff up" being inventing the axioms, and "seeing what happens" being discovering the consequences of those axioms.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +17

      oh shit vihart said that? I might immediately flip my opinion!

    • @Speykious
      @Speykious 9 місяців тому +3

      @@seannewell397 I don't know what you mean but I don't use faith at all in my life so :v

  • @fredbcruz
    @fredbcruz 9 місяців тому +41

    The first time I saw the term "evangelist" in a tech context I got a bit confused.
    With your videos about Rust now I get it.
    Tanks for the amazing job! You're truly spreading the word, man.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +4

      I just want folks to have a relaxing life XD

  • @mr.johnson8974
    @mr.johnson8974 9 місяців тому +21

    Hi NB, I’m a big fan of your videos! I love Rust, in fact I’m adopting it for most if not all the backend parts of an application I’m working on. However, I think the difficulty curve of Rust is extremely understated, which is why we’ve seen Go adopted in more code bases than Rust.
    I recall a video you did easily addressing this curve, but a simple reality is that when you’re a startup with limited runway, or a department with limited budget, you have to consider the speed at which a technology can be adopted.
    I’ve heard news the Rust team is working on greatly simplifying the language, which would make it perfect for me. But I understand why others choose Go.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +15

      Oh absolutely, most startups will choose safe, easy-to-hire languages, that's a reasonable take. But if *I* were building a startup, I know the secret :-D
      So it was with Lisp, so it is with Rust www.paulgraham.com/avg.html

    • @bart5557
      @bart5557 7 місяців тому +6

      @@NoBoilerplate Wow! That was a very interesting read! I think a lot of programmers take pride into being 'low-level'. Using low-level languages shows you're smart and can write very efficient code in a convoluted language. But sometimes being smart is not focussing on the details, but focussing on getting shit done. Cool article, crazy to think it's from 2003.

  • @k98killer
    @k98killer 9 місяців тому +24

    Technically wrong about mathematics being something purely discovered. There are provable paradoxes at the center of mathematics due to the axioms used in its construction, specifically in set theory as the foundation of all mathematics. Russell's Paradox is the most well known.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +4

      Sounds like there's more discovery to be done!

  • @ogg4417
    @ogg4417 9 місяців тому +69

    Great video, just a small correction. 6:45 I wouldn't compare null in kotlin to those other languages. Nullable variables in kotlin work exactly like in rust, you must either handle the null case or explicitly unwrap it with the !! operator. The compiler prevents you from accidentally making a null pointer exception. Even though they call it null and have some syntactic sugar to handle it it is comparable to an Option in rust or a Maybe in haskell.

    • @minciNashu
      @minciNashu 9 місяців тому +4

      Newer C# has the same safe nullable concept.

    • @cocacodes
      @cocacodes 9 місяців тому +4

      While they may have the same safety, they are still not comparable to having it built using the language's algebraic data types. Options have methods that make working with them much more enjoyable them in Kotlin or C#, which would have to make such methods be special syntax in the language.

    • @ogg4417
      @ogg4417 9 місяців тому +9

      @@cocacodes Any function that you could define for a generic `Option` in rust, you could also define for the nullable generic type `T?`. They do not have to be language level special syntax. However, I do agree that it is always better for features like nullability to be defined using the algebraic data type system of the language instead of it being a separate feature. In kotlin you also lose the ability to do things like `Option` which can be useful sometimes.

    • @cocacodes
      @cocacodes 9 місяців тому

      @@ogg4417 Absolutely, but I am more mentioning this because the standard libraries of C# and Kotlin do not provide these functions on nullables, unlike Rust (this is as far as I know, I have not looked into Kotlin as much as C#)
      Edit: I am curious if even having methods on nullables would be possible, I know C# at least has a Nullable. In my previous comment I had assumed not because they had never done it before.

    • @copypaste4097
      @copypaste4097 9 місяців тому +4

      this is indeed possible in Kotlin, you can define extension functions on nullable types like this:
      fun String?.foo() = when (this) {
      null -> println("you fool"),
      else -> println(this)
      }
      (no guarantee that this compiles 😂)

  • @user-py9cy1sy9u
    @user-py9cy1sy9u 9 місяців тому +44

    7:34 Rust doesnt have exceptions because it CANT. Borrow checker under the hood is a control flow analysis. Exceptions make control flow analysis exponentially more difficult to the point where its impractical to have it in a compiler. If you have borrow checker then you dont have exceptions. If you have exceptions then you dont have borrow checker. Rust was forced to use other methods for error handling

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +12

      a great decision, exceptions suck!

    • @thalesfm
      @thalesfm 8 місяців тому +3

      They would be technically challenging to implement, sure, but Rust could certainly have exceptions

    • @CorneliusCornbread
      @CorneliusCornbread 7 місяців тому +2

      @@thalesfm I mean why would you want to considering how much nicer fallible functions are compared to exceptions

    • @paulklein649
      @paulklein649 5 місяців тому +1

      Aren't Rust Panics exceptions in the end?

    • @CorneliusCornbread
      @CorneliusCornbread 5 місяців тому

      @@paulklein649 no because there is no try catch syntax.

  • @kurt7020
    @kurt7020 9 місяців тому +9

    "You don't have to invent an error handling system" - Kinda wish they did. The builtin error handling can be clunky when dealing a whole chain of different errors, this error, that error - anyhow I'm rambling...

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +4

      I'm sorry have you tried using an exception system XD

    • @WelshProgrammer
      @WelshProgrammer 9 місяців тому +3

      Anyhow is actually a great library to help "box" and make some of those error generic enough to pass up a chain if you're not interested in handling every specific error that occurs.

  • @lemon6521
    @lemon6521 9 місяців тому +51

    "Math is the floor of the abstraction" The floor is philosophy, on which mathematics is built.
    "Math is based on fundamental self-evident axioms" These axioms are not self-evident nor fundamental, they are able to be freely chosen and the question of which axioms to choose is a question for the philosophy of mathematics
    "The rules of our universe are pre-set, and mathematicians discover them" Isn't that what physicists do?
    "These rules exist in perfect form out there" this is the philosophical position of mathematical platonism

    • @andrewdunbar828
      @andrewdunbar828 9 місяців тому +12

      This comment made my parallel lines very cross.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +5

      I'm not an expert, so I'm sure you're right!
      But, a thought experiment: if we meet an alien race, isn't philosophy is likely to be dramatically different, but maths exactly the same? A square on the other side of the universe is a square here!

    • @lemon6521
      @lemon6521 9 місяців тому +11

      ​@@NoBoilerplate That's definitely an interesting question. I would love for it to be the case that math is universal, but I think it's also possible that math is just a language we've constructed to formalize the way we think, and aliens that think differently could have math that is either incomprehensible to us or is outright wrong by our understanding and intuition about math and logic. However, I'm happy to believe our math is universal at least until such aliens actually show up, lol.

    • @nathanlewis42
      @nathanlewis42 9 місяців тому +2

      Mathematical Platonism would probably be better described as Pythagoreanism. Aristotle argued that Platonism was just an extension of Pythagoreanism.

    • @itellyouforfree7238
      @itellyouforfree7238 9 місяців тому +4

      Math is most definitely NOT built on philosophy!

  • @michael.lecompte
    @michael.lecompte 8 місяців тому +2

    Beautifully captured the magic of strong type systems. This is exactly how I felt when I first learned about functional programming in the MOOC “How to Design Programs”

  • @vimdiesel
    @vimdiesel 9 місяців тому +9

    Math being discovered as opposed to invented is debatable at best. Although it matters not to endeavours in math

  • @Axman6
    @Axman6 9 місяців тому +23

    “What Rust Discovered”, in the same sense as “How Britain Discovered Australia”; things which have been so well known by some for decades, but they’re “discoveries” when they finally land in Rust.

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

      You've got it. Sum types, the Unsafe system, functional programming - all these existing features are understood to be excellent features of a programming language, but people keep just re-inventing C.
      Go for some reason doesn't have sum types.
      Zig for some reason doesn't have an unsafe system.
      Java for some reason doesn't have functional programming (they added it, like they eventually add everything, but it's not core to the language)
      When I discovered Rust, and they'd put all these features in one language FROM THE START, I knew I couldn't go back! :-)

    • @thalesfm
      @thalesfm 8 місяців тому +2

      Yup. Pretty disappointed with the video, honestly. I was hoping it was going to talk about some interesting and unique challenge the Rust developers had to solve, not just list off a bunch of features Rust basically copied from other languages.

  • @neppc1
    @neppc1 6 місяців тому +1

    Great video, thank you. Elements of fp are are good for every language domain I guess, starting from vacuum Haskell going all through js and java, finally reaching the deeper levels of coding

  • @ktoZjarany
    @ktoZjarany 9 місяців тому +23

    that part when you talk about math being discovered rather than invented... like yeah, its just your opinion, man. philosophers argue on that for centuries, but you seem highly convinced without a good reason. dont do that. but great video, as always.

    • @jordixboy
      @jordixboy 9 місяців тому +3

      agree on that, left a similar comment. You cant just say that, there's too much controversy on that topic and no one knows the answer to it, assuming it is is wrong.

    • @seannewell397
      @seannewell397 9 місяців тому +5

      It's his axiom I suppose

    • @andrewdunbar828
      @andrewdunbar828 9 місяців тому +1

      @@seannewell397I see a parallel with Euclid.

  • @joda7697
    @joda7697 5 місяців тому +4

    Axioms are literally made up and not discovered. Sometimes you "discover" an axiom, but what you're actually doing is discovering that one of the actual axioms you were using would instead follow from making a different axiom. That different axiom is what you then use, and your former axiom becomes a theorem. But the axioms in and of themselves are pure inventions, pure conventions. Mathematicians just chose the ones that lead to the most interesting and useful theorems by consequence.
    Theorems, now those are discovered!

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

      Woops! Apologies, I was using language from a field I'm not familiar with! This was the first thing I added to the ERRATA pinned comment :-D

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

    Impressive video! Mind Blown. Gained a new subscriber.
    I have been learning rust for a few months now, love the language and i am intregued by it.

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

      It's incredible right? Here's a short playlist of essential rust videos of mine, if interested! ua-cam.com/video/oY0XwMOSzq4/v-deo.html

    • @TheEvertw
      @TheEvertw 5 місяців тому

      @@NoBoilerplate Very helpful, thanks a lot!

  • @3zzzTyle
    @3zzzTyle 9 місяців тому +5

    Yep, now I'm absolutely positive that Rust will drive me insane.

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

      This video isn't really a good intro to Rust, try this ua-cam.com/video/oY0XwMOSzq4/v-deo.html

  • @mikaellindberg93
    @mikaellindberg93 9 місяців тому +24

    The trademark shenanigans that happened made me stop learning Rust by just sticking to C and C#, but your videos make me hungry for more Rust each and every time. I really vibe with the language and I kind of want to jump into the deep end with it. Great video as always!

    • @cocacodes
      @cocacodes 9 місяців тому +24

      It's important to realize that commonly these shenanigans are in reality the community providing feedback. The trademark policy was a draft that was shown to the community beforehand for suggestions. And it indeed, got many suggestions! From an outsider looking in it looks bad, when in reality this is what healthy discourse in a community should be.

    • @raffimolero64
      @raffimolero64 9 місяців тому +18

      The qualities of the language are entirely separate from the organizations surrounding it. The language is developed by the community, so whatever fiascos happen with the orgnaizations shouldn't affect the worth of a language; its features and its ecosystem. And there's no denying its reach into Google, Microsoft, Discord, Linux, and so on.
      They are, however, backed financially by those organizations, and they also host conferences, at which point someone was invited to discuss a shiny new language feature concept but promptly had their talk downgraded, somehow. They are no longer working on that feature concept.
      Still, what we have now is more than enough of a reason to continue.

    • @KaneYork
      @KaneYork 9 місяців тому +13

      The bad rules were never adopted, and are still going through revision / waiting for the 2nd version.

    • @cocacodes
      @cocacodes 9 місяців тому +6

      @@raffimolero64 This one of the controversies that was actually really unfortunate to happen. Hopefully the new organizational changes will prevent these issues from occuring again.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +32

      I agree with the replies to this message, but I'll add my own take: Ignore what lawyers and politicians *say*, and focus on on what engineers and scientists *do*.
      I live my life by this and it keeps me focussed on important things. If in doubt, wait a year and see if anyone still cares!

  • @NoahSteckley
    @NoahSteckley 9 місяців тому +11

    Yeah but I had a hellish time trying to convert basic Pandas ML into Rust due to the crates being designed so poorly and opaquely. An N-dimensional array is pretty rough to implement, and even more rough to understand if you didn't write it.

  • @2raddude
    @2raddude 9 місяців тому +25

    I like what you’re going for, but tbh this video feels more based on platitudes than usual. I still appreciate the content, thank you for all of your hard work!

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +17

      Totally reasonable take, I didn't quite have enough time to hone this video down, which might be what you're picking up on. feedback received, I'll get better every time :-)

    • @2raddude
      @2raddude 9 місяців тому +7

      @@NoBoilerplate you have such a positive attitude! :)

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +5

      @@2raddude only way to live my dude!

  • @Rudxain
    @Rudxain 9 місяців тому +4

    0:06 Math is just applied logic... which is just applied philosophy

  • @Christian-op1ss
    @Christian-op1ss 9 місяців тому +11

    Rust is a language I love the idea of, but the more I actually tried to use it for more complex things, the more I disliked using it.
    It starts with the horrendously slow compiler. Then the way the compiler flags correct function code as having errors due to problems elsewhere in code. However the biggest issue I found to be that it often forces complete rewrites when an idea is taken into a direction, and you find out quite late that Rust just does not like the approach. This can be seen as a feature (perhaps the approach was wrong to begin with?). However I found perfectly fine directions often not working in Rust due to how lifetimes and static bindings work, forcing a more "less Rusty" approach that kind of defeats the purpose. I also found C interop hard in practice, due to how Rust works with borrowing, but perhaps that is a skill issue on my part. The macros are great compared to C/C++ and the like, but I think they are still not great, with two kinds of macros, with one being pretty hard to write or worse, comprehend. Zig comptime shows the way here I think.
    In practice, for my purposes, these things make Rust best at smaller tools that have a clear scope and are predictable in how you want to implement them, and where low latency, low memory usage and great performance are paramount.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +2

      Interesting, here's my takes on what you've said:
      1. I'd rather the compiler do work than leave it up to me
      2. I have learned to trust the compiler, even when it annoys me asking me to rewrite my logic. While I think my ideas might work now, I am proved again and again that doing it rust's simple way stops problems in 6 months time after scaling and expansion.
      3. C interop is a sharp edge, quite right there. I care less about this each month that C libraries get rewritten in rust. C interop isn't quite as important as in other language - I can rewrite it in rust XD
      4. Zig comptime is clear and easy because it's dramatically less powerful. Comptime can't call externally, can't access the disk or network. SQLx can't be written in zig. If you have 'full fat' macros (ie arbitary compile time code execution) you have super powers. If you have zig, you have nice constants. Comptime can be written in macros, but not the other way around:
      crates.io/crates/comptime

    • @laundmo
      @laundmo 9 місяців тому +1

      @@NoBoilerplate The way i understand it Zig is specificallly designed to not have code generation. The comparison to Rusts macros is very unfortunate here, because Rust actually has something comptime should be compared to: const eval. In Rust, const eval is almost exactly what Zig comptime is at least advertised to be - a way to run code at compile time.
      This means the comparison to macros is comparing apples to oranges. compare comptime to const eval instead.
      doc.rust-lang.org/reference/const_eval.html

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

      @@laundmo oh, good point!

  • @Simone_Grossi
    @Simone_Grossi 4 місяці тому +2

    The idea that mathematics is discovered and not invented is disputed. The mathematicians are actually split in two fields about it.

  • @LiamDennehy
    @LiamDennehy 4 місяці тому +1

    This is probably the most important resource I've fund for experienced programmers to understand the Why of Rust, instead of just how to achieve familiar tasks in a new language. Very well done, and profound in its' simplicity.

  • @xXx_Regulus_xXx
    @xXx_Regulus_xXx 8 місяців тому +2

    1:09 computers DO exist, but they've only existed since last Thursday just like everything else.

  • @spectator5144
    @spectator5144 9 місяців тому +14

    using rust for a few months made me a much better developer in all other languages due to the enum mentality

    • @andrewdunbar828
      @andrewdunbar828 9 місяців тому +4

      I always feel dirty when I don't handle possible error cases now, even the ones that "can't happen"™

  • @jvcmarc
    @jvcmarc 9 місяців тому +7

    great video! i had a teacher who once told me: some languages are invented, some are discovered, stick to the discovered ones. and it was surreal seeing that some concept being talked about here. there is something very powerful to that family of discovered languages, but i think every language has some degree of inventions in them (syntax for instance, which can be very arbitraty)
    i'd also like to make a very small correction to the video, at 7:47, on the second line of the first example. sadly rust doesn't allow expression inlining, only identifiers can be inlined. as a learning exercise once i made a crate with copies of std macros that use string formatting, but that allowed for expression inlining, but i never released it. i think this is definitely something that could be improved in the language, but it is also very minor

    • @absobel
      @absobel 9 місяців тому +1

      I get why they didn't add expression inlining, it would get less readable very quick

    • @diadetediotedio6918
      @diadetediotedio6918 9 місяців тому +1

      All languages were invented technically speaking

    • @angeldude101
      @angeldude101 9 місяців тому +2

      As nice as that sentiment is, the languages that were "discovered" tend to be significantly more complex than languages that were "invented," and as a result are significantly harder to learn as an adult. The only real benefit to the former is the history and culture behind them.

    • @raffimolero64
      @raffimolero64 9 місяців тому +1

      ​@@angeldude101if your language doesn't have a million inconistencies and a million idioms, it has never been used nor evolved by a million people.

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

      ah, thank you! added to the errata

  • @coltyngregoryify
    @coltyngregoryify 9 місяців тому +1

    This channel is so awesome!!

  • @klirmio21
    @klirmio21 5 місяців тому +1

    Honestly, bro, the way you are giving the information, not just monotonous but like with , with the power, idk how to describe it, with the pauses, dramatic effect idk... It made me even listen through the whole sponsor part

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

      Thank you very much, I was terrible at public speaking due to my autism when I was younger! I've tried to practice and imitate good speakers, and after 15 years I think I'm getting the hang of it :-)

  • @coffee-is-power
    @coffee-is-power 9 місяців тому +14

    The "computers exist" thing got me rolling on the floor KKKKKK
    Couldn't agree more

  • @elmourikiyassine
    @elmourikiyassine 8 місяців тому +1

    thank you so much for mentioning the "rust by example"

  • @qschroed
    @qschroed 7 місяців тому +1

    rusts type system was amazing to me because it was the clearest implementation of linear logic into a type system i have seen so far

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

      It really feels like Haskell in C's clothing doesn't it!
      I have a short playlist of other amazing features, as well as my recommendations on how to learn here:
      ua-cam.com/video/oY0XwMOSzq4/v-deo.html

  • @hyperscaler
    @hyperscaler 8 місяців тому +2

    The more I explore about Rust, the more my mind gets blown. It's like a convergence of C++ and LISP after taking away the disadvantages of both.
    It will be the language of the future for sure and the most critical projects (especially system software) will use it. Learning it now will pay huge dividends in the coming years.
    Shoutout to @NoBoilerplate for such fascinating videos.

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

      Thank you so much for your kind words, and yes I totally agree!
      I have a playlist of my best Rust videos, which explain even more, if you're interested: ua-cam.com/video/oY0XwMOSzq4/v-deo.html

  • @porky1118
    @porky1118 9 місяців тому +2

    4:30 Also have a look at Scopes. It's both higher level and lower level than Rust, basically a Lisp with LLVM level core language, higher than Lisp level Metaprogramming and python like indentation based syntax, but simpler and more generic, and Rust lifetimes, but without the need of references.

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

      There are lots of languages that are better than Rust in some areas, but popularity is why we're here! Cool looking language, though I note there's no macros :-D

    • @porky1118
      @porky1118 9 місяців тому +1

      @@NoBoilerplate
      >better ... in some areas
      Feature-wise it's better in almost all areas.
      It just isn't as clean as Rust, no focus on safety, etc. (also no orphan rules)
      The main reason, I don't use it anymore.
      >I note there's no macros
      There are macros in Scopes.
      Three different kinds of macros even.
      The documentation is probably still missing a lot.
      inline, which is a function partially evaluated at compile time, more like templates than inline functions
      sugar, which is like lisp macros (transform one expression into another one, just syntactic sugar)
      spice, which has access to type information and evaluated constants at compile time.
      It's the only langugae where I was able to implement geometric algebra, generic (at compile time) over dimensions and types.
      It also uses llvm vectors internally, important for addition and is able to track if a a multi vector is a versor at compile time for further optimizations.

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

      @@porky1118 do any of those three compile time macros have access to the disk and network? I can't give that up! Here's what I mean: ua-cam.com/video/MWRPYBoCEaY/v-deo.html

    • @porky1118
      @porky1118 9 місяців тому

      ​@@NoBoilerplate Never tried it, but sugar and spice is just code run at compile time, so I'm pretty sure it's possible.
      Besides that, you can also just run code at compile time without using macros using the run-stage builtin.

  • @w1keee
    @w1keee 9 місяців тому +5

    hey Tris, you've been making great videos about how great Rust(tm) is. it would be great if you also made a video of things which you don't like about it

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +4

      I would but they keep fixing the problems!
      I very likely won't do that kind of video, plenty of others are working that space already.

    • @w1keee
      @w1keee 9 місяців тому

      @@NoBoilerplate ok, can you at least reply with some of them to this comment?

  • @NeunEinser
    @NeunEinser 5 місяців тому +1

    I learned Rust just a month ago, and I was in awe discovering all these extremely smart decisions. It feels like Rust for the most part doesn't really invent that many new things (nulls being bad is well known, nullability markers are emerging in many languages because of it, though they are often not more than a marker, trying to cover up past design decisions). The only exception to that I can really think of is the borrow checker. It still often gets in my way, but at least I get to insult it in my comments.
    Enums also are a bit hard to grasp at first, perhaps because when I hear "enum" my mind already has that concept in its head from other languages, a simple enumeration type without fields.
    So at first it was a bit weird to me they called Option an enume when it looked more like a nullability marker.
    When I discovered how it's actually implemented and how it's not an opaque compiler abstraction, and same for Result, I can't put the joy I felt into words. It's simply an arbitrary convention the standard library implements rather than an explicit language feature.
    And because of the way they implemented unit types (None essentially carries a unit type) and enums, the compiler will still compile it with null, so you don't get any performance penalty. Same if you have your own Option-like enum. Because there is nothing special about Option.
    The only thing I wish for Option is that TypeName? was an alias for Option.
    The trait system is also really cool, implementing similar ideas as OOP interfaces, but without extensibility, so you can still work with raw structs.

  • @johnwilliams7999
    @johnwilliams7999 9 місяців тому +1

    great video Tris, very inspiring. Sometimes is hard to know how to put all this knowledge into practise though as sometimes the documentation on some crates can be spares

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

    Today in my functional programming class we were discussing functional programming in Rust and other otherwise imperative languages, and we touched upon a certain point which seems to be one of the few instances in which your argument is invalidated, which is that the question mark operator is not implemented as some sort of general pattern - the Rust devs created an entire special syntax for working just with Result and Error, when actually we could extend this syntax to deal with any kind of monad at all, like Haskell would let you do. Instead of making ? something that could be overloaded or generalized, they just went "nope, let's just make this beautiful and glorious abstraction limited to exactly 2 circumstances." This is a wart and a half.

  • @gordonfreimann
    @gordonfreimann 9 місяців тому +3

    Python does not have null. it has an Optional type that can either be None or the Value. It just does not force you to do error checking

    • @geetmankar
      @geetmankar 9 місяців тому +6

      Pythons None is actually like a Null in other languages, although there are some small differences

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +5

      Optionals only exists if you use MyPy or similar, but it's not really how the fundamentals of the language work.
      It's another retro-fit, which as I said in the video, just doesn't cut it for me. (
      MyPy is good, so is TypeScript, so is Kotlin, but I need to sleep soundly at night!

  • @anarchoyeasty3908
    @anarchoyeasty3908 9 місяців тому +4

    I look forward to your videos every time they drop. Thank you for making these tris

    • @andrewdunbar828
      @andrewdunbar828 9 місяців тому +2

      I wait for the bus every time the bus arrives.

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

    Great video. As someone who loves functional languages, but is forced to use C++ at my day job, I really enjoyed the way this is presented.
    The rest of what follows is a nitpick:
    I feel that your point about Optional and Reault are muddled somewhat by one of the few warts with Rust: the question mark operator being a compiler hack instead of an instance of a general purpose monad. I feel it wouldve been worth juxtaposing the Rust author's choice to define optional and result in the language itself, but question mark as a builtin hack.

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

      You can build your own versions of Result and Option and have them work fine with ?, such as the universal lib.rs/crates/anyhow

  • @ThePandaGuitar
    @ThePandaGuitar 9 місяців тому +2

    Back to my login page in PHP and changing color in CSS.

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

      Rust's really great for backend and frontend web development too (replacing javascript and php) if you're interested: ua-cam.com/video/P4LMfkFLRsI/v-deo.html

  • @angryapplebombs914
    @angryapplebombs914 9 місяців тому +5

    I could never quite put my finger on why I like rust so much and everything felt so logical in it, but this explains that perfectly. Everything really feels like a natural continuation of the base axioms which makes my brain feel good

  • @IsawU
    @IsawU 9 місяців тому

    I feel like this fits neatly into what emergence is about. I really like the concept of emergence.

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

      Ooh, I'll look into that, thank you!

    • @Speykious
      @Speykious 9 місяців тому +1

      Yup, that's exactly what I meant by features _emerging_ from the type system. This kind of thing happens all the time in Math- heck, Math is pretty much built on emergent properties.

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

      @@Speykious Maths is **cool** and I should learn more

  • @alexgo4081
    @alexgo4081 9 місяців тому +7

    Yes! I'm on the right path with Rust, even as a newcomer to programming. I'm eager to uncover all that it has to offer, and the future looks bright. Every concept is a new discovery, and I can't wait to see where this journey takes me!

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

      I'm excited for you! Did you see my video with recommendations? ua-cam.com/video/2hXNd6x9sZs/v-deo.html

  • @GoldenAgeMath
    @GoldenAgeMath 8 місяців тому +1

    I see people arguing with you about axioms being chosen. I’m a math grad student, and although axioms are chosen, the important part is that everything that comes after IS discovered!! And the library of reasonable axioms one might choose from is pretty small!

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

      Thank you! Totally my mistake, I misunderstood when I was researching this "fundamental truths" idea that I'm trying to present. Ah well, on to the next one!

  • @miguelguthridge
    @miguelguthridge 9 місяців тому +23

    Rust's design makes me immeasurably happy. It's so consistent and clear, and everything surrounding it sticks to that level of clarity. I have severe ADHD and my working memory is kinda hopeless, so I rely heavily on tools such as language servers to get things done (since I can't remember my way around most code, it's great to let my editor do the remembering for me), and the way Rust is designed means that its tooling for things like language servers is the best I've ever used. Things like that mean that it's not just a well-designed language, but also a very accessible language, and I appreciate it a lot.

  • @DavidDLee
    @DavidDLee 9 місяців тому +1

    Looks interesting. Unfortunately, Go is more in demand right now, which is why it is prudent to learn it at a higher priority.

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

      Look at where Go and Rust are in this graph, they're EXTREMELY close! redmonk.com/sogrady/2023/05/16/language-rankings-1-23/
      Also, I disagree with your central thesis. There are more Go jobs, of course, but there are also more Go developers applying for those jobs. The goods are odd but the odds are good!
      ALSO you don't think you'll only be writing go for the rest of your life, right? Learn two languages, Go is good, Rust is good! :-)

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

    I actually came back, because that product in the advertisement haunted me. I have to empower my data scientists with this. Thank you.

  • @alangamer50
    @alangamer50 9 місяців тому +1

    I was not prepared for the tomfoolery of the drop function

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

    do you have a series on Scala? just wondering since everything that people like about Rust (other than the manual memory management or borrowing) is in Scala :shrug:

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

      I'm publishing a video in 6 minutes where I talk briefly about scala, what a co-incidence!

  • @SianaGearz
    @SianaGearz 8 місяців тому +1

    It's funny how the processor that sequentially executes machine instructions was an implementation lead deasign but by early 90s became an abstraction with pipeline, then an ever less fitting abstraction with out of order. And now we have Meltdown and friends where the abstraction turns out leaky. There is a lot of dark arts hiding the real processor from us.
    VLIW was supposed to be the solution to expose the processor innards directly, but every time turned out a lot less efficient. Again abstraction allows optimisation.
    Maybe we're due for another run of VLIW processor. This time with specialising tranpiler from something like webasm, which can perform these optimisations as they become discovered at runtime.

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

      Very true, it's deeply cryptic down at the cpu level. I'm heartened that when such optimisations are built, LLVM probably will be able to use them! (and therefore rust!)

  • @yaksher
    @yaksher 9 місяців тому +5

    I'm not sure I agree with the notion that Rust is a universal language. Certainly, it is _capable_ of much more than most languages, and in fact, almost any programming task, but that doesn't make it the best choice for many things. From my experience with C, kernels, and Rust, I would much rather write a kernel in Zig than in Rust, at least for the core parts. Attempting to grapple with ownership in a system where things have no owner and where shared mutability is a necessity is a pain. Rust also makes it very hard to write lock-free code. The lack of a garbage collector means that even in code where the performance penalties of a garbage collector really don't matter in the slightest, you have to worry about lifetimes and ownership. This makes me still default to Python for quick and dirty tasks, because it saves me the effort of complicated type annotations and putting .clone() everywhere (honestly, I think Rust would benefit a lot from a clone operator of some kind).

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +2

      There's two different points here:
      1. The borrow checker makes shared ownership safe. You're right, not easy, but, I'll take safe over easy any day of the week when writing kernels.
      2. Python's great for quick and dirty scripts, no doubt. The lack of scaling (both in performance and in cognative overhead) of python I've addressed in other videos.
      These days, I don't choose which language I use, I just use Rust, safe in the knowledge that once the kernel or script becomes non trivial (and I have no control which projects 'escape' into production!) I can sleep at night.

    • @yaksher
      @yaksher 9 місяців тому +2

      ​@@NoBoilerplate The issue is that something like a running kernel thread doesn't really have an owner at all, and something like context switching in Rust seems like a nightmare that would be entirely unsafe code and I'm not sure what the ownership model for that even begins to look like (though admittedly, it's probably mostly written in inline assembly, just like it would be in C and Zig so I guess aside from what the fuck ownership even means here, it wouldn't be all that different). Plus, Rust's unsafe code seems like a huge pain to write due to (*(*x).y).z, not to mention that you have to be extremely careful calling back out to safe code since you can have multiple mut pointers but not multiple mut references.
      Rust's support for custom allocators also seems rather limited at the moment, though I suppose you with no_std you'll need to write your own support for custom allocators. Languages like Zig and C are careful to make the vast majority of their standard library features not require an allocator (hence the admittedly sometimes annoying paradigm of "pass a buffer everywhere" in C and the fact that in Zig everything that needs an allocator excepts one as an argument to the constructor). I'm unsure how you'd replace a vector's allocator with an arena allocator in Rust, whereas in C or Zig it'd be trivial in either case.
      That all said, for things like kernel extensions/drivers and less central parts where things own themselves and nothing makes sense, Rust seems like a much more potentially appealing prospect.

    • @zaper2904
      @zaper2904 9 місяців тому

      @@NoBoilerplate With all due respect I feel like you don't really have much experience with systems programming. In the land of kernels (or embedded systems) often 'safe' simply isn't a thing. Rust might be a beautiful mathematic abstraction but at the end of the day you're still running it on silicone and said silicone is mostly botched together from 40 years of additive improvements with mountains of legacy code.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +2

      @@zaper2904 You're quite right, I don't have much experience with systems programming, I say so often in my videos - my background is a web developer.
      However I don't think your take is right.
      The end-user's silicone, the bare metal, has nothing to do with safety, right? The horse has bolted by this point. Safety starts and ends at compile time, in embedded code.
      Huge amounts of verification happen before the code runs on metal.
      You can do this with formal systems or Trying Really Really Hard.
      Here's what another systems programmer told me: The Rust compiler is actually as picky as our community wishes the C++ users were. 🙂

    • @zaper2904
      @zaper2904 9 місяців тому

      @@NoBoilerplate That's a fair point however most of my systems experience comes from writing kernels and in my experience the layer between hardware and code starts to break down at that level.
      For a very simple example the way you idiomatically write to screen in x86 protected/long mode (32/64 bit mode) is rawdogging a pointer to a memory address. Now this is obviously trivially simple to abstract over and most Rust OS projects use it as a simple example, however when you get into the lands of task switching for instance the abstractions Rust is based on start to break down and lead to very painful code.

  • @Arnaz87
    @Arnaz87 9 місяців тому +2

    How does rust avoid then inserting a drop at the end of the drop function?

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

      I believe it is a special case - read up here doc.rust-lang.org/book/ch04-01-what-is-ownership.html

    • @KohuGaly
      @KohuGaly 9 місяців тому +1

      Simple - there is no drop function. In Rust, all destructors are automatically generated and calls to them placed. Rust does let you inject code into the destructor via the Drop trait. But that code is only given mutable reference to the object - it merely gives you a way to modify the object before the destructors of its fields are invoked recursively.

  • @zokalyx
    @zokalyx 9 місяців тому +2

    IIRC Infallible can also be used when you need to return a Result (for whatever reason) but there is not possible error in the function.
    You can return -> Result
    EDIT: I found the video. SUPER RECOMMENDED: ua-cam.com/video/s5S2Ed5T-dc/v-deo.html

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

      I LOVE Logan Smith's videos!

    • @Speykious
      @Speykious 9 місяців тому +1

      Can also be used the other way around, which makes a lot of sense: Result
      You either continue your loop without ever returning, or end with an error.

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

    Hi, I have a question! My coding background is a 100% python, I have no experience with low level programming languages. I'd like to ask you what would you recommend me doing in this case. Should I go ahead and learn Rust from scratch or should I get the basics from c++ and then go ahead and learn Rust?

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

    Thank you for this video! I'm already sold on Rust, but this helps reinforce that choice.

  • @charliesumorok6765
    @charliesumorok6765 8 місяців тому +1

    11:44 C can be used to write interactive web apps, even though it was made before the internet existed.

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

      a good point, but no-one would use it today, as it's the wrong level of abstraction. My point is that despite my background as a high-level web developer, I prefer to write high-level web apps in Rust!

    • @charliesumorok6765
      @charliesumorok6765 8 місяців тому +1

      @@NoBoilerplateFor the web, I prefer using languages built for the web like HTML and SCSS as well as some JS snippets when needed, since the web browser was not supposed to be a computer. Both C and Rust require some JS to run in order to load in the browser, which has to be run sequentially.

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

      @@charliesumorok6765 interesting thoughts, I think we are mostly on the same page.
      I prefer using html and css
      I adore html and css, I've been a web developer for 15 years. We're not talking about replacing those two, we're talking about replacing JS
      the browser was not supposed to be a computer
      We're literally communicating using a very complex JS app. I don't agree with this.
      both c and js require js in order to load in the browser
      Webassembly isn't some kind of hack. It's supported in all browsers across all devices. You bootstrap it with a simple
      import * as app from "hello-wasm-pack";
      app.greet();
      and then javascript hands over to webassembly, running at native speed.
      which has to be run sequentially
      Webassembly code doesn't run 'on top' of javascript, don't be confused by the bootstrapping call. It runs at native speed significantly faster than javascript.
      It's really amazing! We're in a transitionary phase at the moment, but Rust is the best language to build wasm, here's my video on it ua-cam.com/video/P4LMfkFLRsI/v-deo.html

  • @sasukesarutobi3862
    @sasukesarutobi3862 9 місяців тому +1

    1:18 Ah yes, Jagger's Law.

  • @anotherone2398
    @anotherone2398 9 місяців тому +2

    this is quality content , concise and informative

  • @winterunderscore
    @winterunderscore 9 місяців тому +1

    love this

  • @halemmerich8941
    @halemmerich8941 8 місяців тому +2

    is rust really self-host?, since its backend is still llvm which written in c and c++

  • @JaredJeyaretnam
    @JaredJeyaretnam 6 місяців тому +1

    It feels like Julia is a bit like this! In terms of almost the entire language being written in Julia itself - the Julia compiler is good enough that you can just write natural code and it finds a fast way of doing it.

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

      BIG fan of Julia, the typing is weaker and more of an afterthought than with Rust, so I wouldn't want to build a production system in it, but for data science, it's SO much better than python! I'm rooting for it!

  • @trueriver1950
    @trueriver1950 5 місяців тому

    PL/1 was self hosted right from the start.
    The compiler was written, and then manually followed by a team of three people to generate the assembly code.
    So the compiler was written in the target language before any machine readable computer existed.
    I've always thought that that must have been as incredibly boring task: it's not really programming at all to simply follow the letter of the high level code in front of you to wipe the assembly code.

  • @korumann
    @korumann 9 місяців тому +6

    I think math is built on philosophy

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

    I think rust is the only lang that the more I learn it the more beautiful it seems

  • @InfiniteRain_
    @InfiniteRain_ 9 місяців тому +2

    At 10:04, shouldn't the total amount of possible states be 8 * 8 * 1 instead of 8 + 8 + 1?

    • @InfiniteRain_
      @InfiniteRain_ 9 місяців тому +3

      Nevermind, that would be the case only if it were a struct. This is an enum, therefore 8 + 8 + 1 is correct.

    • @Speykious
      @Speykious 9 місяців тому +2

      @@InfiniteRain_ indeed, it's 8+8+1, hence why it's called "sum type"

  • @danitorres124
    @danitorres124 8 місяців тому +1

    "If something can be done in javascript it will eventually be done in javascript"
    **Rust has entered the chat**

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

      The Rust Mob: "Nice browser you've got here, shame if someone were to do what you do but better here, eh?"

  • @advanceringnewholder
    @advanceringnewholder 9 місяців тому +2

    But can rust macro compile rust?

  • @MrJballn
    @MrJballn 8 місяців тому

    The Garth Merhengi bit you've got going here is good.

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

      What do you mean?

    • @MrJballn
      @MrJballn 8 місяців тому +1

      @@NoBoilerplate Your tour guiding, there's a good amount of Darkplace to it.

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

      @@MrJballn oh nice! My friends rave about that show, it's on my list, thank you! 🙂

  • @pillmuncher67
    @pillmuncher67 9 місяців тому +2

    I kinda prefer parentheses to curly braces, if you catch my drift.

  • @TheOneMaddin
    @TheOneMaddin 9 місяців тому +1

    This combination of low- and high-level features isn't unheard of. You always mention C, but C++ would fit the bill, wouldn't it?

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

      C++ doesn't have lisp-style macros. Try this playlist for better explanations ua-cam.com/video/oY0XwMOSzq4/v-deo.html

    • @KohuGaly
      @KohuGaly 9 місяців тому +3

      Yes, but C++ infamously lacks the railguards between the high and low level features, and can't add them in because of backwards-compatibility. In Rust, type safety, memory safety and thread safety are guaranteed by default and you can opt out of them if you are brave or dumb enough to use the very scary looking syntax that let's you do so. In C++ it's often unfortunately the other way around.

  • @seannewell397
    @seannewell397 9 місяців тому +1

    Curious... Did you accidentally leak your faith in maths in this video? Or is not about faith at all for you (and therefore more accurate to say we invent the axioms, actually?)

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

      probably! I know there's two sides to the "maths is absolute" vs "maths is human" argument, I've nailed my colours to the mast in this video!

  • @jeffg4686
    @jeffg4686 9 місяців тому +2

    Are you secretly teaching us C++?
    Was that the plan all along with Rust?
    I like that you emphasize that Rust is a Universal, general purpose language.
    When they describe it as a systems programming language, that scares away most from higher level languages, and I don't think they need to be scared of it.
    I do think we need concise training on the core for new developers.

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

      You jest, but I feel like I'm *finally* learning the low-level coding topics that I was too afraid to try C out with!

  • @johnterpack3940
    @johnterpack3940 8 місяців тому +1

    I actually understood 27.3% of that.
    There's no doubt this mathematical underpinning is what draws me to Rust. I have a hyper-analytic mind. So I do well with things that proceed logically. Functional programming uber alles.
    Thought I was already subscribed. Must be UA-cam shenanigans.

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

      I'm no mathematician (as evidenced by me misunderstanding what axioms are -woops!) but thank you! I've got some more rust videos I'm really proud of in a short playlist here, if you're interested: ua-cam.com/video/oY0XwMOSzq4/v-deo.html

  • @EdowythIndowyl
    @EdowythIndowyl 5 місяців тому

    Just ran into this video. Math uses lots of words with overloads and some words uniquely. Axiom is one of the few that is pretty much unique. An axiom in math is a *fundamental* *assumption* that you can not eliminate. For instance see the "foundations of geometry" wikipedia page which contains a quick, easy introduction to axiomatic systems. Some areas of mathematics, like Algebras, Groups, Sets, Rings, Categories, Monads, etc, do not need any axioms. They have some foundational definitions, then prove a whole body of knowledge based solely upon the laws of logic. All the statements which need to be proved in such areas of math use "Theorem", or some alias, to refer to themselves.

  • @chris.dillon
    @chris.dillon 9 місяців тому +1

    0:34 What does it mean for math or science if infinity doesn't exist out there? Infinity of any type isn't real. I think things like this make it more of a debate and not resolved, please anyone chime in ...

  • @8booksamonth
    @8booksamonth 9 місяців тому +4

    “features simply emerge”. Everyone who’s tried rust felt that

  • @m.m3633
    @m.m3633 9 місяців тому +1

    How you handle exceptional cases, I mean how you can handle events that can happen at any time unexpectedly, like KeyboardInterrupts, SIGKILL and SIGTERM?
    A usecase for handling these is when you are writing a software like a text editor that needs to save user data before exiting.

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +2

      Signals are handled with this system rust-cli.github.io/book/in-depth/signals.html
      But typically, if you're writing a text editor, you'd use a higher-level TUI framework, which might already have this handling built-in.
      Here's my deep-dive into rust's Result error handling, if you're interested :-) ua-cam.com/video/sbVxq7nNtgo/v-deo.html

  • @k98killer
    @k98killer 9 місяців тому +4

    I have not really liked using Rust so far with an admittedly small sample size, but I do really love the deep, detailed discussions that the Rust community tends to generate. The merging of high level functional programming and low level memory control has been enlightening to witness and learn about. I feel inspired to make my own language (well, another language -- I've already made a simple language for building embedded ACLs that compiles to bytecode and is extensible with up to an additional 194 operators) that merges some Lisp syntax with lexical scoping, more data structures than just a singly-linked list, consistent and no-nonsense naming convention, reference counted pointers for all variables, and no heap memory. The algebraic type system and idiomatic result handling are things that will probably make it into the first version.

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

      My advice to you is the same as the advice to anyone thinking of making a new language: Don't write it *with* rust, write it *inside* rust, using a macro. You'll get LSP, tooling and everything else for free. Inspiration crates.io/crates/macro_lisp

    • @Speykious
      @Speykious 9 місяців тому +1

      My ultimate point when I talk about ADTs that way is to encourage anyone who wants to make a new programming language to at least incorporate ADTs into it, so I'm very happy to read this comment :D

    • @k98killer
      @k98killer 9 місяців тому

      @@NoBoilerplate I will admit that I liked Common Lisp less than Rust, so if I was going to build a new syntax using macros, I'd rather do it in Rust than in CLisp. However, I am inclined to write the reference implementation in Go because I feel confident in my ability to write performant Go code and because I'd rather start from scratch.

  • @5133937
    @5133937 5 місяців тому +1

    I want to check your sponsor Quadratic , is there a link somewhere?

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

      Apologies, the link went missing from the description somehow... I'll fix that! www.quadratichq.com

  • @cheebadigga4092
    @cheebadigga4092 5 місяців тому

    I never believed in "rewrite everything in Rust" until I finally learned the language and my lord this language is awesome!

  • @thekwoka4707
    @thekwoka4707 9 місяців тому +1

    wow, drop....it makes total sense, but I assumed it did more explicitely

  • @gangov
    @gangov 9 місяців тому +5

    man, I love your work

    • @NoBoilerplate
      @NoBoilerplate  9 місяців тому +2

      Thank you so much! I had a lot of help today, there's still so much for me to learn about this incredible language :D

  • @ekids.bassment
    @ekids.bassment 9 місяців тому +1

    Your speech would be much clearer when you turn down the bass. (just a tip) Thank you for the video, great content

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

      I'm not boosting the bass, that's the sound from my microphone! I'm much closer to it than most people on UA-cam, I prefer a "podcast/audiobook" sound for my speech .

  • @MattWyndham
    @MattWyndham 7 місяців тому +1

    Gotta come back and watch this again later when I've learned more

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

      Very reasonable, it took me a few goes to learn Rust back in 2020!
      Here's my video on my recommended way to learn, for when you do: ua-cam.com/video/2hXNd6x9sZs/v-deo.html

  • @jlinkpro
    @jlinkpro 8 місяців тому +2

    i would suggest that math is based upon logic, which in turn is based upon philosophy.

  • @hansdampf2284
    @hansdampf2284 9 місяців тому +1

    0:27 debatable.
    The philosophy of mathematics has different branches. And most mathematicians believe in materialism, like you do apparently, that mathematical truths exist in the universe without a person thinking about them. They are therefore discovered.
    But that is only one of the different -isms in the philosophy of mathematics. The other extreme is institutionism, which believes that we just make mathematical objects up in our head and going from basic axioms we invent new objects that fit those axioms and all the other objects we have already invented.
    There are many many more isms that go between those two extremes.
    I tend to think materialism is right, just judging from my gut here. But then again, Gödel showed we are either incomplete for contradictory, so maybe it’s just all in our head then.