3 ms·
Does anyone know, if coroutines are implemented by the compiler, will they also be available for C? Specifically, I'm thinking about the brilliant Io language w
by pedrow 9y ago
Does anyone know, if coroutines are implemented by the compiler, will they also be available for C? Specifically, I'm thinking about the brilliant Io language which uses its own cross-platform C coroutine library. If this could be done 'natively' I wonder if it would simplify the code?
- leeter 9y agoThey are, however I'm not sure the machinery of a coroutine will translate well to C. Gor does a pretty good breakdown of what's actually happening in this video https://www.youtube.com/watch?v=8C8NnE1Dg4A https://www.youtube.com/watch?v=8C8NnE1Dg4A which I would suggest watching. Not sure it can't be done, but it would require a good design. Personally I think that a libdispatch approach works better for C, particularly with the blocks extension.