Nice insight into the amount of thought going into this design proposal. It's always tricky to introduce new syntax to a language and re-using the field access notation here isn't as icky an approach as it first looks. I don't know enough about rust to understand how this would operate during compile time w.r.t if a user tries to define a field named 'async'. Is that no longer allowed or would the compiler be able to…
A final proposal for Rust await syntax
11–20 of 265 posts
Re: A final proposal for Rust await syntax
#12Really don't like the magic field access syntax.
From a language-feel and ergonomics standpoint, I agree. But the Rust team has made it pretty clear why a postfix is much more flexible, and I think we'll grow into it.
I do think it'll continue as a bit of a Rust oddity when compared to other async/await implementations (e.g., Python).
Re: A final proposal for Rust await syntax
#13Re: A final proposal for Rust await syntax
#14Re: A final proposal for Rust await syntax
#15Nice insight into the amount of thought going into this design proposal. It's always tricky to introduce new syntax to a language and re-using the field access notation here isn't as icky an approach as it first looks. I don't know enough about rust to understand how this would operate during compile time w.r.t if a user tries to define a field named 'async'. Is that no longer allowed or would the compiler be able to…
Re: A final proposal for Rust await syntax
#16I also appreciate that this proposal was insanely bike-shedded and so really, any decision is better than no decision. I would've been happy with "await << f()" if it meant we could get this feature (lots of Rust projects I'm interested in are waiting on async/await before focusing on further development).
Re: A final proposal for Rust await syntax
#17Re: A final proposal for Rust await syntax
#18A language should, in my opinion, not depend on syntax highlighting.
Re: A final proposal for Rust await syntax
#19I like this explanation.
But this whole post could really use some more concrete examples of the at the very least the final style being used in various situations. Not just mainly `expression.await`.
Keep up the work on this, I'm excited to use this in my projects.
Re: A final proposal for Rust await syntax
#20Wow, this is the only suggestion I really didn't like. I'm really happy that it's progressing forward, but I can't help but feel that staying with the macro and postponing the decision would've been a better choice. A language should, in my opinion, not depend on syntax highlighting.