9
jestdotty
29d

rust is just ugly

Comments
  • 3
    no stack traces for errors, for a language obsessed with "errors"
  • 2
    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!
  • 2
    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
  • 2
    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!
  • 2
    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!
  • 3
    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
  • 3
    @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
  • 4
    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
    @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
  • 2
    @retoor I'll write standard string and math libs if or when you make it available.
  • 1
    @Wisecrack deal! I know how to find you! One in four days on dR! 😁
  • 1
    @retoor is that my average frequency here?
  • 2
    @Wisecrack yj, i'm kinda stalker
  • 1
    @retoor Thats an upgrade from mere fan!

    Fine. I'll allow it.
Add Comment