What Makes Rust Different?

  Переглядів 194,115

No Boilerplate

No Boilerplate

9 місяців тому

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!

КОМЕНТАРІ: 786
@NoBoilerplate
@NoBoilerplate 8 місяців тому
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 8 місяців тому
12:08 "Early ad-free and tracking videos"
@NoBoilerplate
@NoBoilerplate 8 місяців тому
@@katiejanzen347 I CAN'T believe I made that mistake again lol - thanks!
@VorpalGun
@VorpalGun 8 місяців тому
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 8 місяців тому
10:28 line 3/4 // compile error, no *_variants_*
@Ruhrpottpatriot
@Ruhrpottpatriot 8 місяців тому
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 8 місяців тому
You lost me at "computers exist", completely outrageous claim
@gregoryholder2423
@gregoryholder2423 8 місяців тому
Ikr, after making such an absurd statement I was simply unable to finish watching the video.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I WANT TO BELIEVE
@haxagonusdyad8981
@haxagonusdyad8981 4 дні тому
@@gregoryholder2423 69 Nice
@local.interloper
@local.interloper 8 місяців тому
Hi Tris, I'm Friends
@NoBoilerplate
@NoBoilerplate 8 місяців тому
@eamonburns9597
@eamonburns9597 8 місяців тому
Why have I never thought of this! 👏 👏 👏
@speedy-b
@speedy-b 8 місяців тому
Tris ≠ The Real Integer Sorcerer
@vikingthedude
@vikingthedude 8 місяців тому
Hi Friends, I’m hungry
@renegade5942
@renegade5942 8 місяців тому
@@vikingthedude Hi hungry, im breads
@vdeave
@vdeave 8 місяців тому
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 8 місяців тому
This. Plus the author should read about Godel.
@vdeave
@vdeave 8 місяців тому
​@@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 8 місяців тому
@@vdeave GEB is great, but maybe a little large to read for a UKposts 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 8 місяців тому
Depends if you believe in your axioms hard enough or not 🤪
@jt_hopp
@jt_hopp 8 місяців тому
I would like, but it got 42 likes rn Edit: 230th 👍 hehe
8 місяців тому
the drop function is now my favourite function
@mkay2223
@mkay2223 8 місяців тому
fn main() { drop(main) } 🤔
@ZevIsert
@ZevIsert 8 місяців тому
If you like drop, you should look up nocode lol
@raffimolero64
@raffimolero64 8 місяців тому
​@@mkay2223takes a function pointer to main, then doesn't do anything with it
@vildis.
@vildis. 8 місяців тому
No code no problems
@cyrusol
@cyrusol 8 місяців тому
How would one unit test it? xD
@Ciubix8513
@Ciubix8513 8 місяців тому
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 8 місяців тому
Take a look at core::mem::drop_in_place, then.
@Westernaut
@Westernaut 8 місяців тому
I drop daily, on average.
@thalesfm
@thalesfm 7 місяців тому
@@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.
@komododragon6126
@komododragon6126 8 місяців тому
Who knew a No Boilerplate video could finally motivate me to work on that project?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Good for you!
@DarwinFlinches
@DarwinFlinches 8 місяців тому
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.
@davidyoder5890
@davidyoder5890 8 місяців тому
I feel like Rust is becoming a religion.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
It's more of a cargo cult 😜
@maxdemian6312
@maxdemian6312 8 місяців тому
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 8 місяців тому
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 8 місяців тому
These are the invented part of math. The rest is our discovery.
@white_145
@white_145 8 місяців тому
"Computers exists" I see, hot takes straight from the start
@mr.johnson8974
@mr.johnson8974 8 місяців тому
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 8 місяців тому
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 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.
@ransomecode
@ransomecode 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@seannewell397 Imagine thinking even those kinds of laws are real.
@Speykious
@Speykious 8 місяців тому
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 8 місяців тому
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 8 місяців тому
I find your lack of faith disturbing
@angeldude101
@angeldude101 8 місяців тому
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 8 місяців тому
oh shit vihart said that? I might immediately flip my opinion!
@Speykious
@Speykious 8 місяців тому
@@seannewell397 I don't know what you mean but I don't use faith at all in my life so :v
@fredbcruz
@fredbcruz 8 місяців тому
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 8 місяців тому
I just want folks to have a relaxing life XD
@3zzzTyle
@3zzzTyle 8 місяців тому
Yep, now I'm absolutely positive that Rust will drive me insane.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
This video isn't really a good intro to Rust, try this ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@ogg4417
@ogg4417 8 місяців тому
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 8 місяців тому
Newer C# has the same safe nullable concept.
@cocacodes
@cocacodes 8 місяців тому
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 8 місяців тому
@@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 8 місяців тому
@@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 8 місяців тому
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 😂)
@mikaellindberg93
@mikaellindberg93 8 місяців тому
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 8 місяців тому
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 8 місяців тому
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 8 місяців тому
The bad rules were never adopted, and are still going through revision / waiting for the 2nd version.
@cocacodes
@cocacodes 8 місяців тому
@@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 8 місяців тому
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!
@Christian-op1ss
@Christian-op1ss 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@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 8 місяців тому
@@laundmo oh, good point!
@k98killer
@k98killer 8 місяців тому
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 8 місяців тому
Sounds like there's more discovery to be done!
@kurt7020
@kurt7020 8 місяців тому
"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 8 місяців тому
I'm sorry have you tried using an exception system XD
@WelshProgrammer
@WelshProgrammer 8 місяців тому
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.
@michael.lecompte
@michael.lecompte 7 місяців тому
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”
@NoBoilerplate
@NoBoilerplate 7 місяців тому
Thank you!
@vimdiesel
@vimdiesel 8 місяців тому
Math being discovered as opposed to invented is debatable at best. Although it matters not to endeavours in math
@Rudxain
@Rudxain 8 місяців тому
0:06 Math is just applied logic... which is just applied philosophy
@NoahSteckley
@NoahSteckley 8 місяців тому
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.
@user-py9cy1sy9u
@user-py9cy1sy9u 8 місяців тому
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 8 місяців тому
a great decision, exceptions suck!
@thalesfm
@thalesfm 7 місяців тому
They would be technically challenging to implement, sure, but Rust could certainly have exceptions
@CorneliusCornbread
@CorneliusCornbread 6 місяців тому
@@thalesfm I mean why would you want to considering how much nicer fallible functions are compared to exceptions
@paulklein649
@paulklein649 4 місяці тому
Aren't Rust Panics exceptions in the end?
@CorneliusCornbread
@CorneliusCornbread 4 місяці тому
@@paulklein649 no because there is no try catch syntax.
@2raddude
@2raddude 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@NoBoilerplate you have such a positive attitude! :)
@NoBoilerplate
@NoBoilerplate 8 місяців тому
@@2raddude only way to live my dude!
@Axman6
@Axman6 8 місяців тому
“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 8 місяців тому
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 7 місяців тому
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 місяців тому
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
@TheEvertw
@TheEvertw 5 місяців тому
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 місяців тому
It's incredible right? Here's a short playlist of essential rust videos of mine, if interested! ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@TheEvertw
@TheEvertw 5 місяців тому
@@NoBoilerplate Very helpful, thanks a lot!
@spectator5144
@spectator5144 8 місяців тому
using rust for a few months made me a much better developer in all other languages due to the enum mentality
@andrewdunbar828
@andrewdunbar828 8 місяців тому
I always feel dirty when I don't handle possible error cases now, even the ones that "can't happen"™
@jvcmarc
@jvcmarc 8 місяців тому
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 8 місяців тому
I get why they didn't add expression inlining, it would get less readable very quick
@diadetediotedio6918
@diadetediotedio6918 8 місяців тому
All languages were invented technically speaking
@angeldude101
@angeldude101 8 місяців тому
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 8 місяців тому
​@@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 8 місяців тому
ah, thank you! added to the errata
@xXx_Regulus_xXx
@xXx_Regulus_xXx 7 місяців тому
1:09 computers DO exist, but they've only existed since last Thursday just like everything else.
@elmourikiyassine
@elmourikiyassine 8 місяців тому
thank you so much for mentioning the "rust by example"
@hyperscaler
@hyperscaler 7 місяців тому
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 7 місяців тому
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: ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@coltyngregoryify
@coltyngregoryify 8 місяців тому
This channel is so awesome!!
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Thank you so much!
@coffee-is-power
@coffee-is-power 8 місяців тому
The "computers exist" thing got me rolling on the floor KKKKKK Couldn't agree more
@LiamDennehy
@LiamDennehy 3 місяці тому
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.
@NoBoilerplate
@NoBoilerplate 3 місяці тому
Thank you so much!
@porky1118
@porky1118 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@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 8 місяців тому
@@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: ukposts.info/have/v-deo/hYeDhI95pnl2wo0.html
@porky1118
@porky1118 8 місяців тому
​@@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 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@NoBoilerplate ok, can you at least reply with some of them to this comment?
@gordonfreimann
@gordonfreimann 8 місяців тому
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 8 місяців тому
Pythons None is actually like a Null in other languages, although there are some small differences
@NoBoilerplate
@NoBoilerplate 8 місяців тому
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!
@klirmio21
@klirmio21 4 місяці тому
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 4 місяці тому
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 :-)
@Arnaz87
@Arnaz87 8 місяців тому
How does rust avoid then inserting a drop at the end of the drop function?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I believe it is a special case - read up here doc.rust-lang.org/book/ch04-01-what-is-ownership.html
@KohuGaly
@KohuGaly 8 місяців тому
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.
@alangamer50
@alangamer50 8 місяців тому
I was not prepared for the tomfoolery of the drop function
@NoBoilerplate
@NoBoilerplate 8 місяців тому
RIGHT!?
@lemon6521
@lemon6521 8 місяців тому
"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 8 місяців тому
This comment made my parallel lines very cross.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
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 8 місяців тому
​@@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 8 місяців тому
Mathematical Platonism would probably be better described as Pythagoreanism. Aristotle argued that Platonism was just an extension of Pythagoreanism.
@itellyouforfree7238
@itellyouforfree7238 8 місяців тому
Math is most definitely NOT built on philosophy!
@halemmerich8941
@halemmerich8941 8 місяців тому
is rust really self-host?, since its backend is still llvm which written in c and c++
@halemmerich8941
@halemmerich8941 8 місяців тому
nvm, I get it now.
@IsawU
@IsawU 8 місяців тому
I feel like this fits neatly into what emergence is about. I really like the concept of emergence.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Ooh, I'll look into that, thank you!
@Speykious
@Speykious 8 місяців тому
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 8 місяців тому
@@Speykious Maths is **cool** and I should learn more
@qschroed
@qschroed 6 місяців тому
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 6 місяців тому
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: ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@joda7697
@joda7697 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 4 місяці тому
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
@TheOneMaddin
@TheOneMaddin 8 місяців тому
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 8 місяців тому
C++ doesn't have lisp-style macros. Try this playlist for better explanations ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@KohuGaly
@KohuGaly 8 місяців тому
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.
@InfiniteRain_
@InfiniteRain_ 8 місяців тому
At 10:04, shouldn't the total amount of possible states be 8 * 8 * 1 instead of 8 + 8 + 1?
@InfiniteRain_
@InfiniteRain_ 8 місяців тому
Nevermind, that would be the case only if it were a struct. This is an enum, therefore 8 + 8 + 1 is correct.
@Speykious
@Speykious 8 місяців тому
@@InfiniteRain_ indeed, it's 8+8+1, hence why it's called "sum type"
@cupofkoa
@cupofkoa 8 місяців тому
Let's be honest - None and null are pretty much the same semantics
@cupofkoa
@cupofkoa 8 місяців тому
I realised that semantics is used a lot in this video. I hope your use of semantics is semantically simialar to my use of semantics.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
The key thing is they're different types. In other languages null is a valid value for a String. In Rust, None isn't a valid value for a String. The effects of this a HUGE. My video on this is here: ukposts.info/have/v-deo/q5KHrKdupYSlyKM.html
@alexgo4081
@alexgo4081 8 місяців тому
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 8 місяців тому
I'm excited for you! Did you see my video with recommendations? ukposts.info/have/v-deo/apiJgpptr2-ku6c.html
@NeunEinser
@NeunEinser 4 місяці тому
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.
@jeffg4686
@jeffg4686 8 місяців тому
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 8 місяців тому
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!
@winterunderscore
@winterunderscore 8 місяців тому
love this
@anarchoyeasty3908
@anarchoyeasty3908 8 місяців тому
I look forward to your videos every time they drop. Thank you for making these tris
@andrewdunbar828
@andrewdunbar828 8 місяців тому
I wait for the bus every time the bus arrives.
@ThePandaGuitar
@ThePandaGuitar 8 місяців тому
Back to my login page in PHP and changing color in CSS.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Rust's really great for backend and frontend web development too (replacing javascript and php) if you're interested: ukposts.info/have/v-deo/iGR9gZyifYKD1H0.html
@advanceringnewholder
@advanceringnewholder 8 місяців тому
But can rust macro compile rust?
@khhnator
@khhnator 8 місяців тому
"mathematicians discover, not invent" oh dear... we really want to get into math fundamentalism? lol
@SianaGearz
@SianaGearz 8 місяців тому
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!)
@Simone_Grossi
@Simone_Grossi 4 місяці тому
The idea that mathematics is discovered and not invented is disputed. The mathematicians are actually split in two fields about it.
@RenderingUser
@RenderingUser 8 місяців тому
Brb Gonna go oxidise the rest of my life.
@johnwilliams7999
@johnwilliams7999 8 місяців тому
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
@charliesumorok6765
@charliesumorok6765 8 місяців тому
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 місяців тому
@@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 7 місяців тому
@@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 ukposts.info/have/v-deo/iGR9gZyifYKD1H0.html
@sasukesarutobi3862
@sasukesarutobi3862 8 місяців тому
1:18 Ah yes, Jagger's Law.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
A fellow philosopher I see!
@yash1152
@yash1152 8 місяців тому
2:22 meaning of _self hosted_ compiler 2:28 i dont think zig is self hosted yet?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Please expand on what you mean. And zig is indeed self-hosted.
@yash1152
@yash1152 8 місяців тому
@@NoBoilerplate as for the first, it was for my own; as for second - u already understood that.
@angryapplebombs914
@angryapplebombs914 8 місяців тому
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
@miguelguthridge
@miguelguthridge 8 місяців тому
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.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
great take, thank you!
@m.m3633
@m.m3633 8 місяців тому
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 8 місяців тому
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 :-) ukposts.info/have/v-deo/q5KHrKdupYSlyKM.html
@johnterpack3940
@johnterpack3940 7 місяців тому
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 UKposts shenanigans.
@NoBoilerplate
@NoBoilerplate 7 місяців тому
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: ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@GoldenAgeMath
@GoldenAgeMath 7 місяців тому
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 7 місяців тому
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!
@tupak29
@tupak29 8 місяців тому
In the end we will see if Rust stays/becomes more popular or not. There was a time when everyone thought that whole Java is going to be rewritten in Scala... guess what it didn't happen. I look sceptical at Rust, on the other hand I look very optimistic when looking at Go for example. In fact the most popular languages are not those which have complex structure, but those which have simple structure, like Java (8), C, Python... The learning factor of a language cannot be underestimated. Right now there is a hype for Rust, we'll see if it stays that way or will it fall off eventually.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I'm glad you brought up scala, there are already more rust projects on github than scala, swft and kotlin. Here's my video for what I think rust is so popular: It's not trendy, it's *boring* ukposts.info/have/v-deo/p4lhjK2Ehomr0mg.html
@Speykious
@Speykious 8 місяців тому
The Rust hype is not new at all. It's been the most loved language on StackOverflow surveys for 7 years straight. It's being used by big companies such as Discord to replace one of their Go-written backend services, by Google for all new Android code, by Microsoft for some new Windows code, and is supported as the first ever second language in the Linux kernel. The thing that separates Rust from other languages is that it has a substantially different paradigm and brings a lot more to the table than a few syntax changes and targeted safety features, it brings a _whole safe environment_ in which you can do low-level code without a GC yet also without getting memory errors, while being able to make invalid states unrepresentable. The combination of all of this does wonders for correctness. I can safely say that Rust will definitely stick and continue to grow for at least a few decades to come, until something better comes up.
@peterfireflylund
@peterfireflylund 8 місяців тому
I don’t think more than 5% of the Java coders ever thought that.
@tupak29
@tupak29 8 місяців тому
I'm still skeptical about Rust@@NoBoilerplate. The complexity of the language is it's main drawback and I don't think that, apart from the "hype period" it's going to get more attention. It's got it's niche. Zig for example looks much more promising in that regard. When you're looking at the most popular languages like Java, Python, JavaScript... It's never about safety or performance, it'a about a combination of easy-to-learn syntax, quick results and acceptable performance for the use case. I don't buy Rust hype.
@DavidDLee
@DavidDLee 8 місяців тому
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 8 місяців тому
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! :-)
@danitorres124
@danitorres124 7 місяців тому
"If something can be done in javascript it will eventually be done in javascript" **Rust has entered the chat**
@NoBoilerplate
@NoBoilerplate 7 місяців тому
The Rust Mob: "Nice browser you've got here, shame if someone were to do what you do but better here, eh?"
@korumann
@korumann 8 місяців тому
I think math is built on philosophy
@zokalyx
@zokalyx 8 місяців тому
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: ukposts.info/have/v-deo/q2WEZnubbIpexZc.html
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I LOVE Logan Smith's videos!
@Speykious
@Speykious 8 місяців тому
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.
@spectator5144
@spectator5144 8 місяців тому
fucking excellent video brother
@NoBoilerplate
@NoBoilerplate 8 місяців тому
THANK YOU!
@ReidMewborne
@ReidMewborne 3 місяці тому
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 3 місяці тому
I'm publishing a video in 6 minutes where I talk briefly about scala, what a co-incidence!
@darius0501
@darius0501 8 місяців тому
Man you sound like 3kliksphillip but on a technical subject, i like that :D
@NoBoilerplate
@NoBoilerplate 8 місяців тому
brits represent!
@ekids.bassment
@ekids.bassment 8 місяців тому
Your speech would be much clearer when you turn down the bass. (just a tip) Thank you for the video, great content
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I'm not boosting the bass, that's the sound from my microphone! I'm much closer to it than most people on UKposts, I prefer a "podcast/audiobook" sound for my speech .
@henrispriet9812
@henrispriet9812 8 місяців тому
10:56 99% sure that the never type (!) is stable
@Speykious
@Speykious 8 місяців тому
It is, but combining it with other types isn't. i.e. you cannot return something like Result
@henrispriet9812
@henrispriet9812 8 місяців тому
@@Speykious Thanks I didn't know that. I commented because the example shown in the video is valid on stable.
@RichardLaughlin
@RichardLaughlin 3 місяці тому
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 3 місяці тому
You can build your own versions of Result and Option and have them work fine with ?, such as the universal lib.rs/crates/anyhow
@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?
@MrJballn
@MrJballn 7 місяців тому
The Garth Merhengi bit you've got going here is good.
@NoBoilerplate
@NoBoilerplate 7 місяців тому
What do you mean?
@MrJballn
@MrJballn 7 місяців тому
@@NoBoilerplate Your tour guiding, there's a good amount of Darkplace to it.
@NoBoilerplate
@NoBoilerplate 7 місяців тому
@@MrJballn oh nice! My friends rave about that show, it's on my list, thank you! 🙂
@8booksamonth
@8booksamonth 8 місяців тому
“features simply emerge”. Everyone who’s tried rust felt that
@Blaineworld
@Blaineworld 8 місяців тому
I really like how while certain things seemed weird and arbitrary at first, as I learned why they are that way, it all started to make a lot of sense and I ended up learning more about how those things technically work. An example of this is the distinction between String and &str. Also, I am curious why drop is not marked as const in the video. It seems like it could be. Is there any reason for it not to be?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
oh, you're quite right, I simplified the code without noting that, sorry!
@herpa77
@herpa77 7 місяців тому
"there's so much more left foR US To discover" :D
@NoBoilerplate
@NoBoilerplate 7 місяців тому
ok that's clever!
@charliesumorok6765
@charliesumorok6765 8 місяців тому
11:35 Rust assumes that the computer that it is running on can do multiple tasks concurrently, which is not always the case. The Apple ][ can only do 1 task at a time.
@jamesnewman9547
@jamesnewman9547 8 місяців тому
When/where does rust assume this?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
Please don't assume the worst, that's a poor way to live. Rust is built on LLVM, which has plenty of targets for non-parallel processors.
@charliesumorok6765
@charliesumorok6765 8 місяців тому
@@jamesnewman9547 In the expansion of println!(), a lock is used, which is only neccesary when the environment supports concurrency. Multiple processes with shared memory does result in locks being useful. Since the Apple ][ can only run 1 program at a time, locks are not necessary for Apple ][ programs.
@charliesumorok6765
@charliesumorok6765 8 місяців тому
@@NoBoilerplate I don't expect LLVM to be able to remove the locks when they are not needed.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
@@charliesumorok6765 it doesn't need to: Rust's conditional compilation trivially does what you want here
@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.
@robert36902
@robert36902 Місяць тому
Thank you for this video! I'm already sold on Rust, but this helps reinforce that choice.
@jlinkpro
@jlinkpro 8 місяців тому
i would suggest that math is based upon logic, which in turn is based upon philosophy.
@gangov
@gangov 8 місяців тому
man, I love your work
@NoBoilerplate
@NoBoilerplate 8 місяців тому
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
@gavinvales8928
@gavinvales8928 8 місяців тому
have you had time to play with typst?
@NoBoilerplate
@NoBoilerplate 8 місяців тому
looks like a cool way to co-write latex
@k98killer
@k98killer 8 місяців тому
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 8 місяців тому
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 8 місяців тому
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 8 місяців тому
@@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.
@zperk13
@zperk13 8 місяців тому
Ohhhhh that's why they're called product and sum types!
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I learned this fact for this video too!
@5133937
@5133937 4 місяці тому
I want to check your sponsor Quadratic , is there a link somewhere?
@NoBoilerplate
@NoBoilerplate 4 місяці тому
Apologies, the link went missing from the description somehow... I'll fix that! www.quadratichq.com
@necauqua
@necauqua 8 місяців тому
I'm sorry, but the whole point of Kotlin was to have non-null types, it literally started with that (at least when it crawled out of obscurity) "readsble Scala with convenient non-nullable types" is literally how I described it to friends att the time The downfall is ultumately that it has to interact with Java and it's nulls 😂
@NoBoilerplate
@NoBoilerplate 8 місяців тому
I really like kotlin, but the JVM having nulls is the problem I am talking about.
@petermichaelgreen
@petermichaelgreen 8 місяців тому
And rust has the same problem when it has to interact with C and it's nulls.
@NoBoilerplate
@NoBoilerplate 8 місяців тому
@@petermichaelgreen Completely different problem, and rust has a best-in-class system called "unsafe" to deal with C and FFI: doc.rust-lang.org/book/ch19-01-unsafe-rust.html It is possible to build a reliable system out of unreliable parts. My video on unsafe is here ukposts.info/have/v-deo/iKV-jI2aZ66jrGQ.html
@thekwoka4707
@thekwoka4707 8 місяців тому
wow, drop....it makes total sense, but I assumed it did more explicitely
Rust Data Modelling Without Classes
11:25
No Boilerplate
Переглядів 156 тис.
Rust makes you feel like a GENIUS
10:48
No Boilerplate
Переглядів 396 тис.
didn't want to let me in #tiktok
00:20
Анастасия Тарасова
Переглядів 8 млн
Statically Typed APIs with Poem and Rust
10:21
No Boilerplate
Переглядів 85 тис.
how NASA writes space-proof code
6:03
Low Level Learning
Переглядів 2 млн
Best Programming Languages Tier List
33:02
Serif Sundown
Переглядів 5 тис.
Why i think C++ is better than rust
32:48
ThePrimeTime
Переглядів 259 тис.
Rust is easy... (we make it hard)
10:11
Let's Get Rusty
Переглядів 112 тис.
8 deadly mistakes beginner Rust developers make
14:14
Let's Get Rusty
Переглядів 152 тис.
The purest coding style, where bugs are near impossible
10:25
Coderized
Переглядів 825 тис.
Rust Functions Are Weird (But Be Glad)
19:52
Logan Smith
Переглядів 122 тис.
Rust Error Handling - Best Practices
21:33
Jeremy Chone
Переглядів 10 тис.
Rust for the impatient
10:43
No Boilerplate
Переглядів 637 тис.
didn't want to let me in #tiktok
00:20
Анастасия Тарасова
Переглядів 8 млн