4 ms·
There is no one-size-fits-all approach. LLVM IR has async/await and coroutines, but most real-world VMs and language static compilers cannot depend on such int
by duelingjello 7y ago
There is no one-size-fits-all approach.
LLVM IR has async/await and coroutines, but most real-world VMs and language static compilers cannot depend on such intrinsics because of their memory and execution models. For example, Pony's ORCA has unique memory barrier and execution models that wouldn't work with this approach, although it uses LLVM for compilation down to metal. This is why LLVM is a loose framework and collection of tools split into "middleware" passes, rather than a single monolith.
PS: According to its paper, ORCA is supposedly one of the fastest GCs for most use-cases. It beat Zulu's C4, Erlang BEAM and another one in a deathmatch. It's too bad it can't be extracted as a separate project or integrated into OpenJDK or LLVM without lots of work. Of course, no GC is better (I'm staring at you, Rust. :).
http://releases.llvm.org/8.0.0/docs/Coroutines.html http://releases.llvm.org/8.0.0/docs/Coroutines.html