Comment by nunez
1 year ago
> If the programmer clones the callstack, hands the callstack off to a coroutine, and then both callstacks have e.g. a reference to an open file handle in one of their stack frames, it means the programmer cannot safely unwind the stack.
Wouldn't you access file handles like this through a synchronization primitive like a mutex to avoid this exact issue? Or close the file handle once all go routines have returned?
> Because of this stack disconnection of parents and children, it really becomes impossible to have exceptions. Not just won't, as Rob Pike would have you believe. Can't.
That's one thing I actually really like about Golang. Exceptions have always felt like this heavy thing that you, often times, use, like, 10% of. The error type is so much lighter.
No comments yet
Contribute on Hacker News ↗