Тёмный

What Makes Rust Different? 

No Boilerplate
Подписаться 236 тыс.
Просмотров 195 тыс.
50% 1

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!

Опубликовано:

 

17 авг 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 786   
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
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 месяцев назад
12:08 "Early ad-free and tracking videos"
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
@@katiejanzen347 I CAN'T believe I made that mistake again lol - thanks!
@VorpalGun
@VorpalGun 9 месяцев назад
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 месяцев назад
10:28 line 3/4 // compile error, no *_variants_*
@Ruhrpottpatriot
@Ruhrpottpatriot 9 месяцев назад
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 месяцев назад
You lost me at "computers exist", completely outrageous claim
@gregoryholder2423
@gregoryholder2423 9 месяцев назад
Ikr, after making such an absurd statement I was simply unable to finish watching the video.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
I WANT TO BELIEVE
@haxagonusdyad8981
@haxagonusdyad8981 9 дней назад
@@gregoryholder2423 69 Nice
@local.interloper
@local.interloper 9 месяцев назад
Hi Tris, I'm Friends
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
@eamonburns9597
@eamonburns9597 9 месяцев назад
Why have I never thought of this! 👏 👏 👏
@speedy-b
@speedy-b 9 месяцев назад
Tris ≠ The Real Integer Sorcerer
@vikingthedude
@vikingthedude 9 месяцев назад
Hi Friends, I’m hungry
@renegade5942
@renegade5942 9 месяцев назад
@@vikingthedude Hi hungry, im breads
@vdeave
@vdeave 9 месяцев назад
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 месяцев назад
This. Plus the author should read about Godel.
@vdeave
@vdeave 9 месяцев назад
​@@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 месяцев назад
@@vdeave GEB is great, but maybe a little large to read for a RU-vid 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 месяцев назад
Depends if you believe in your axioms hard enough or not 🤪
@jt_hopp
@jt_hopp 9 месяцев назад
I would like, but it got 42 likes rn Edit: 230th 👍 hehe
9 месяцев назад
the drop function is now my favourite function
@mkay2223
@mkay2223 9 месяцев назад
fn main() { drop(main) } 🤔
@ZevIsert
@ZevIsert 9 месяцев назад
If you like drop, you should look up nocode lol
@raffimolero64
@raffimolero64 9 месяцев назад
​@@mkay2223takes a function pointer to main, then doesn't do anything with it
@vildis.
@vildis. 9 месяцев назад
No code no problems
@cyrusol
@cyrusol 9 месяцев назад
How would one unit test it? xD
@Ciubix8513
@Ciubix8513 9 месяцев назад
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 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.
@davidyoder5890
@davidyoder5890 8 месяцев назад
I feel like Rust is becoming a religion.
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
It's more of a cargo cult 😜
@DarwinFlinches
@DarwinFlinches 9 месяцев назад
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 месяцев назад
Who knew a No Boilerplate video could finally motivate me to work on that project?
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
Good for you!
@white_145
@white_145 9 месяцев назад
"Computers exists" I see, hot takes straight from the start
@maxdemian6312
@maxdemian6312 9 месяцев назад
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 месяцев назад
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 месяцев назад
These are the invented part of math. The rest is our discovery.
@ransomecode
@ransomecode 9 месяцев назад
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 месяцев назад
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.
@3zzzTyle
@3zzzTyle 9 месяцев назад
Yep, now I'm absolutely positive that Rust will drive me insane.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
This video isn't really a good intro to Rust, try this ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.html
@Speykious
@Speykious 9 месяцев назад
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 месяцев назад
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 месяцев назад
I find your lack of faith disturbing
@angeldude101
@angeldude101 9 месяцев назад
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 месяцев назад
oh shit vihart said that? I might immediately flip my opinion!
@Speykious
@Speykious 9 месяцев назад
@@seannewell397 I don't know what you mean but I don't use faith at all in my life so :v
@mr.johnson8974
@mr.johnson8974 9 месяцев назад
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 месяцев назад
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.
@fredbcruz
@fredbcruz 9 месяцев назад
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 месяцев назад
I just want folks to have a relaxing life XD
@vimdiesel
@vimdiesel 9 месяцев назад
Math being discovered as opposed to invented is debatable at best. Although it matters not to endeavours in math
@kurt7020
@kurt7020 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 месяцев назад
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.
@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.
@k98killer
@k98killer 9 месяцев назад
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 месяцев назад
Sounds like there's more discovery to be done!
@Rudxain
@Rudxain 9 месяцев назад
0:06 Math is just applied logic... which is just applied philosophy
@Christian-op1ss
@Christian-op1ss 9 месяцев назад
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 месяцев назад
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 месяцев назад
@@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!
@2raddude
@2raddude 9 месяцев назад
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 месяцев назад
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 месяцев назад
@@NoBoilerplate you have such a positive attitude! :)
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
@@2raddude only way to live my dude!
@mikaellindberg93
@mikaellindberg93 9 месяцев назад
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 месяцев назад
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 месяцев назад
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 месяцев назад
The bad rules were never adopted, and are still going through revision / waiting for the 2nd version.
@cocacodes
@cocacodes 9 месяцев назад
@@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 месяцев назад
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!
@ogg4417
@ogg4417 9 месяцев назад
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 месяцев назад
Newer C# has the same safe nullable concept.
@cocacodes
@cocacodes 9 месяцев назад
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 месяцев назад
@@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 месяцев назад
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 😂)
@lemon6521
@lemon6521 9 месяцев назад
"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 месяцев назад
This comment made my parallel lines very cross.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
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 месяцев назад
​@@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 месяцев назад
Mathematical Platonism would probably be better described as Pythagoreanism. Aristotle argued that Platonism was just an extension of Pythagoreanism.
@itellyouforfree7238
@itellyouforfree7238 9 месяцев назад
Math is most definitely NOT built on philosophy!
@NoahSteckley
@NoahSteckley 9 месяцев назад
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.
@michael.lecompte
@michael.lecompte 8 месяцев назад
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 8 месяцев назад
Thank you!
@user-py9cy1sy9u
@user-py9cy1sy9u 9 месяцев назад
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 месяцев назад
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.
@xXx_Regulus_xXx
@xXx_Regulus_xXx 7 месяцев назад
1:09 computers DO exist, but they've only existed since last Thursday just like everything else.
@spectator5144
@spectator5144 9 месяцев назад
using rust for a few months made me a much better developer in all other languages due to the enum mentality
@andrewdunbar828
@andrewdunbar828 9 месяцев назад
I always feel dirty when I don't handle possible error cases now, even the ones that "can't happen"™
@joda7697
@joda7697 5 месяцев назад
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
@coffee-is-power
@coffee-is-power 9 месяцев назад
The "computers exist" thing got me rolling on the floor KKKKKK Couldn't agree more
@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
@korumann
@korumann 8 месяцев назад
I think math is built on philosophy
@elmourikiyassine
@elmourikiyassine 8 месяцев назад
thank you so much for mentioning the "rust by example"
@cupofkoa
@cupofkoa 9 месяцев назад
Let's be honest - None and null are pretty much the same semantics
@cupofkoa
@cupofkoa 9 месяцев назад
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 9 месяцев назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sbVxq7nNtgo.html
@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! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.html
@TheEvertw
@TheEvertw 5 месяцев назад
@@NoBoilerplate Very helpful, thanks a lot!
@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.
@miguelguthridge
@miguelguthridge 9 месяцев назад
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 9 месяцев назад
great take, thank you!
@LiamDennehy
@LiamDennehy 4 месяца назад
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 4 месяца назад
Thank you so much!
@ktoZjarany
@ktoZjarany 9 месяцев назад
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 месяцев назад
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 месяцев назад
It's his axiom I suppose
@andrewdunbar828
@andrewdunbar828 9 месяцев назад
@@seannewell397I see a parallel with Euclid.
@khhnator
@khhnator 8 месяцев назад
"mathematicians discover, not invent" oh dear... we really want to get into math fundamentalism? lol
@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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.html
@coltyngregoryify
@coltyngregoryify 8 месяцев назад
This channel is so awesome!!
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
Thank you so much!
@alangamer50
@alangamer50 9 месяцев назад
I was not prepared for the tomfoolery of the drop function
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
RIGHT!?
@gordonfreimann
@gordonfreimann 9 месяцев назад
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 месяцев назад
Pythons None is actually like a Null in other languages, although there are some small differences
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
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 :-)
@jvcmarc
@jvcmarc 9 месяцев назад
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 месяцев назад
I get why they didn't add expression inlining, it would get less readable very quick
@diadetediotedio6918
@diadetediotedio6918 9 месяцев назад
All languages were invented technically speaking
@angeldude101
@angeldude101 9 месяцев назад
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 месяцев назад
​@@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
@w1keee
@w1keee 9 месяцев назад
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 месяцев назад
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?
@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?"
@8booksamonth
@8booksamonth 9 месяцев назад
“features simply emerge”. Everyone who’s tried rust felt that
@porky1118
@porky1118 9 месяцев назад
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 месяцев назад
@@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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-MWRPYBoCEaY.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.
@qschroed
@qschroed 7 месяцев назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.html
@TheOneMaddin
@TheOneMaddin 9 месяцев назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.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.
@winterunderscore
@winterunderscore 9 месяцев назад
love this
@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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-P4LMfkFLRsI.html
@RenderingUser
@RenderingUser 9 месяцев назад
Brb Gonna go oxidise the rest of my life.
@angryapplebombs914
@angryapplebombs914 9 месяцев назад
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
@anarchoyeasty3908
@anarchoyeasty3908 9 месяцев назад
I look forward to your videos every time they drop. Thank you for making these tris
@andrewdunbar828
@andrewdunbar828 9 месяцев назад
I wait for the bus every time the bus arrives.
@johnwilliams7999
@johnwilliams7999 9 месяцев назад
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
@darius0501
@darius0501 9 месяцев назад
Man you sound like 3kliksphillip but on a technical subject, i like that :D
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
brits represent!
@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
@alexgo4081
@alexgo4081 9 месяцев назад
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? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2hXNd6x9sZs.html
@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!
@NickysMix
@NickysMix 3 месяца назад
I actually came back, because that product in the advertisement haunted me. I have to empower my data scientists with this. Thank you.
@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* ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.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.
@thekwoka4707
@thekwoka4707 9 месяцев назад
wow, drop....it makes total sense, but I assumed it did more explicitely
@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.
@zokalyx
@zokalyx 9 месяцев назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-s5S2Ed5T-dc.html
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
I LOVE Logan Smith's videos!
@Speykious
@Speykious 9 месяцев назад
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.
@yaksher
@yaksher 9 месяцев назад
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 месяцев назад
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 месяцев назад
​@@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 8 месяцев назад
@@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 8 месяцев назад
@@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 8 месяцев назад
@@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.
@cerulity32k
@cerulity32k 9 месяцев назад
"hey you know how languages are usually targetted for specific purposes?" "yeah" "you know how basically every language out there has null?" "yeah" "how about we just don't do that"
@yuverris
@yuverris 9 месяцев назад
what ? isn't checking for nulls what every sane dev does feels like rust's Option is just null with fancy layers
@cerulity32k
@cerulity32k 9 месяцев назад
@@yuverris Yeah, but None is a value, is explicit, cannot be implicitly coerced to Some (which causes NPEs in other languages), you must explicitly use unwrap, unwrap_or, expect, match, etc. which leads into another point, there are tons of added functions to handle Options and Results.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
I understand that people who haven't written rust think that, but people who have understand the genius of not having nulls in the language. My video explaining this is here, and I'd love your opinions on it ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sbVxq7nNtgo.html
@cerulity32k
@cerulity32k 9 месяцев назад
@@NoBoilerplate Oh, I'm fully appreciative of the lack of nullability. I just find it fantastic that Rust can be used to make anything from operating systems to browsers, and requiring everything to have a value is the best thing you can do from the start.
@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.
@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 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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-P4LMfkFLRsI.html
@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!)
@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.
@sasukesarutobi3862
@sasukesarutobi3862 8 месяцев назад
1:18 Ah yes, Jagger's Law.
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
A fellow philosopher I see!
@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!
@anotherone2398
@anotherone2398 9 месяцев назад
this is quality content , concise and informative
@ekids.bassment
@ekids.bassment 9 месяцев назад
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 RU-vid, I prefer a "podcast/audiobook" sound for my speech .
@CyReVolt
@CyReVolt 6 месяцев назад
so the drop semantics are /dev/null, genius 😮
@advanceringnewholder
@advanceringnewholder 9 месяцев назад
But can rust macro compile rust?
@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 RU-vid 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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oY0XwMOSzq4.html
@herpa77
@herpa77 8 месяцев назад
"there's so much more left foR US To discover" :D
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
ok that's clever!
@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.
@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! 🙂
@jlinkpro
@jlinkpro 8 месяцев назад
i would suggest that math is based upon logic, which in turn is based upon philosophy.
@robert36902
@robert36902 2 месяца назад
Thank you for this video! I'm already sold on Rust, but this helps reinforce that choice.
@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?
@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! :-)
@pillmuncher67
@pillmuncher67 9 месяцев назад
I kinda prefer parentheses to curly braces, if you catch my drift.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
(both you me)
@charliesumorok6765
@charliesumorok6765 9 месяцев назад
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 9 месяцев назад
When/where does rust assume this?
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
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 9 месяцев назад
@@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 9 месяцев назад
@@NoBoilerplate I don't expect LLVM to be able to remove the locks when they are not needed.
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
@@charliesumorok6765 it doesn't need to: Rust's conditional compilation trivially does what you want here
@gangov
@gangov 9 месяцев назад
man, I love your work
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
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
@InfiniteRain_
@InfiniteRain_ 9 месяцев назад
At 10:04, shouldn't the total amount of possible states be 8 * 8 * 1 instead of 8 + 8 + 1?
@InfiniteRain_
@InfiniteRain_ 9 месяцев назад
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 месяцев назад
@@InfiniteRain_ indeed, it's 8+8+1, hence why it's called "sum type"
@henrispriet9812
@henrispriet9812 9 месяцев назад
10:56 99% sure that the never type (!) is stable
@Speykious
@Speykious 9 месяцев назад
It is, but combining it with other types isn't. i.e. you cannot return something like Result
@henrispriet9812
@henrispriet9812 9 месяцев назад
@@Speykious Thanks I didn't know that. I commented because the example shown in the video is valid on stable.
@Light_Akira
@Light_Akira 7 месяцев назад
rust is the language of the future.
@spectator5144
@spectator5144 9 месяцев назад
fucking excellent video brother
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
THANK YOU!
@francisjudge1647
@francisjudge1647 8 месяцев назад
One up for the "hidden in plain sight" reference to the Hitchikers guide tothe Galaxy 🙂
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
LOVE H2G2! Half the references in my fiction podcast are from it! Have you seen it? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-p3bDE9kszMc.html
@francisjudge1647
@francisjudge1647 8 месяцев назад
Fore sure@@NoBoilerplate, I'm old enough to have read them when the books were released!
@NoBoilerplate
@NoBoilerplate 8 месяцев назад
@@francisjudge1647 what a time to be alive! I read them in the 90s 😀
@hassan-esabbah4913
@hassan-esabbah4913 9 месяцев назад
dude It's hard stop convincing me to learn rust
@NoBoilerplate
@NoBoilerplate 9 месяцев назад
do itttttt
Далее
Rust Data Modelling Without Classes
11:25
Просмотров 157 тыс.
Rust makes you feel like a GENIUS
10:48
Просмотров 397 тыс.
Я СКУФ!
06:12
Просмотров 1,1 млн
All Rust features explained
21:30
Просмотров 274 тыс.
Fast, Cheap, Healthy: Pick Three
8:58
Просмотров 56 тыс.
Statically Typed APIs with Poem and Rust
10:21
Просмотров 85 тыс.
Rust on Rails
11:34
Просмотров 129 тыс.
Why i think C++ is better than rust
32:48
Просмотров 261 тыс.
The Unreasonable Effectiveness Of Plain Text
14:37
Просмотров 568 тыс.
In Search of Code Purity
16:37
Просмотров 92 тыс.
Why JavaScript Devs are Switching to Rust in 2024
10:35
ADHD: A Left-handed Brain
19:36
Просмотров 106 тыс.