Readit News logoReadit News
mre commented on Show HN: Apate API mocking/prototyping server and Rust unit test library   github.com/rustrum/apate... · Posted by u/rumatoest
mre · a month ago
We use httpmock [1] for lychee, and it works quite well. Haven't looked too closely at the differences yet.

[1] https://docs.rs/httpmock/latest/httpmock/

mre commented on Self-employed, self-exhausted   theisolationjournals.subs... · Posted by u/furk
Havoc · 7 months ago
So much fluff

Thank goodness for LLMs

>The author's core message is about breaking free from a lifelong pattern of tying self-worth to constant productivity and output, realizing that true creativity and well-being require intentional rest and "revery" (contemplation/dreaming), rather than relentless striving.

mre · 7 months ago
As a counterpoint, I quite enjoyed the writing style. Not everything has to be summarized. To me, it was more about the human experience.
mre commented on Domains I love   ahmedsaoudi.com/blog/doma... · Posted by u/ahmedfromtunis
mre · 9 months ago
My vote goes to .ws which redirects to a beer brand.
mre commented on Idiocracy   en.wikipedia.org/wiki/Idi... · Posted by u/zeristor
mre · 10 months ago
Recently watched Mickey 17 and it reminded me a bit of Idiocracy. Maybe someone is looking for related movies.
mre commented on Don't unwrap options: There are better ways (2024)   corrode.dev/blog/rust-opt... · Posted by u/mu0n
sophacles · 10 months ago
> My main gripe with this error message is that it doesn’t explain why the ? operator doesn’t work with Option in that case… just that it doesn’t.

The error in question:

> the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`

It literally tells you why it doesn't work, wtf do you want?

mre · 10 months ago
Fair point. Your wording was a bit strong, but I assume you meant well. I will update the article.
mre commented on Don't unwrap options: There are better ways (2024)   corrode.dev/blog/rust-opt... · Posted by u/mu0n
Ar-Curunir · 10 months ago
Really useful article to learn about idiomatic Rust :)

In general I think there is a lack of intermediate Rust material that teaches you common design patterns, idiomatic Rust, and so on.

Even I (someone who's written hundreds of thousands of fairly complex Rust code) learnt about the let-else style solution from this article =).

mre · 10 months ago
Author here; thanks! I had the same impression, which is why I started writing these short-form articles about idiomatic Rust. The blog post overview is here: https://corrode.dev/blog/
mre commented on Flattening Rust’s learning curve   corrode.dev/blog/flatteni... · Posted by u/birdculture
echelon · 10 months ago
100%. Newcomers still struggle a bit, especially if they've never used C/C++ before.

A good way to get people comfortable with the semantics of the language before the borrow checker is to encourage them to clone() strings and structs for a bit, even if the resulting code is not performant.

Once they dip their toes into threading and async, Arc<Lock<T>> is their friend, and interior mutability gives them some fun distractions while they absorb the more difficult concepts.

mre · 10 months ago
Do you mean `Arc<Mutex<T>>`? Yeah, I agree. Wrote a blog post on that topic as well: https://corrode.dev/blog/prototyping/ The title is a bit of a misnomer, but it's about beginner-friendly escape hatches in the language. Perhaps it's useful to newcomers.
mre commented on Flattening Rust’s learning curve   corrode.dev/blog/flatteni... · Posted by u/birdculture
woah · 10 months ago
Does anyone still have trouble learning Rust? I thought that was kind of a 2015 thing
mre · 10 months ago
The thing is, once you internalized the concepts (ownership, borrowing, lifetimes), it's very hard to remember what made it difficult in the first place. It's "curse of knowledge" in some sense.

What's changed since 2015 is that we ironed out some of the wrinkles in the language (non-lexical lifetimes, async) but the fundamental mental model shift required to think in terms of ownership is still a hurdle that trips up newcomers.

u/mre

KarmaCake day2032February 20, 2010View Original