A library for effect handlers in C++
github.com
A library for effect handlers in C++
1–10 of 12 posts
Re: A library for effect handlers in C++
#2Isn't this kind of thing supported natively with C++ coroutines as of C++20?
Re: A library for effect handlers in C++
#3Nice!
By coincidence I'm ging to present my bachelor's thesis today - partially in effects and handlers.
Re: A library for effect handlers in C++
#4Isn't this kind of thing supported natively with C++ coroutines as of C++20?
You mean threading? That is just one common example for what is possible with arbitrary effect handlers.
Re: A library for effect handlers in C++
#5Isn't this kind of thing supported natively with C++ coroutines as of C++20?
Kind of.
You still need a runtime library, which should be integrated by C++23, lets see.
What C++ has better than Rust on this regard is that C++20 at least shipped at the necessary vocabulary types and compiler magic, so the plug-and-play story across runtimes (HPX, C++/WinRT, kokos,....) is much more sound today.
Re: A library for effect handlers in C++
#6Re: A library for effect handlers in C++
#7Nice! By coincidence I'm ging to present my bachelor's thesis today - partially in effects and handlers.
Good luck!
Re: A library for effect handlers in C++
#8[deleted]
Re: A library for effect handlers in C++
#9Just because it is C++ does not mean there is any merit in doing an "object-oriented" thing. Use of inheritance just makes it clunky.
I.e., this is a clever idea, but the form could be better.
Re: A library for effect handlers in C++
#10Isn't this kind of thing supported natively with C++ coroutines as of C++20?
Only to a certain extent. The question is not only if something is possible, but also what the most convenient way to express it is. Effect handlers do have some interesting ideas for programmer-level interface, like user-defined typed commands and dynamic pairing of commands with handlers. In this sense, C++20 coroutines or Boost Context are lower-level, and maybe not the most convenient building blocks for implementing complicated concurrency scenarios, yet alone effects that do not look like concurrency at first sight, like exceptions or different forms of mutable state.