Marking a function as `async` and `@concurrent` feels somewhat `@redundant`.
@SteveBarnegren This is an interesting observation. You think the async should be implicit?

@mattiem I'm not a language designer, but that was also my initial thought!

Swift loves inferring things, so why not here too? If we can boil out some of the 'annotation clutter’ that would probably be a good thing?

@SteveBarnegren This is an area I think about a lot! Reducing syntactic overhead is a big focus of mine. It’s hard.

This was discussed during the proposal that added this. Implicit async makes concurrent sync functions impossible to write. It is arguable if they are useful, but they do “make sense”.

@mattiem Oh, really? What would the purpose be? I've only been doing the whole Swift concurrency thing seriously on a real project for about a week, but I can't envisage when I would use that?

@SteveBarnegren It would be a function that cannot suspend internally. I think it probably could also be called synchrously from other @.concurrent functions.

Again, theoretical. But closing syntactic doors you can never open again is something you have to be careful about.

I *think* ultimately this might reduce clarity in an area that people already struggle with.

@SteveBarnegren I think implicit behavior has to have a high bar, and be as unsurprising as possible.

In this case, @.concurrent functions are comparatively rare. Especially since you can get a similar, more local effect with async let. So while I don’t think synchronous concurrent functions are a good idea, I also don’t think this is a great target. Feels like you’d have to explain it a lot.

@mattiem Yes, agreed! Implicit behaviours have to be common enough that you learn to mentally ‘fill in the gaps’.

(Your comment is making me feel as though I should be using less `@concurrent` though 😅 - I'll bear that in mind!)

@SteveBarnegren Even better if is implicit is just what you’d expect and you don’t even think about it (nice, but we don’t always get so lucky)

It is possible you’ve just got lots of synchronous work to take care of. I’ve written about this general idea, though it was before @.concurrent was a thing. Maybe helpful?

https://www.massicotte.org/synchronous-work

Synchronous Work

Occasionally, you’ll come across something that will really influence your thinking on a topic. This happened to me after reading a post on the Swift forums. That was nearly 6 months ago as I write, but I’m still thinking about it today.

massicotte.org