7

rust is just ugly

Comments
  • 2
    no stack traces for errors, for a language obsessed with "errors"
  • 1
    no early return. don't you dare leave any if statements without a ? or returns nevermind that it would work in any other language

    compiler can't understand

    and forget chaining if and if let statements!
  • 1
    why the hell is sync and async different interfaces. just be smart. tell based on the context. there is no other difference. we all know this
  • 1
    I'm tired of writing types and interfaces and then 15 more because the contexts are slightly different oh wow this should be used with a reference. oh you want it used with an owned value? you're gonna have to rewrite it again! whoops, async and sync -- have you added all the crates? talk about npm packages bloat!

    you want a method attached to something existing? gosh golly better write some traits first!
  • 1
    and then you write so much boilerplate code the compiler dares to tell you a bunch of your code is unused. better delete it so the warning shut the fuck up so then a few hours later you have to go rewrite an interface for a slightly different type again!
  • 2
    no async option / result because fuck you
  • 1
    This is gold info actually. No early returns? Wut? :O
  • 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
    @jestdotty lmao even shitty old PHP has stack trace
  • 1
    @dissolvedgirl retoorscript even had a stacktrace. We need a retoorscript vs rust comparison
  • 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
  • 1
    @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
  • 2
    @12bitfloat that's cool. retoorscript only has one kind of stacktrace because it knows like apple what the users want.
  • 1
    @retoor Fair enough :D

    It's always a compromise between user friendliness and expressive power
  • 1
    @12bitfloat SO I KEEP HEARING ITS BEAUTIFUL
  • 1
    @12bitfloat early returns out of match statements
  • 1
    @12bitfloat I mean for example if I try to make new and it returns result with error I can't chain it with .unwrap-or-else and give it a default value, because in my case making the default value would be calling async and result and option types don't take futures when you chain them
  • 1
    @12bitfloat if you propagate errors up the stack there is no stacktraces, which incidentally is what people want you to be doing

    so I kinda just wanna go back to unwrap by this point cuz then I at least don't have to guess where something broke
  • 1
    anyway I was frustrated and I also have brain damage / my immune system attacks my nerves that got activated again by the black mold I had found so
  • 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
    @Wisecrack deal! I know how to find you! One in four days on dR! 😁
Add Comment