- Cannot interop with other languages/VMs that do async differently.
The nice thing about promise-based async is that it's very easy to map to straight C ABI callbacks, which means that it can be fully cross-language. Green threads are runtime-specific.
"Cannot" seems a bit harsh. CompletableFuture isn't going away, and is made for callback situations.
With green threads being "free" (you can have millions), it might be reasonable to just block your green thread until the callback arrives.
One curious thing is that Java has elected to use lightweight threads instead of async methods: https://www.javacodegeeks.com/2019/12/project-loom.html
Their arguments are compelling:
- Works with existing debuggers and debugging techniques.
- Stack traces aren't polluted with irrelevant garbage.
- Doesn't create method apartheid, where async and non-async can't "mix".
- Doesn't force library authors to "buy into" the async model.