# Project Loom will make coroutines obsolete

**URL:** https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833
**Category:** Uncategorized
**Created:** [May 25, 2020, 8:22pm UTC](https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833 "2020-05-25T20:22:17Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)
#### Post date: [August 4, 2021, 8:21pm UTC](https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833/21 "2021-08-04T20:21:03Z")

</div>

Maybe interesting in this context is that [Brian Goetz thinks that project Loom will make reactive programming obsolete](https://www.reddit.com/r/programming/comments/oxsnqg/brian_goetz_i_think_project_loom_is_going_to_kill/).

---

<div class="post-metadata">

### Author: ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)
#### Post date: [October 11, 2022, 9:59am UTC](https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833/22 "2022-10-11T09:59:05Z")

</div>

I still think that couroutines might not be beneficial compared to the simpler and less invasive virtual threads in many scenarios. It looks like Pivotal, the company behind Spring, has the same opinion: [Embracing Virtual Threads](https://spring.io/blog/2022/10/11/embracing-virtual-threads)

---

<div class="post-metadata">

### Author: ![clovisai](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@clovisai](https://discuss.kotlinlang.org/u/clovisai)
#### Post date: [October 11, 2022, 10:30am UTC](https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833/23 "2022-10-11T10:30:30Z")

</div>

I don’t think anyone is saying that virtual threads are a bad idea, just that coroutines as they are implemented in Kotlin are much more than just “cheap concurrency”.

You can’t do this with virtual threads:

```kotlin
// Cheap, lazy, synchronous iterator
val fibonacci = sequence {
    yield(1)
    var cur = 1
    var next = 1
    while (true) {
        yield(next)
        val tmp = cur + next
        cur = next
        next = tmp
    }
}

fun main(args: Array<String>) {
    println(fibonacci.take(10).joinToString())
}

```

Coroutines also make Arrow’s [bind operator](https://arrow-kt.io/docs/patterns/monads/) possible.

Virtual threads do not have a concept of hierarchy, which is extremely useful (on the client side: multiple requests originate from a component in React or Compose, when the component goes out of the screen all requests related to it are automatically cancelled; on the server side: multiple sub-tasks can be started for a single client request and if any of them fail you’re guaranteed the others are killed). It allows the entire codebase to use asynchronous methods without breaking the application’s lifecycle.

And most importantly, they’re multiplatform. JavaScript doesn’t have threads (virtual or otherwise) but still needs concurrency, Native doesn’t have virtual threads, etc.

[Previous page](https://discuss.kotlinlang.org/t/project-loom-will-make-coroutines-obsolete/17833.md?page=1)
