Hacker News new | ask | show | jobs
by scadge 3104 days ago
I think it's fair to say that Go was hardly the first language to implement the concept of coroutines[1]. Probably the only merit of Go here is the short and convenient name of the 'run' method.

[1] https://en.wikipedia.org/wiki/Coroutine#Implementations

2 comments

    > libmill was a project that aimed to copy Go's
    > concurrency model to C 1:1 [...]

    > libdill is a follow-up project that experiments with
    > structured concurrency and diverges from the Go model.
http://libdill.org/documentation.html
I would say the main advantage is being able to pass couroutine arguments as if it was a simple function. In other coroutine implementations in C (e.g. libtask) you have to make a struct containing all the args and pass that to the run function.