# Language proposal: abstracting over \`async\` (the \`yields\` effect)

**URL:** <https://forum.modular.com/t/language-proposal-abstracting-over-async-the-yields-effect/529>\
**Category:** Mojo\
**Tags:** discussion, 24\_6, mojo-language-design, mojo-proposal\
**Created:** [February 5, 2025, 11:48am UTC](https://forum.modular.com/t/language-proposal-abstracting-over-async-the-yields-effect/529 "2025-02-05T11:48:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/nick/32/115_2.png) [@Nick](https://forum.modular.com/u/Nick)\
**Post date:** [February 5, 2025, 11:48am UTC](https://forum.modular.com/t/language-proposal-abstracting-over-async-the-yields-effect/529/1 "2025-02-05T11:48:13Z")

</div>

I’ve just published a [major proposal](https://github.com/modular/mojo/pull/3986) for coroutines in Mojo (i.e. async/await).

I am proposing that we replace `async` with a `yields T` syntax. This allows us to abstract over whether a function is `async`, and more generally, it allows us to abstract over whether traits and even entire libraries are `async`. This solves the function/trait/library duplication problem that arises in languages that have async/await.

This can be seen as a counter-proposal to @owenhilyard’s [recent proposal](https://github.com/modular/mojo/pull/3946) on effect handlers. We are both attempting to solve the same problem, and my proposal is heavily inspired by Owen’s. The main difference between our proposals is that I have taken the `raises Never` trick that @clattner presented [here](https://github.com/modular/mojo/pull/3946#issuecomment-2601176112), and adapted it to `async`. The end result is really exciting, in my opinion.

I am keen to hear everybody’s thoughts. 🙂

If you have small comments, you can reply to this thread, but detailed feedback should probably be published on the Github thread.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [August 4, 2025, 11:48am UTC](https://forum.modular.com/t/language-proposal-abstracting-over-async-the-yields-effect/529/2 "2025-08-04T11:48:20Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
