News for hackers. Stuff that matters.
Re:A final proposal for Rust await syntax by arcticbull on Monday May 06, 2019 @02:31PM (#19842339)
After reviewing the syntax writeup, I've reached my own decision on what color the bikeshed should be.

I like the "Unusual other syntaxes: Use a more unusual syntax which no other construction in Rust uses, such future!await." [1] (or future@await). It makes sense because it is in fact something different than what exists anywhere else in Rust so it should receive a commensurate syntactic treatment. This was written off pretty quickly in [1] but it appears the most consistent with language philosophy -- specifically because it's inconsistent with any other language features it should get inconsistent syntax. I think that's what's throwing people off in this process: an attempt to impose 'consistency' on something that just isn't. As such, it'll never feel natural to co-opt existing syntax. Let's embrace it's inconsistency and introduce new syntax.

It supports '?' and '.' natively, and offers a path forward for new similar kinds of postfix operators without making more field names off-limits -- even the expr@match { .. } postfix expression thrown around would fit well. The @-prefixed postfix operator would return a value like all other expressions.

tl;dr: Either the syntax is inconsistent or the semantics are, and IMO, the former is preferable to the latter.

Either way, cool to see this feature moving along! Looking forward to using it no matter how it's spelled out haha.

[1] https://paper.dropbox.com/doc/Await-Syntax-Write-Up--AcIbhZ1...

Re:A final proposal for Rust await syntax by OtterCoder on Tuesday May 07, 2019 @03:48AM (#19847368)
I'd tend to agree with you, except for the fact that Rust reserved words are reserved everywhere. Even if the syntax were changed, you still couldn't name a field "async" or "return". Since it's no extra burden on the namespace, I'm less opposed to it.

I'm on the fence about disambiguation via unique punctuation, vs avoiding Perl-like line noise.