lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Apr 27, 2017 at 2:07 AM, Sean Conner <> wrote:

>   Even coroutines?  Such as
> (okay, granted, it's implemented in assembly, but it works quite well for C; I wouldn't even know how to begin to adapt that for C++)

The "for C" part is incorrect. It works quite well for certain combinations of (CPU architecture; operating system; C compiler). Those particular combinations ensure you can switch stacks and register contexts the way you do; even more fundamentally, they ensure you have stacks and register contexts to begin with. You could certainly do that same thing with certain combinations of (CPU architecture; operating system; C++ compiler). In fact, given that all the mainstream C compilers share their backends with the corresponding mainstream C++ compilers, you could easily have overlapping combinations with mostly the same code (one additional problem you would need to tackle is the C++ exception mechanism).