Hacker News new | ask | show | jobs
by hazz99 1483 days ago
I don’t think it’s true that any given “basic” design pattern should should necessarily be simple in every language.

Certain things are short and elegant in Rust. Certain things are short and elegant in Python. Each optimises for different things.

I also don’t believe it places “extraordinary complexity” on the shoulders of the programmer; this complexity is often a sign you’re doing something wrong, or working against the grain of what Rust is optimised for.

1 comments

Ok, what is wrong about the Rust solution given by the author of this article ? What is he doing wrong ?
They’re not doing anything wrong, but working with generics, traits and async code is very much against the grain of the 2018/2021 editions of Rust.

The async story hasn’t finished, and is definitely the area that needs most improvement in terms of developer experience. There are a number of gated features and RFCs that propose solutions to these problems (e.g. GATs), but they haven’t been moved into the core language yet.

That doesn’t mean Rust is inherently bad or difficult, only that we’re working with an early version. Rust is young! We didn’t have futures until 2019, iirc.

Lots of core Rust concepts (lifetimes, ownership, references) need to be rethought for how they fit into asynchronous programming, and how to make everything compose well together.