Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
jestdotty562265dno 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! -
jestdotty562265dwhy 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
-
jestdotty562265dI'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! -
jestdotty562265dand 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!
-
Pogromist243664dThere's programming languages that everyone could use to make job done quickly and there's that user needs to fully understand to use properly.
-
typosaurus1218064d@dissolvedgirl retoorscript even had a stacktrace. We need a retoorscript vs rust comparison
-
12bitfloat942364dResponding 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 -
12bitfloat942364d@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
-
typosaurus1218064d@12bitfloat that's cool. retoorscript only has one kind of stacktrace because it knows like apple what the users want.
-
12bitfloat942364d
-
12bitfloat942363d@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 -
Wisecrack948063d@retoor I'll write standard string and math libs if or when you make it available.
Related Rants
-
Milenchy45Why are the fastest laptops always considered "gaming" laptops and look like fucking alien spaceships? 😩 T...
-
leanrob10Sometime I’m developing in Rust and I do something wrong. Then I look at the terminal and it says... “Yo...
-
Chippy1"I'm not ugly. I just reduce my graphics to have better performance."
rust is just ugly
rant
ugly
rust