We're building libraries and tools in the Rust programming language!
The streams are intended for users who are already somewhat familiar with Rust, but who want to see something larger and more involved be built. You can see earlier related videos by looking at the playlists and uploads on this channel. I post about upcoming streams and ideas for new ones at discord.jonhoo.eu, as well as on Twitter, Mastodon, and LinkedIn! Q&A tends to happen using wewerewondering.com/.
You can sponsor my work at github.com/sponsors/jonhoo/.
The hope of this channel is to help serve the Rust 2018 Roadmap goal of better serving intermediate Rustaceans: blog.rust-lang.org/2018/03/12/roadmap.html#better-serving-intermediate-rustaceans
I was extending a bunch of handlers in my web server tonight, and was stuck with compiler errors that I couldn’t figure out. “Handler trait wasn’t satisfied”… I took a much needed break, poured a glass of wine, and watched some RU-vid. Eventually this video came up and I thought, what the heck, I’m working with Axum. Turns out 53:50 was exactly the solution to my problem. I’m passing in State, Path, and Json into my handlers and the order was wrong. Json was first and it needed to be last. Talk about some divine intervention. Thank you so much for these videos and all you do Jon! They are always a pleasure to watch, even when you aren’t bailing me out.
Hi Jon, your content is extremely superb for noobs. Could you please make a video of the latest Secrecy package. I see lots of improvements has been made to make Secret not cloneable and exposed in the memory, unlike previous versions. I ask this because perhaps a lot of people are going to be using it in their projects at work and hobby and might need help getting their head around.
8 months in rust, and I am finally understanding rust world better, rust has made me such a good programmer and has opened my eyes to a lot of programming pradigms, I am just so grateful! and grateful to you for uploading such content to help us be better!! thank you!
ok, but how does the rust compiler know what trait you are deriving? can't a derive macro just return arbitrary code that is appended after the item definition? or does this only apply to builtin derive macros? you can make a derive macro with any name you want...
Rust has been trying to solve the old programming dilema that back in the 90s JAVA promised to solve. I have used a numbers of programming languages and there is always one language I keep going back to and that language is C. The reason being that other than assembly language you can find a C compiler for it I almost all cases. Again I don’t think languages should be chosen solely on preference but availability and flexibility should be considered before starting any project
You're a great educator. Your videos remind me a lot about Ben Eater's, who I'd call the Bob Ross of Electronic Engineering. Your videos really helped introduce me to what I think is Intermediate Rust... though I'm not entirely sure, since I keep finding that Rust is deeper than I previously thought and finding out I'm still a beginner.
a couple neat tricks: +1 on writing wrappers on a type for certain cases. e.g. you have a function that takes i32's, but there's a property that's only true when passed positive numbers, you can do: struct PositiveI32(i32); fn my_prop(PositiveI32(n): PositiveI32) { ... } oracle testing (mentioned at the end) is very good if you're doing a rewrite, and need to maintain the behaviour of the old version
1:21:00 For "why do I need to impl Arbitrary for my types", I'm thinking: you don't! If your type doesn't have specific invariants, then define the prop with primitive arguments, and construct your type inside the property function.
Could we in theory write a property check function that returns a function that returns a bool? In the code for the Testable trait, the quickcheck library seems to call the prop function and check for success by running .result on the result of the prop function. Normally the result would just be bool, but since we have defined .result for Fn -> bool or something similar, could this work?
Thanks for the upload. 10:57. That property of operators is called it being an involutory operator: P^2=I (identity operator). Also if P^2=P then the operator is idempotent (e.g. a projection operator is idempotent: applying it more than once has no effect).
I started reading crafting interpreters in december 2023 and I've been working on my language off and on ever since. I've parted ways with Lox ever since I read that all nimbers are floats. Still it's super helpful to see you approach the challenge and see how you do things differently. It's also amazing to see you do something perfectly from the beginning that took me miltiple attempts to get right.
Not showing a website because it’s bright and “people don’t like that” is the STUPIDEST thing I’ve heard all week. At what point did we start caring about what some small group of small-minded people prefer when they’re watching videos at 3am?
I didn't realize just how informative the standard lib documentation was. You've inspired me to study the documentation for the entire Rust standard library. See y'all in about 4 months 🫡
At #2:00:34, what does it mean "whoever reads it first has it" talking about Receiver of mpsc? there is just one receiver, there is no second or third receiver.
3:08:52 Regarding inefficiency of processing data one by one with `mpsc` instead of doing it in batches (in a form of e.g. `Mutex<Vec<T>>`) I believe methods `mpsc::Receiver::recv_many` and `poll_recv_many` have been created to solve exactly this problem.
Looks like that's only on tokio channels, not std ones? Even so, those are helpful, but they only help with the acquisition cost - they don't let you do things like work compaction (eg, if a later update replaces an older one rather than add to it).
proptest is *destructively* obtuse -- it's very 'python testing' style -- adds a ton of oscurity and complciation and takes way more work and leaves you with something that is unobvious to maintain. I see what tehy're going for, but it's a bad model in most cases. QuickCheck is what's on the tin with straightforward ways to clean things up. QuickCheck is also inline with the idea of type based fuzing it ... fuzes the *type* by default. Not substructures within a type. -- PropTest has useful elements, but it adds more weight than value given that QuickCheck exists, in most cases imo
Okay what is going on in Japan and why are so many Tokyo workers running around grabbing futures. I just woke up and I'm half asleep and RU-vid autoplay this and I do not understand anything that is being said. Who is waking up Japanese poll workers and why?