3 ms·
> I don't see the link between golangs go statement and goto except they cause a fork in control paths. This is a lot of why he goes into the history of "old-s
by gwd 4y ago
> I don't see the link between golangs go statement and goto except they cause a fork in control paths.
This is a lot of why he goes into the history of "old-school goto" and its problems in the post. One of the issues with "old-school goto" is that you could never be sure if you called into a function whether it would actually return out of that function, or end up "goto"-ing somewhere else completely different, without going into it and inspecting it. Similarly, one of the issues with calling a function in Golang is that you can't be sure it didn't spin off a goroutine which is still doing some random work or other.
I mean, yeah, you shouldn't just randomly fork off a goroutine which retains references to state passed into a function without clearly documenting it. But there's nothing to stop you from doing it.
- Spivak 4y ago> But there's nothing to stop you from doing it. And the crucial point is that because you can do it languages have to have weaker guarantees because they have to assume you could do it.