|
|
|
|
|
by chrsig
1066 days ago
|
|
Coroutines are one thing that i'd probably prefer language support for rather than a library. x := co func(){
var z int
for {
z++
yield z
}
}
y := x()
for y := range x {
...
}
or something to that effect. It's cool that it can be done at all in pure go, and I can see the appeal of having a standard library package for it with an optimized runtime instead of complecting the language specification. After all, if it's possible to do in pure go, then other implementations can be quickly bootstrapped.My $0.02, as someone that uses go at $work daily: I'd be happy to have either, but I'd prefer it baked into the language. Go's concurrency primitives have always been a strength, just lean into it. |
|
Well, maybe a library solution could possibly have a guard page at the end of the stack. When that one is reached, then you could try to grow the stack in an error handler. (but that would probably not work, if you have taken a pointer to some stack variable)