7

rust is just ugly

Comments
  • 2
    no stack traces for errors, for a language obsessed with "errors"
  • 1
    I don't use imperative languages that require semicolons. Period. No exceptions.
  • 1
    There's programming languages that everyone could use to make job done quickly and there's that user needs to fully understand to use properly.
  • 2
    Why are you using it then? It seems to make you miserable.
  • 1
    It really isn't. It's actually quite beautiful
  • 3
    Responding to a few points:

    * Capturing stack traces is very expensive to do for every constructed error value, which are used for lots of things besides "bubble error up". Though nothing is stopping you from using anyhow or other crates which capture stack traces for their error types

    * Early returns work just fine, and ifs are just expressions

    * Sync and Async are not comparable in the least. Async functions/blocks construct a stackless state machine of all state needed between await points across all futures so that you can run a future with one perfectly sized allocation (or no allocation at all on embeded!)

    * You sure can have Options/Results both inside and outside of futures. Future<Result<Foo, Err>> are fallible futures and Option<Future<Foo>> is perfectly valid too

    Though I'm not surprised you are so frustrated considering you started learning Rust with async, which is arguably one of the hardest parts of the language and definitely not something for beginners
  • 0
    @retoor Rust does have backtraces, even pretty cool lazy backtraces which are quite a bit faster! Just not by default for every Result::Err value
  • 0
    @retoor Fair enough :D

    It's always a compromise between user friendliness and expressive power
  • 1
    @jestdotty Yeah async is pretty tricky in Rust and not necessarily the most beautiful thing, but it is efficient

    Wrapping errors could be done with your own (or a crates) extension method on Option/Result which is async aware. Should be like 10 lines of code, not much but still annoying it's not in the standard library

    Stack traces can be gotten easily by using one of the many error libraries. Though I'm still not sure myself which one is best
  • 1
    @retoor I'll write standard string and math libs if or when you make it available.
  • 0
    @retoor is that my average frequency here?
  • 0
    @retoor Thats an upgrade from mere fan!

    Fine. I'll allow it.
Add Comment