This is way way off-topic but: I have never seen the word "postfix" used in this way. "Suffix" is the normal/common English word for this as far as I've always been aware. A quick search has it listed it as a synonym, but I can't find any usage outside tech and it sure seems like a tech-industry/coding erroneous neologism trying to balance the seemingly logical "post" -vs- "pre". Am I way off the mark here?
Even if it is tech neologism, what would make it erroneous?
A final proposal for Rust await syntax
171–180 of 265 posts
Re: A final proposal for Rust await syntax
#172Earlier quoted context omitted.
You can chain .await, though. let n = future_of_future_of_int .await .await;
Curiously, will there be limitations to where it can be used? Eg, imagine a `foos.iter().map(|f| f.await).collect:: >()`? That seems crazy, think it'll be possible?
Re: A final proposal for Rust await syntax
#173Earlier quoted context omitted.
> Obviously core devs of Google backed language cannot do better. They can only gain that trust from users within Google, not outside of Google. That's a non sequitur. Trust is not mandated by company boundaries. I for one trust in the competence of the Go maintainers, while at the same time having absolutely zero trust in Google as a company.
> I for one trust in the competence of the Go maintainers That's fine. But ultimately Go employees do not work for you and cannot put much effort into proving they are good at solving problems for you, since the company doesn't pay them to do it. There will not be a track record in users eyes of their design decisions and not much trust from users they are even capable of doing it well.
It absolutely does. Google has a vested interest in making Go a popular language outside of Google: It improves sentiments towards Google by association, and it means that Google has an easier time onboarding new hires since they probably already know Go.
Re: A final proposal for Rust await syntax
#174Re: A final proposal for Rust await syntax
#175I figure the reason the proposed syntax looks gross is because other languages have been using a prefixed await for many years. The Rust decision seems well thought out though, enough to make me wonder if perhaps other languages have been doing it wrong. My first experience with futures was in the form of QFuture ( https://doc.qt.io/qt-5/qfuture.html ), and there you call .result() to block and wait for the result. T…
IMO it's awkward for the following reasons: (1) It looks like a field access, and field accesses are "cheap", method invocations aren't. This breaks the 'conceptual weight' model when you look at a line of code. Field accesses are simple and understood. It becomes impossible to gauge the 'cost' of a line by looking at it unless you're intimately familiar with the workings of 'await' and there's no visual cue. (2) If…
There is. Your editor is going to show the await keyword in a different color. (Unless you happen to be Rob Pike.)
Re: A final proposal for Rust await syntax
#176Earlier quoted context omitted.
Like I said the first time, I know all that stuff. I'm trying to express problems a new user is going to have with this syntax, and "but our reasons are really good!" does nothing for them. It's not inconsistent to hold the simultaneous beliefs that "trying to fix Rust's syntax would make it worse" AND "Rust's syntax is insane". And given those beliefs, maybe adding a postfix operator to express what everyone else do…
It is inconsistent to hold those beliefs. Because "insane" implies that the Rust team made wrong decisions with the syntax, in fact so obviously wrong that no "sane" person would make them. If you acknowledge that the syntax decisions make sense, then they aren't "insane".
Nothing about the soundness of your design means that Rust isn't hard to learn, is all I'm saying. And per the freakshow all around us, it's getting harder, not easier.
Re: A final proposal for Rust await syntax
#177Earlier quoted context omitted.
I've used perl5 for a long time (although these days I've replaced it with python in my toolchain, although I have my fair share of complaints about python as well) and I think your comparison is unfair. Rust's sometimes complicated syntax is made necessary by the very concept of the language. You need to be able to express lifetimes, you need to be able to express generics, you need to be able to strongly type lambd…
> Rust is noisy because it has to represent concepts that simply don't exist in other programming languages. In a few cases having to do with lifetime management and the borrow checker, that's certainly true. But the example at hand is fundamentally just cloning ideas from Javascript.
Re: A final proposal for Rust await syntax
#178Earlier quoted context omitted.
IMO it's awkward for the following reasons: (1) It looks like a field access, and field accesses are "cheap", method invocations aren't. This breaks the 'conceptual weight' model when you look at a line of code. Field accesses are simple and understood. It becomes impossible to gauge the 'cost' of a line by looking at it unless you're intimately familiar with the workings of 'await' and there's no visual cue. (2) If…
> there's no visual cue. There is. Your editor is going to show the await keyword in a different color. (Unless you happen to be Rob Pike.)
Re: A final proposal for Rust await syntax
#179Earlier quoted context omitted.
I wonder if I would ever find something like my_iter .foo() .bar() .return more appealing than return my_iter .foo() .bar(); I could see it happening, but I'll definitely need some time to get used to it.
See, now this is exactly my issue with this syntax, I generally expect to be able to "chain" things with the "." notation.
Re: A final proposal for Rust await syntax
#180[a+2 for a in as if a > 3]
Vs
as.filter(a -> a > 3).map(a -> a + 2)
Sometimes I even wonder why variable assignment has to precede the assigned expression.