2 ms·
> You can write very simple Rust Technically true, but only really true if you don't use many dependencies. At some point you're going to use some dependency t
by IshKebab 6y ago
> You can write very simple Rust
Technically true, but only really true if you don't use many dependencies. At some point you're going to use some dependency that uses async/await all over the place or really goes wild with generics and then it is definitely not simple.
Two examples:
* Heim (https://docs.rs/heim/0.0.11/heim/ https://docs.rs/heim/0.0.11/heim/) is a great crate for getting system info, but it only uses async/await so you are thrown into that rather painful world even if you don't need it.
* Plotters (https://github.com/38/plotters https://github.com/38/plotters) is a pretty great graph plotting library for Rust (the only one as far as I know), but they have definitely gone a bit overboard with the generics. Want to draw a scatter graph?
I tried simply calling `PointSeries::new()` and got a basically impossible-to-follow error about Rust not being able to infer the type `E` here:
https://github.com/38/plotters/blob/master/src/series/point_series.rs#L24 https://github.com/38/plotters/blob/master/src/series/point_...
Very simple it is not!
- moltonel3x 6y agoasync/await doesn't have to be painful: Slap a `#[tokio::main]` in front of your `main()` and a `.await` after your heim functions. Done.
- IshKebab 6y agoIn the most perfect of perfect situations that's all you need. In reality it isn't nearly as simple as that. There's been a lot of discussion about the pitfalls of async Rust recently, highlighting the issues. Here's a good one: https://tomaka.medium.com/a-look-back-at-asynchronous-rust-d54d63934a1c https://tomaka.medium.com/a-look-back-at-asynchronous-rust-d...