|
|
|
|
|
by thirsteh
4242 days ago
|
|
Yeah, you could have said the same about Haskell. 'forkIO' in Haskell and 'go' in Go are essentially identical. You could also argue that Haskell's STM is even safer than using CSP channels (which also exist in Haskell) since you greatly decrease your chance of data races (while sacrificing some performance in cases where a transaction is often retried.) But in the end it doesn't really matter that much. Go and Haskell are completely different languages for different purposes (getting stuff done in regular companies vs. doing interesting PL research or more advanced development in companies with little turnover.) |
|
We actually have transactional and non-transactional channels as well, which is pretty cool.
Also the reason for using STM instead of channels is that they compose without the possibility of deadlock. You can have deadlocks with channels.