3 ms·
> Languages in which try/catch/throw work across coroutine boundaries You wha...? The question was about goroutines, not coroutines. Besides, you'll notice th
by randomdata 2y ago
> Languages in which try/catch/throw work across coroutine boundaries
You wha...? The question was about goroutines, not coroutines.
Besides, you'll notice that exception handlers cross coroutine boundaries in Go just fine. Your random tangent isn't even correct. Where did you dream up this idea to the contrary? I know coroutines are still new to Go, only officially landing in the latest release (experimentally in 1.22), but you'd think that would also mean their behaviour is fresh in your memory.
I'll take your avoidance of the original question to mean that no other language does it either.
- rerdavies 2y agoI answered as I did because the original question seems strangely broken. The premise upon which the question is asked is flawed. What are goroutines, other than peculiarly broken coroutines? (Notwithstanding your point that go has a non-broken implementation of coroutines at experimental release stage). It is true that Javascript has a goroutine-like facility for executing coroutines on a seperate thread. But there are languages (c++, c# at least) where coroutines can execute on separate threads without suffering from the broken-ness of goroutines.