I feel like once serializing god-knows-what state across program invocations is a requirement, I'd much prefer writing this explicitly so I can at least have a chance of debugging it type Task struct { I int } func (t *Task) Next() (bool, int) { if t.I
It's a good point, but the entire program would have to be written this way (you can't use the standard library, or any other dependencies). What if there were tools to inspect and debug the coroutine state? That's an area we're exploring now.
Durable Coroutines for Go
31–37 of 37 posts
Re: Durable Coroutines for Go
#32Re: Durable Coroutines for Go
#33Earlier quoted context omitted.
It's a good point, but the entire program would have to be written this way (you can't use the standard library, or any other dependencies). What if there were tools to inspect and debug the coroutine state? That's an area we're exploring now.
But doesn't the program have to be written explicitly anyway? Like what happens if I open a file or network connection, yield, and then resume on another system?
In the case of network connections, the user could instead serialize connection details and then recreate the connection when deserializing the coroutine state. Same thing for files, where instead of serializing unstable low-level details like the file descriptor, the user can instead serialize higher level information (path, open flags, etc) and recreate the open file when deserializing the coroutine state.
Re: Durable Coroutines for Go
#34Why not fork Go and implement this directly? (and also removing any telemetry Google might have installed while at it...)
Re: Durable Coroutines for Go
#35Re: Durable Coroutines for Go
#36Re: Durable Coroutines for Go
#37Earlier quoted context omitted.
They just seem pretty pointless as a tool in language that already have super-light green threads and good concurrency primitives.
https://research.swtch.com/coro might be an interesting read.
In other languages they were used coz they were far lighter than native threads but that's not the case in Go