News for hackers. Stuff that matters.
Re:Durable Coroutines for Go by tedunangst on Friday October 20, 2023 @02:23PM (#37959681)
Re:Durable Coroutines for Go by gsora on Friday October 20, 2023 @02:37PM (#37959827)
Why?
Re:Durable Coroutines for Go by sctb on Friday October 20, 2023 @02:53PM (#37959981)
It's hardcoding an implementation detail of the Go runtime, which is subject to change (and if it did, this library might have non-obvious failure behaviour).
Re:Durable Coroutines for Go by achille-roussel on Friday October 20, 2023 @02:49PM (#37959943)
Yes, we planned to update the coroc compiler to generate this value instead of having it hardcoded so it will be more future proof.
Re:Durable Coroutines for Go by deadfa11 on Friday October 20, 2023 @03:54PM (#37960751)
Eh, this one seems a reasonable trade-off to me at this point. If you try to handle every potential issue upfront, you'll never release, and this seems entirely fixable down the road. Persistent coroutines is a pretty challenging area to explore (tried this with Lua in a previous venture), and this seems a pretty minor point in that overall complexity. I'm curious, what else have you come across that justifies the "really brittle" conclusion?
Re:Durable Coroutines for Go by tedunangst on Friday October 20, 2023 @04:43PM (#37961268)
You do what you have to do, but as a user, I like to know how things will break and what my options will be. I was curious how it worked, and took a peek at the first file that seemed it might reveal something interesting.
Re:Durable Coroutines for Go by ilyt on Friday October 20, 2023 @05:11PM (#37961585)
They just seem pretty pointless as a tool in language that already have super-light green threads and good concurrency primitives.
Re:Durable Coroutines for Go by pryz on Friday October 20, 2023 @05:35PM (#37961824)
https://research.swtch.com/coro might be an interesting read.
Re:Durable Coroutines for Go by ilyt on Saturday October 21, 2023 @06:41PM (#37971152)
Doesn't answer question "why?"

In other languages they were used coz they were far lighter than native threads but that's not the case in Go

Re:Durable Coroutines for Go by chris6f on Friday October 20, 2023 @04:03PM (#37960864)
A source-to-source compiler, and a library that copies runtime implementation details, was the path of least resistance. We'd love to integrate this with the Go compiler (`go build -durable`, vs. `coroc && go build -tags durable`), but the compiler is closed and maintaining a fork of Go would be difficult.