Skip to content

Why not consider implementing a stackless coroutine? #172

Answered by edubart
OuYangPaste asked this question in Q&A
Discussion options

You must be logged in to vote

Coroutines in Nelua are designed like in Lua, so they are stackful as in Lua, and there are no plans to support stackless coroutines in the compiler. This is a controversial topic but I believe stackful coroutines are more powerful, useful and easier to use, although it comes with some disadvantages that we are aware of, like it may use more memory footprint and it requires proper support for the target machine, usually via some assembly coding, thus it is not cross platform as stackless.

Seems like you are compiling for MIPS architecture, the Nelua coroutine implementation is backed by the minicoro project, it provides stackful coroutines for C, it was also created by myself and currentl…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@lePereT
Comment options

@edubart
Comment options

Answer selected by edubart
Comment options

You must be logged in to vote
1 reply
@OuYangPaste
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants