ERRATA - Wikipedia's got a great overview of Formal Methods: en.wikipedia.org/wiki/Formal_methods - 7:00 : typoe Cofigurable -> Configurable. - 9:04 typo: faddone -> addone
@raskr8137
8 ай бұрын
The quote at the end says "purerer" instead of "purer"
@ToranSharma
8 ай бұрын
5:41 should rstest be in the [dev-dependencies] section?
@Isaac-zy5do
8 ай бұрын
Coq has been renamed to rocq for obvious reasons. (If you're interested, thr new name is short for Rocquencourt, where the prover was first developed)
@NoBoilerplate
8 ай бұрын
ah, probably
@NoBoilerplate
8 ай бұрын
hehe yes, that's me being daft
@mattiasmartens9972
8 ай бұрын
"I am not sure if what you want is actually what will make you happy" is such a baller comment to leave on someone's technical question
@FrederikSchumacher
8 ай бұрын
You can't always get what you want But if you try sometimes you just might find You get what you need
@KoltPenny
8 ай бұрын
Your average SO answer.
@irlshrek
7 ай бұрын
thats some gandalf level shit
@kevinsmirnov264
7 ай бұрын
Especially when giving no more information
@oredaze
8 ай бұрын
"It's not C++, but better. It's haskell standing on lisps shoulders, hiding in C's coat to sneak into production" Ok, that is next level :D I love it. I am not a programmer (just like reading about it as a hobby), but you may make me start learning it for real with your videos and rust. Are you interested in making videos targeting beginners (using rust of course)? It would be an interesting idea/challenge to teach rust as first lang.
@NoBoilerplate
8 ай бұрын
Thank you! I already did: kzitem.info/news/bejne/pICq3KKbqX-HdIo
@BboyKeny
8 ай бұрын
Do it!! Programming is tons of fun.
@creativecraving
8 ай бұрын
Programming is empowering, and very fun if you like hard, structured things like RimWorld or Dwarf Fortress or Factorio. It can also be painful to learn and do at times. (You're always building new brain muscles.) Best of luck!
@Vingdoloras
8 ай бұрын
Love how this channel has turned into a huge ad for Rust. I've been reading about Rust from an outside perspective for years but always thought it'd be annoying/painful to get into. Your videos slowly warmed me up to the idea that this is not the case. Someone got me a physical copy of Crafting Interpreters for Christmas and I decided to pick up a new compiled language before I work through the book (the last compiled language I used was Java 8-9 around 10 years ago and I did not feel like going back to Java lol). Went through your entire Rust playlist during downtime between festivity-related business and started working through the rust book, one chapter a day. It's been a blast so far!
@NoBoilerplate
8 ай бұрын
Wonderful! yes, I'm desperate to tell people about this incredible language because it's so *chill* to code in, I don't write... BUGS!
@creativecraving
7 ай бұрын
Speaking as a relative newbie, you'll want to have tight integration between rust and your IDE, so you can proactively respond to error messages, at least until you instinctively learn the rust idioms. VSCode does this okay with minimal setup. The type system makes a very strong contract with your code, so I find myself twiddling function signatures a lot to change the contract to allow me to add the behavior I need. This is more rewarding than debugging, but is a big time-sink in the beginning. Occasionally, I realize I'm not smart enough to express what I want in the type system, so I have to move on to a different strategy. I recommend learning about type aliases early on, as they can help save typing when you're repeating a long type annotation and need to tweak it. Also, Rust a lot easier to learn if you already know Haskell. Then, all you have to learn are lifetimes and borrows + syntactic differences. You don't have to learn to build or understand macros upfront, although you'll probably use a few. Just treat them like the annotations and typeless functions from other languages at the start. That mental model is working okay so far. Coming from an OO language, you'll find several new things: composition used in place of inheritance; new and powerful kinds of polymorphism; sum types (enums); enums used instead of null (Option/Result); traits instead of interfaces.
@axelcool1234
7 ай бұрын
What a coincidence! I've started to read the Rust book as I plan to tackle the Crafting Interpreters book with Rust!
@em_the_bee
4 ай бұрын
And why exactly do you love it?.. Are you that much in need of someone confirming your point of view that all the kilotons of Rust ads out there are not enough for you?
@Vingdoloras
4 ай бұрын
@@em_the_bee Are you getting angry about a comment I made months ago on a video? Wow! Maybe read more than the first sentence of a comment before replying with passive aggressive questions, though. The second and third sentence of my comment answer your question and point out that what you're trying to complain about is not what's happening.
@Turalcar
8 ай бұрын
7:11 probably the best description of function purity (and encapsulation in general) and why it's good
@NoBoilerplate
8 ай бұрын
thank you so much!
@ItsVasl
8 ай бұрын
Such possitiveness, you are a stress relief! A big fan of lost terminal as well btw:)
@NoBoilerplate
8 ай бұрын
Thank you so much!
@codetothemoon
8 ай бұрын
“…Production, the popular night club where all the popular languages hang out” - 😂 amazing
@N....
8 ай бұрын
It's nice to see C++'s constexpr being brought to life in Rust as well, that's really cool as it has many of the same benefits in both languages. Being able to easily see a function has no side effects just from glancing for that `const` is really useful.
@scion911
8 ай бұрын
Hi tris, a random viewer here with a take... This seems very similar to c++ consteval/constexpr, and zig comptime functions. In c++ consteval/constexpr is very strict scope like in rust although comparably less strict, it allows arithmetic on Floats etc. but rest are pretty similar. To me it just seems very similar in terms of purity, one of my tricks when writing a pure function in c++ is to just slap a constexpr at it and see if the code compiles...
@sebred
8 ай бұрын
I am a fan of formal methods and rust has so much to offer in that area. One of the most interesting things for me is how the compiler has so much information about the code that some very interesting optimisations become available. And while most of my more esoteric projects in rust eventually end in me bemoaning the absence of dependent types (const generics are not enought) the rest of the time I am quite glad that I do not have to depend on somebody doing very elaborate type shenaningans.
@xore_1798
8 ай бұрын
Man your video's are hella motivating. You're an inspiration, keep up the good work!
@NoBoilerplate
8 ай бұрын
Thank you!
@linkernick5379
8 ай бұрын
I have made the transition from Haskell to Rust too, for me the main reason was the lack of control over inner runtime "gears" that made really hard the performance tuning. I liked pretty much the monads and the type system though.
@CalifornianViking
8 ай бұрын
I love the perspective you bring to programming. You are like the carpenter who is also a philosopher. You understand the practicality while putting it in the context of the meaning of life. One commenter says that the channel is an ad for Rust. I disagree with this comment. I am confident that you will call out the things you do not like, and I don't believe you are paid.
@june_m12
8 ай бұрын
Great video! I have spoken with my friends (one of whom is a Haskell enthusiast) about purity several times in the past, and kept coming back to const fns. It is kind of disappointing how limited they are, but I came to the same realization that due to the borrow checker, I really don't *need* a purity system. If a function takes in no mutable parameters, I can be reasonably sure it's not going to have any side effects *that matter to my code*.
@NoBoilerplate
8 ай бұрын
You've got it exactly. Also, we don't need Rust to be Haskell, we've already got Haskell! We need something that brings MOST of Haskell's features to the masses, and that's Rust
@Randych
8 ай бұрын
@@NoBoilerplate imo if that was your message, then const fns is very far from something that I'd call best for showcasing this
@SimonClarkstone
8 ай бұрын
0:40 Now I have that tune in my head.
@rahul38474
8 ай бұрын
I feel like Zig also incorporates concepts of pure functions through the compile time evaluation. Functions that run at comptime cannot have any runtime side effects. The compiler caches the call of the function, so calling a function with the same inputs at comptime will be guaranteed to produce the same result. It also doesn’t have many of the limitations of Rust const fn. You can have any loop you want (and even inline the loops too, if the bounds are compile time known). Additionally, you can assert and compileError or panic to stop the compiler. And since some comptime functions can also run at runtime, you can keep the purity of the function too (only it won’t be guaranteed unless you run the function at compile time first to verify).
@scion911
8 ай бұрын
I see zig comptime more comparable to c++ consteval/constexpr it's more of a compile time execution for a function (I absolutely love it, I use them as primary design for 2 of my major projects). But I doubt they are similar to rust const fn... For example floating point operations are allowed.
@KawaiiNiko
2 ай бұрын
I’m really early in my programming journey, and I don’t really understand a lot of these videos, but I still love listening along. Thank you so much for these videos Tris.
@jonnyso1
8 ай бұрын
Rust has so many well thought little design decisions that add up without you noticing that when I work on other languages I can't put my finger on it but it always feels like something is missing.
@littlecurrybread
8 ай бұрын
yes! Absolutely. In games there's a term called game feel, it's a bunch of little decisions that add up and elevate a game for the user. There's a similar thing I experience using rust.
@redreality6940
8 ай бұрын
I'd love to see you talk Nim more. I've started using it recently and it seems like the Leonarod Da Vinci of programming languages, defying conventional wisdom by doing so many things and doing them so well. Combining the features from other languages that are normally really the main reason people use them (pythons simple syntax, C's low level performance, C++'s versatility) It might become the "anti-rust" competitor language.
@pik910
8 ай бұрын
Its creator is what I'd call a religious fascist who has called for violence on various occasions and believes there is some queer dystopian conspiracy. This personality reflects in conflicts inside the project and management style and pretty much assures that the language is going to stay obscure. There are many great ideas in nim but the language is not perfect and will probably get eaten up by the next language that figures that developer experience and performance are both important. As well as marketing and community building. Maybe mojo.
@janAkaliKilo
7 ай бұрын
@@pik910 What? I'm relatively new to Nim community and I have no idea who you're talking about.. Yes, Araq has some conservative views, but calling him fascist has absolutely no bearing with reality. "This personality reflects in conflicts inside the project and management style" - my impression is totally opposite, Araq can be grumpy and harsh in words, but he's also not the last to apologize and admit his mistakes and flaws. P.S. regarding "queer dystopian conspiracy" - he's not far off if we're talking about modern social-political discuss in and around US, but that's totally off-topic =).
@logicaestrex2278
3 ай бұрын
@@janAkaliKilo same, i love the community. i hate how slanderous certain political groups are, calling everyone hateful and fascist and a whole set of buzzwords because they dont go along with their ideas. regardless, hope your having fun with nim too :p
@okie9025
8 ай бұрын
4:30 could you explain the "garbage collector" part for Nim? I'm not a Nim user, but don't all of the languages on the list except Rust use a garbage collector? Why is Nim's garbage collector emphasized here?
@janAkaliKilo
8 ай бұрын
I also don't understand. Nim is also, probably, had one of the best GCs from that list: fast, deterministic, low-overhead, no 'StopTheWorld', memory safe, thread local. But it's definitely not an issue now with ARC/ORC being default in 2.0.
@djazz0
8 ай бұрын
4:21 Nim is my go to these days. So much fun to code microcontrollers in. Not sure how having memory management is a downside? Sure it’s a bit obscure, and the stdlib needs work. I don’t use the stdlib for embedded anyway.
@Nellak2011
8 ай бұрын
I tgought this same exact question when searching for a Full Stack JS replacement. I am completely done with stupid preventable bugs with JS, so I am moving to greener pastures. Front End -> ReScript Back End -> Rust or Elixir
@NoBoilerplate
8 ай бұрын
oh ho ho, you should try leptos.dev
@randomthings1553
8 ай бұрын
Depending on what you do with elixir you don’t even need the front end you can use the liveview
@Nellak2011
8 ай бұрын
@@randomthings1553 I know Elixir is great, however, Phoenix has limited React support.
@Skerathh
8 ай бұрын
This channel inspired me to cover Rust in my upcoming bachelor's thesis (somehow, I haven't figured out yet what practical topic I could cover as I have to be very specific with things). I really want to see it get adopted more.
@esra_erimez
8 ай бұрын
4:48 "crushing march of efficiency" "too practical" some of the reason that I absolutely *love* Go.
@laundmo
8 ай бұрын
except it sacrifices so much in the name of "practicality" that it loops back to being a hindrance
@NoBoilerplate
8 ай бұрын
Why doesn't go.dev have syntax highlighting?
@Randych
8 ай бұрын
congratulations and condolences on loving the beaver
@trevorroddy3773
8 ай бұрын
loved haskell in school and am now two weeks into learning Rust, again your video has been perfectly timed. excellent!
@NoBoilerplate
8 ай бұрын
wonderful!
@smarterlife7331
Ай бұрын
Hi dear @NoBoilerPlate. When I first heard about Rust, I was very excited, I started researching more, watched most of you videos (but not this one up until now), started learning and programming in rust, but then along the way, I was leaning towards C, as it is such a pure language, without any bloat, it is it is like a transparent, beautiful, sharpest knife you will ever see. Yes, it has some boilerplate, yes it has dangerous memory management, yes you need to do a lot more coding, yes it lacks modernity and tools, but man.. so beautiful language the C is..... Now watching this video of you, I am confused again... Please enlight me with one, beautiful comment that will make me jump to the Rust ship and never look back... Thanks in advance...
@TRK--xk7bb
8 ай бұрын
"I was going to have to act, if I wanted to live in a different world" - why does a banger song started playing in my head after hearing that?
@teometz7838
8 ай бұрын
Your comments about Go got me so curious. You say: it's too practical and efficient, no beauty in it but not in terms of syntax, and yet it almost worked for you. I would love it if you could expand on what you mean with all of that?
@be1tube
8 ай бұрын
Unfortunately, neither Haskell nor Rust has a version of "purity" that allows you to guarantee that a subset of the code will not crash/panic at runtime. This was my biggest disappointment with Haskell.
@AK-vx4dy
8 ай бұрын
Your conclusions are so unconvetional but the same so practical. Never stop to be amazing !
@Jonathanlouisa
8 ай бұрын
I got into coding last year in April. I started with The Odin project and I loved it. I learned the MERN stack. I jump to ruby and ruby on Rails, which is pretty nice, but I discovered my dislike for implicitly typed languages. I looked at Python but I didn't get any tingles and then I learned Rust and again I discovered something new about myself, I discovered my dislike for weak typed languages. I absolutely adore Rust, but as I'm planning on building a PAAS on a timeline, I still have to go with something like Ruby on Rails or NextJS as a team of two newby devs. Feels bad man...
@avidrucker
8 ай бұрын
Best of luck to you!
@Jonathanlouisa
8 ай бұрын
ty@@avidrucker
@ojasmishra3487
8 ай бұрын
I want a formal programming language that disallows stack allocations because moving rsp is a side effect.
@NoBoilerplate
8 ай бұрын
I mean, that's kinda rust const functions!
@aakarshanraj1176
8 ай бұрын
even better, i want a programming language that disallows changing rip register
@Ketsur0n
8 ай бұрын
Hey mister no boilerplate I started following you some months ago your videos on time management and such really helped me out ❤ thank you
@Nimward
8 ай бұрын
Happy to see more Rust videos. I've watched every video, some multiple times. Re Nim, I've been publishing a series of videos exploring the language by writing an interpreter in it. For anyone interested in Nim, you might enjoy and I appreciate any feedback.
@angeldude101
8 ай бұрын
I'm always unsure whether to consider &mut parameters to be "pure" or not. In one sense, they're obviously being mutated outside of the return value, but in another, the fact that it's explicitly marked means that you can basically just treat it as an explicit return value with more ergonomic syntax and more efficient performance. At least, this is at the function definition site. On the caller's side, it's less clear when a method call would mutate its receiver. The lack of printing in const fn is probably my single biggest concern about them, since it's extremely useful to know the actual value that the function is being passed so that you can better determine what exactly you're supposed to block and how. Without knowing the actual type you should use or what preconditions have seemingly been forgotten, and without being able to just print out the value that shouldn't've made it through, the only remaining options are to either remove the const flag, or use a debugger to be able to effectively insert extra print points ad-hoc. I'm pretty sure several pure functional languages have impure escape hatches specifically for printf debugging (even if laziness means they're not as useful as they'd be in a strict language). There's also the matter of const traits still being unstable, so if you have a pure function that you want to make generic over a particular (presumably pure) trait, you can't actually mark it as const quite yet.
@piotrfila3684
8 ай бұрын
I agree, I don't see how &mut could cause problems here, as only one mutable reference can exist at a time. They are also very useful, I use them to compute FFTs at compile time (unfortunately requires nightly compiler for now). Printing could be considered pure if it's write-only from the point of view of the code - even though it's mutating global state it can't have any side effects if no function is allowed to read the log. Maybe for now we could have a macro that appends a message to a file instead of printing?
@loupax
8 ай бұрын
I love the description you gave to Go, especially because it’s not a compliment. I know it’s completely counter intuitive but I get a strong feeling of PHP when I work in Go, and I can’t put my finger on why.
@AkilManivannan
8 ай бұрын
I tried Rust and had some fun before giving up since I found it too slow to write with, but after seeing so many of your videos, I'm going to dive back in and try again 😅
@laundmo
8 ай бұрын
it takes much longer than other languages to reach a proficiency where you're fast. but it saves a lot of time in other areas like debugging of complec problems.
@NoBoilerplate
8 ай бұрын
It's only slow using your old coding techniques and habits. If you code, compile, test, look at an error and try to guess what's wrong, it'll certainly be slower! But with rust you can code faster by using what I think of as "Compiler Driven Development", using clippy to give you incredible feedback, before you even run your code! kzitem.info/news/bejne/pICq3KKbqX-HdIo
@iilugs
8 ай бұрын
Food in a plate, tea in a mug, warm slippers and a No Boilerplate video..... can life get any better?
@Mohammed24441
7 ай бұрын
Aren't formal methods used to specify systems/applications before even getting to the coding part? That's where they come in useful cause they enforce reasoning about the What before starting implementing/code the How. That's the beauty of formal methods where they help formulate the Functional Requirements into a formula that is hard to misunderstand before finally, a programmer translates the requirement into code. You even get to run and test the specifications using model checkers to validate before moving forward to the coding aspect.
@kellybmackenzie
7 ай бұрын
I adore Haskell so much and this video makes me so happy! I love it!
@Sakurina
8 ай бұрын
Not a Rust developer, but I have watched all the videos on the channel so I’m not sure if I’m missing something… if the Rust macro runs at compile time, would that imply that the PATH from the macro version would be the PATH environment variable of the machine that built the code, and not the one running the code? They seem to be presented as equivalent in the video, but I don’t get it unless you force the user to build on whatever machine they are deploying to or if I’m missing something else.
@laundmo
8 ай бұрын
const functions can run at compile time too. if you could call the env method in a const context, it would be the same as the macro. but you can't. so you use env!() for the compiling machine and env() for the running one
@ChristopherVogt1
8 ай бұрын
Over my 5 years as a Haskell developer in industry I found Haskell no hassle, but a joy to use for just about any programming tasks. Web services, API clients, html and code generation, writing cli tools, servers, web sockets, parsers, interfacing with OpenGL all work quite straight forwardly and quite elegantly. There is a tough initial learning curve doing pure fp and monadic IO, which seems to deter many people. But once through it, it does no longer get in the way and I did not find there to be a compromise necessary. What Haskell really suffers from is that it only has a small community like Python in the early 2000s. There are fewer library and dev tooling choices and some struggle with maintenance. That said eventhough Haskell has much more effective safety than main stream languages, it is still quite limited in what is practical to prove. Maybe that's why what is there right now does IMHO not have the practical problems No Boilerplate seems to suspect.
@laundmo
8 ай бұрын
Really liked this video. very clear and well reasoned, and about a topic which hasnt gotte enough love!
@NoBoilerplate
8 ай бұрын
Thank you so much Laund, and thank you for your help!
@Speykious
8 ай бұрын
Agreed
@thomasfrans1185
8 ай бұрын
I love the quotes in these videos. They capture the idea of Rust so well.
@Pikrass
8 ай бұрын
One big reason you probably shouldn't make all possible functions const, most notably if you're writing a library: turning a const function into a non-const one is a breaking change, since your users won't be able to use it in their const functions anymore. So adding the "const" keyword should not be automatic: you have to think about whether you could need non-pure stuff in your implementation in the future (including loops etc).
@edgeeffect
7 ай бұрын
"Haskel standing on LISP's shoulders, hiding in C's raincoat trying to sneak into production" needs to be made into a cartoon!!!!
@franklinyiu1770
8 ай бұрын
Does C++ get the same effect as Rust's const with constexpr? If not all the way, does it at least get most of the benefits?
@sambroderick5156
8 ай бұрын
One of your best so far. Bit dense but invites deep thought.
@szyszak
8 ай бұрын
"we are going to have to act, if we want to live in a different world" - oh, that sudden urge to blast C&C OST during my next coding session
@kinomonogatari
8 ай бұрын
Woah these reminded me of Fortran's pure subroutines and functions.
@NoBoilerplate
8 ай бұрын
easy to do in a simple language, imagine doing that in a language that runs in the browser ;-)
@kinomonogatari
8 ай бұрын
@@NoBoilerplate Haha fair enough. Glad I chose to be a physicist instead.
@TheSast
8 ай бұрын
What are your favourite clippy (or rustc) lints? especially allow-by-default that you'd like to be warn by default, or perhaps even deny or forbid.
@NoBoilerplate
8 ай бұрын
they're in this video!
@TheSast
8 ай бұрын
@@NoBoilerplate I couldn't be sure you didn't hide a few more XD Recently I've been on a kind of clippy addiction, went and tried to make as many lints work together as possible just for the fun of it, I ended up discovering quite a few that I like. The most memorable ones for me must be: - infinite_loop = "forbid", I think this should just be considered a compilatiom error, as `!` should not coerce into `()`, it can make it quite hard to predict the behaviour of a function, especially game loop related ones, for the same reasin I wish `Result>` should be mandatory over `dyn Box` in fallible loops. - allow_attributes = "forbid", I see no reason not to use `allow` over `expect` if `lint_reasons` is enabled. - mod_module_files = "deny", this naming scheme can make traversal via file finders quite difficult - non_ascii_idents = "deny", without it it can be hard to understand contributioms on an open project with devs who speak different primary languages.
@Randych
8 ай бұрын
#[deny(unwrap_used)] #[deny(expect_used)] 😐
@alexxx4434
8 ай бұрын
'Rust is pure, unless when it's not.'
@Felipe-53
8 ай бұрын
You are a very inspirational person! Your work is awesome! Thanks!
@NoBoilerplate
8 ай бұрын
Thank you so much! I'm hoping to help as many folks as I can (and I'm learning a lot in the process!)
@user-hk3ej4hk7m
8 ай бұрын
Reminds me of what c++ is doing with constexpr functions
@schrenk-d
8 ай бұрын
So interesting. I'd imagine the allowing the macro system in const fn's could possibly get a little bit messy when it comes to cross compiling. I'll have to experiment.
@williamtlittle
8 ай бұрын
Maybe I'm missing the point or misunderstanding in general, but const sounds like it has nothing to do with maintaining program state. In C++ I use const to express that the function doesn't modify the data coming in or the state of the object the function is a member of, or return values which I don't want the caller to mess with but don't want to necessarily copy. It sounds like in rust that const is more of a purity checker than a constness checker. Not allowing floating point operations is a specific example that would drive me crazy. I want to add two numbers together but I can't, not because it will modify state, but because it could return different values on different systems. It seems like there should be a const annotation for functions to accomplish what I said before, but a purity annotation should be separate. I'd be very interested to hear if I'm mistaken in any way in my analysis here.
@doce3609
8 ай бұрын
Thank you to introducing me to this clippy option. I love it
@ajs1998
8 ай бұрын
I think Lean 4 is the closest thing to a perfect language for me. If it's good enough to prove the most complicated theorems in math, then it's good enough to prove simpler practical things. It's just so clean and powerful
@laundmo
8 ай бұрын
hmm, whats the progress on its ecosystem like? is it general purpose enough to cover various topics from graphics, ui, web, api etc?
@ajs1998
8 ай бұрын
@@laundmo it's still very new and focused on mathematics built by mathematicians. But I have no doubt you can extend it to do whatever you want a programming language to do. In fact the former executive director (David Thrane Christiansen) of the Haskell Foundation recently moved to doing research for Lean, and just yesterday demo'd his markdown-like syntax in Lean used to generate documentation. I wish I could fast forward a few years to see what Lean is capable of, it seems very promising to me
@NoBoilerplate
8 ай бұрын
Oh nice, I'll check it out too. Note: I'm not here raving about Rust because I think it's the best language, I'm here raving about rust because I can get paid to write *nearly* the best language :-D
@cpl.226
8 ай бұрын
Lean is a proof assistant, not a general purpose programming language. Dependent types are great for encoding fiber bundles and what have you, but several languages that employ dependent types have failed to gain any sort of mainstream traction as they are simply far too complicated and cumbersome for any sort of practical program that isn’t written by PhD students.
@leftaroundabout
8 ай бұрын
Considering you say you adore Haskell, I find it quite disappointing that you would say something like "Haskell is too complicated for general programming". As someone who spends about half my coding in Python in Haskell, I find Haskell _far less complicated_ to use in actual practice. Not just because of all the hard-to-find bugs it avoids, but also because working with different monads (and the proper syntactic support for this) is an awesome way to keep nitty-gritty details hidden and thus focus on the actual interesting parts of whatever you're working on in the moment. The one thing Haskell honestly sucks at is controlling memory usage, so that's where I'll admit Rust as superior. But I'll also say that Rust actually has a rather more weirdnesses that make it awkward for everyday use.
@huantian
8 ай бұрын
Nim mentioned! But seriously, I do think Nim has a place here. It stands in the middle of that Venn diagram you show, but leans more toward the practical side, whereas rust leans a bit more to the provable side. Both are great and have their place I’d say. Nim is held back by its obscurity, but I believe that it will continue to grow and will be a great option one day.
@meanmole3212
8 ай бұрын
That C&C reference short circuted by hungover brain
@jacrease8880
8 ай бұрын
these videos are what got me into rust and i love it
@NoBoilerplate
8 ай бұрын
wonderful, thank you!
@ridwanulhaque5299
7 ай бұрын
I am new to programming, do not undestand so much details, but there is a language called zig that is claiming to be rust killer. can you make a video about it if it actually is better than rust or not?
@tobiasjennerjahn8659
8 ай бұрын
How did you make the venn diagram of sound formal languages and practical programming languages? The circles have some imperfections, which makes it look like they were drawn by hand, but they are much more circular than I could do by hand.
@laundmo
8 ай бұрын
its likely something with a handdrawn theme. i think excalidraw has that?
@NoBoilerplate
8 ай бұрын
Excalidraw plugin for Obsidian :-)
@patrickmwangi7918
8 ай бұрын
"Beauty is in the eye of the binary holder" 😄
@dittilio
8 ай бұрын
I'm a dilettante of the Nth degree, I'm hoping someone here might help me. I'm getting the impression that in this age of new frameworks, tools, flavours being released every week, that taking the time to "master" Rust🦀, might well be worth it. Perhaps not as my primary language in the office, but one that I can turn to when I need to build something for a system that will need to run for years, not months. I hate updating/redoing code to bring it back into alignment because someone decided that a prettier font meant a dependency broke, which now causes an intermittent fault on future builds. I just want to write code, that solves the problem, and will always solve that problem in future. Is Rust something that will let me do that?
@DrThalnos
8 ай бұрын
I know it is not very new, but FORTRAN has the explicit decleration of pure functions and subroutine and is very low level
@NoBoilerplate
8 ай бұрын
If you have no other systems to handle side-effects and mutation, tagging whole functions as pure isn't a bad idea. Rust has a much more nuanced way of doing things :-)
@sungwonchung
8 ай бұрын
You're the reason I'm learning rust!
@NoBoilerplate
8 ай бұрын
WONDERFUL! You're going to have a really great time!
@skytech2501
8 ай бұрын
Finally! Waited so long for Rust treat😂
@NoBoilerplate
8 ай бұрын
ikr!
@danielrhouck
8 ай бұрын
So const functions are better than they were when I first looked into them, but still not up to the C++ constexpr standard. I’m not sure they’ll get there, either, with C++ sometimes allowing non-pure constexpr in controlled circumstances, but they can at least get most of the benefit.
@danielrhouck
8 ай бұрын
Wait, I completely missed the macro escape hatch when I checked before, so now I don’t think either is strictly more powerful. I like C++’s focus on moving as much code as possible to compile time (which is why it can do impure functions under different specially controlled circumstances); does Rust have a subset of const functions for “no I mean it, make this compile-time capable”?
@kira.herself
8 ай бұрын
gosh I love your videos, none are like yours also rayon is already 9 years old whoa whaa
@coolkattcoder
8 ай бұрын
It would be nice to have a compile time function type or something. As sometimes having code that could differ based on the processor is ok. For example I might want to do some matrix math which could involve sin and cos for rotation, and save the result to a const variable. Let us say the worst thing happens, and somehow we have a 90 degree difference between a runtime rotated object, and a compile time rotated object. It won't matter for game development, because the player would never know what rotation was intended unless they check the code. Perhaps it would be nice to have some sort of unconst block that alllows running non-const functions in a const function, when it is known that bad things won't happen. Edit: Just got to the macro part of the vid, I had no idea that macros could do that, I'm going to quickly mess around with trig functions in macros, and see what happens. I may delete this comment if macros are good enough!!! Update to the Previous Edit: Perhaps with proc macros it might be possible (but they are even more inconvenient than build scripts)! However with regular macros I don't see how this would be possible.
@killingtimeitself
8 ай бұрын
as someone who doesnt actively program (but really should) these deep dives into structures surrounding the languages puts them into perspective nicely. Now i somewhat understand why people like rust, as opposed to, knowing that people like rust.
@audreyannblakely4713
5 ай бұрын
“Beauty is in the eye of the binary holder” put that on a tshirt
@pancakedrivet
8 ай бұрын
Hey Tris, thanks for another great video. It once again comes as I'm reasoning through something similar with some side project rust code. I have a struct of state that I use throughout a program, and I've been iteratively making the things that update it smaller and easier to reason about. I didn't realise that what I was doing was making my methods more functionally pure, but now I have a reason to lean in even further! The only thing that I didn't quite get (maybe I just need to read around it some more) but I see what we can and can't do with `const fn`, but I didn't really understand why we would want to opt in to them, given that we are wilfully limiting ourselves to what const funds are able to do, versus "being good citizens" with limiting side effects in regular functions?
@dpcxx
8 ай бұрын
There is a language that wants to be born that is like Rust (allow mutability and references), but uses capability-system like features to guarantees that if a file-system capability wasn't passed to a certain objects/code, they will not be able to touch the file system, etc. . Basically - language prevents action at the distance - any code can be much easier reasoned about what can it do, even if buggy/malicious. In such language `unsafe` would be a capability itself. This would improve by a lot real life composability of software, which is currently limited by the matter of trust (no one has time to review all the ever-updated code of your dependencies).
@0LoneTech
8 ай бұрын
I've seen a few attempts, but the closest that springs to mind is Haskell. Specifically, Safe Haskell with the ability to restrict and trust specific modules, and particularly how Haskell code can be inferred safe. I'm not so sure about Rust, since I found you could do things like global inline assembly to produce link level side effects without using the unsafe keyword. The feature is known as an effect system.
@MixturaLife
7 ай бұрын
Got Tom Scott vibes from this video and I like it )
@JonathanPlasse
8 ай бұрын
Awesome video, thank you!
@AndrewBrownK
8 ай бұрын
I've been wondering how someone might make a third-party plugin market for a game. How can you be sure the third party plugins won't be malicious? Assuming we take in the plugin source code and compile it ourselves, but may not actually be able to read and vet it with human eyeballs. Maybe const functions can be an ingredient in the API to avoid unwanted action.
@laundmo
8 ай бұрын
i believe a better option could be running plugins as WASM which you can give a limited API to interact with the game
@hwndept
8 ай бұрын
Love your videos! Keep it up!
@NoBoilerplate
8 ай бұрын
thank you, I will!
@Udinanon
8 ай бұрын
Where would you pint someone to to learn mode about formal methods? My university did not cover them at all in my studies, although we did some proofs of algorithms' correctness and performance, this was all on paper and pure logic Especially something that covers not just the mathematical and logical background to understand these systems thoroughly, but some examples of languages and applications
@nekomakhea9440
8 ай бұрын
The efficiency-at-all-costs description of Go makes me think of depression-inducing soviet brutalist architecture, but in programming language form...
@gljames24
8 ай бұрын
I wish you could make a const fn with floating point arithmetic in std. It would make my color library so much better.
@IoraTera
8 ай бұрын
Is this related to zero knowledge proofs?
@sanjeebsubedi2826
Ай бұрын
It would be great if you had a rust course as well.
@JUMPINGxxJEFF
8 ай бұрын
I enjoyed that content
@WizardOfArc
8 ай бұрын
I did Haskell before Scala
@otaviocv
8 ай бұрын
Did you work at Nu?
@asdf8asdf8asdf8asdf
8 ай бұрын
Is one of the many values of Rust the fact that you can write correct programs and you never ever have to analyze your program with something like TLA+ to find out horrific edge cases? ( I don’t think so, but wud love to hear your thoughts about the intersection and value there…)
@CorrectMyGrammarPls
8 ай бұрын
Yes, it is, kindof, there is what i would call "correct" and "incorrect" rust (not very descriptive term but whatever), "correct" rust would never use unwrap, any kind of panic, indexing to vectors instead o using .get() (unless you are sure the index exists) or any discouraged functions, why are they there then if you arent suposeed to use them? For faster development and learning, if you are learning rust then just use unwrap and lear the other things as you go, if you do know rust you will use unwrap when you do not yet know how you will handle erros/none values, but then replace them, same with the rest of the discouraged stuff, use them to kickstart the project then replace them unless you are 100% sure it will never error
@kenzo3477
8 ай бұрын
Hi Tris, would you mind sharing a cool rust project idea?
@DerSolinski
8 ай бұрын
Hey Tris, I started a discussion on the Rust internals forum to expand enum functionality. Would love your input on that matter. Cheers.
@NoBoilerplate
8 ай бұрын
I'll have a look, cheers!
@Sashin9000
8 ай бұрын
I've never heard of const functions, are they new to Rust?
@laundmo
8 ай бұрын
no, just criminally underutilised
@markinatorina
8 ай бұрын
"I was going to have to act if I wanted to live in a different world." Act on instinct?
@NoBoilerplate
8 ай бұрын
SPACE!
@xescure
8 ай бұрын
I think you’d like Nix and NixOS!
@fontanemmanuel
8 ай бұрын
This is the way.
@kenneth_romero
8 ай бұрын
You know i always thought of rust as oCaml but heavy c style.
@ilyakooo0
3 ай бұрын
Thank you
@jjpp1993
8 ай бұрын
did you work at nubank??!?!
@NoBoilerplate
8 ай бұрын
no, kroo.com
@meowsqueak
8 ай бұрын
“Purerer” - intentional?
@RepChris
8 ай бұрын
For all the aspiring watches who think its ought to be possible to have proper verification (on a useful programming language) without any compromises, it isnt. In fact it isnt possible to have proper verifications for proper (Turing complete) languages at all. It is mathematically proven to be impossible. Every piece of code that is formally verifiable is so because its essentially kneecapped to allow verification, either in terms of a specific subset of the language you might see in Rust, or the entire language like you might see in the ones designed for "can not, ever, ever fail or someone will die" applications. This follows from Rice's Theorem. Not to say to try and make coding verifiable programms shouldnt be made easier, but if you want to be able to almost all of the stuff you can, youre going to have to make some compromises somewhere. A system like what Rust has, encapsulating those parts that could cause issues, is going to be the best bet to keep the advantages of those compromises as much as possible
Пікірлер: 433