News for hackers. Stuff that matters.
Re:Rust’s async isn’t colored by pron on Thursday March 11, 2021 @06:29AM (#26422878)
If there are two types of functions with syntactically distinct calling mechanisms, and there is a cost, in both syntax and performance, for mixing them, then you have two colours. That the cost of mixing isn't infinite but just high -- high enough to require two distinct sets of APIs, one for each colour -- then you have two colours with all their issues, even if to a somewhat smaller extent than the extreme, and unusual, case of JS. If doing something is expensive and unrecommended, then doing it is very much an issue.
Re:Rust’s async isn’t colored by hobofan on Thursday March 11, 2021 @07:27AM (#26423289)
(Author here)

I think you've made a good point, though I disagree on the expensiveness. I think the point I should have tried to make is "Rust's async fns are colored, but I don't think that's a big problem".

In my head I used "suffers from the coloring problem" (which I would 90% attribute to point 3 in the post) and "is colored" interchangeably, but obviously there is a difference between the two.

Re:Rust’s async isn’t colored by pornel on Thursday March 11, 2021 @10:05AM (#26424732)
The original article explicitly says it's not about syntax or performance. It's about irrecoverably splitting call graphs when sync functions can't wait for async results. JS has this issue, but Rust and C# don't.

In case of Rust the syntax difference is a deliberate design choice, because `.await` points can also return from the function. Rust handles errors with locally explicit `?` for the same reason.

Re:Rust’s async isn’t colored by jevgeni on Thursday March 11, 2021 @08:05AM (#26423524)
Most of the functions are syntactically distinct.