4 ms·
Sure, it's the reverse of goroutines, which allow you to do easy asynchronous programming using synchronous code.
by skybrian 15y ago
Sure, it's the reverse of goroutines, which allow you to do easy asynchronous programming using synchronous code.
- jamwt 15y ago.. or erlang processes. Or python greenlets. Or Haskell forkIO threads. Or libcoroutines.. Etc. See: http://news.ycombinator.com/item?id=1549023 http://news.ycombinator.com/item?id=1549023
- uriel 15y agoErlang has a slightly different but largely equivalent model, but the other alternatives you mention lack Go's channels and/or the select construct which is one of the greatest things about the language. When I found that Stackless Python didn't have a way to read/write on multiple channels at once I was quite shocked.
- thesz 15y agoHow's that Haskell lacks channels? http://hackage.haskell.org/packages/archive/stm/2.1.1.2/doc/html/Control-Concurrent-STM-TChan.html http://hackage.haskell.org/packages/archive/stm/2.1.1.2/doc/... http://www.haskell.org/ghc/docs/7.0.2/html/libraries/base-4.3.1.0/Control-Concurrent-Chan.html http://www.haskell.org/ghc/docs/7.0.2/html/libraries/base-4.... It also looks that "select" statement could be done in a combinator library way. The power of Haskell (or of any proper modern language) isn't in the language itself, it's in the number of things you can express as a library, on top of the language.