4 ms·
Lua makes coroutines first class citizens. I have only built one toy project with it, but it was very enjoyable. Someone even managed to implement Erlang-style
by krylon 3y ago
Lua makes coroutines first class citizens. I have only built one toy project with it, but it was very enjoyable. Someone even managed to implement Erlang-style concurrency on top of Lua's coroutines. That was a lot of fun to play with. (/stares into the night, reminiscing/)
- max_k 3y agoIf you like Lua coroutines and C++20 coroutines, I have written a piece of code that allows to combine both: https://github.com/CM4all/libcommon/blob/master/src/lua/CoAwaitable.hxx https://github.com/CM4all/libcommon/blob/master/src/lua/CoAw... It's used for example by our "myproxy" project: https://github.com/CM4all/myproxy/blob/master/src/Connection.cxx https://github.com/CM4all/myproxy/blob/master/src/Connection... (Ctrl-F Lua::CoAwaitable) - a Lua coroutine is launched from within a C++20 coroutine and the C++20 coroutine awaits the Lua coroutine. Everything integrated in a non-blocking I/O event loop.
- krylon 3y agoI am not a C++ person, but that does sound nice. I'm just not ready for the kind of commitment it takes to dive into C++. ;-)