Ramifications of Removing Coroutines or Implement at higher level than C
"dennisf486" <[email protected]>
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
How much of (the implementation of) Io would be gutted if I made a version without coroutines (or make compiling with coroutine support optional based on a preprocessor flag)? Could Io coroutines be (re)-implemented entirely at the Io message-passing level? The reason I'm interested in this is for my Io-C++ binding. Currently, I have to be very careful about the interactions between C++ exceptions and Io coroutines: I cannot let a C++ exception escape through to Io, and I cannot run Io code from C++ that yields to a coroutine. Either of these actions causes a horrible crash in my C++ code relating to exception handling, because Io coroutines use the same mechanism C++ uses for its exception handling, and the C++ runtime doesn't expect to find somethings else using that too. The ability to remove or stub-out coroutines based on a compile flag would improve the reliability of my game that uses C++ and Io. I can't use multiple coroutines anyway so I'd just as soon not have the ability to crash my program that way. The ability to (re)-implement coroutines on the message level in Io might allow me to start using some coroutines where I couldn't before. It's neat and all that Io coroutines work even at the C level, but I don't really have a need for that. If I need parallelism at the C/C++ level, I'll just launch a thread. I'm not proposing mainstream Io stop using the current coroutine implementation, just asking what if we could choose what kind of coroutine implementation it uses based on some compile flags - is it even feasible?