Stream: wg-async-foundations

Topic: async-fn-in-traits-are-hard


centril (Oct 26 2019 at 15:37, on Zulip):

( Subject matter: http://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/ )

Second, writing for<'s> D::GetUser<'s> is kind of grody, we’re obviously going to want more compact syntax (this is really an issue around generic associated types in general).

d: &impl Database<GetUser<'_>: Send>> :P

centril (Oct 26 2019 at 15:42, on Zulip):

Complication #2c. Listing specific associated types reveals implementation details

It's a semver hazard in either direction (maybe you want to remove the Send bound in the future but then implementors can assume less)

centril (Oct 26 2019 at 15:48, on Zulip):

For example, you could imagine supporting async bounds, so that we might write async Send instead of just Send:

When I hear "async bound", I assume something related to effect-polymorphism, but this doesn't seem to be that?

nikomatsakis (Oct 29 2019 at 17:02, on Zulip):

When I hear "async bound", I assume something related to effect-polymorphism, but this doesn't seem to be that?

Nope, it would be something else. I probably shouldn't have even added concrete syntax, especially syntax I don't know if I would even like. Maybe something like S::async: Send or S::*: Send .. who knows. The point would be a bound that is applied to the GATs within the trait without naming them individually.

nikomatsakis (Oct 29 2019 at 17:03, on Zulip):

It's a semver hazard in either direction (maybe you want to remove the Send bound in the future but then implementors can assume less)

This is true on traits, but my example was not a trait, but just a function that was listing its where-clauses -- in that context, I don't think it's a semver hazard to get more narrow

nikomatsakis (Oct 29 2019 at 17:03, on Zulip):

That said, any kind of "all the things!" feature has a hazard if the trait should grow more items

lqd (Oct 29 2019 at 18:36, on Zulip):

I assume something related to effect-polymorphism

all this reminds me of coeffects as well, since it's kind of a requirement on the context :thinking:

Last update: Nov 18 2019 at 00:40UTC