4 ms·
> I'm pretty sure Go is going to eat Erlang. I wouldn't be surprised by this. Go's concurrency pattern is fantastic, but to match what Erlang does it needs to
by Jtsummers 13y ago
> I'm pretty sure Go is going to eat Erlang.
I wouldn't be surprised by this. Go's concurrency pattern is fantastic, but to match what Erlang does it needs to be easily extended beyond the running process. Can channels connect multiple "nodes" yet? That is, two running go programs, can they communicate via channels or do they have to use some other IPC mechanism? Across a network? That universal communication structure is (IMO) erlang's killer feature.
- jerf 13y agoI do not have direct knowledge, but I'm pretty sure the problem with "network" channels in Go is the synchronous nature of channels. Even if we did have a perfect network, that works poorly across a network, and if the network starts degrading even a bit the sync channels just completely fall apart. The language treats them as a fast synchronization method. You can very nearly translate RPC to "channel" in this argument and it works: https://news.ycombinator.com/item?id=2318249 https://news.ycombinator.com/item?id=2318249 (Err, I did try to find a better explanation that wasn't mine, but Googling up an RPC criticism was hard, because saying "RPC" comes up with a pretty big search pool to be trying to find the word "bad" in...) My reign library basically just ports over the Erlang idea; asynch messages, PID-like things that can be transmitted across the network and identify the same mailboxes within a cluster. It's meant to be a porting aid, not a solution you'd reach for in Go to create a brand new program. (If you do that, it's on you.) Clustering like this is nontrivial and the big reason I'm sitting on the code locally until clustering is at least working under some circumstances; without clustering support, the mailboxes are just an invitation to write nonidiomatic code for no gain.
- pjmlp 13y ago> I wouldn't be surprised by this. Go's concurrency pattern is fantastic Only for those not versed in java.util.concurrent, TPL, PPL, TBB, Cilk Plus.
- kinofcain 13y agojava.util.concurrent doesn't have a convenient mechanism for "selecting" across available channels/queues without blocking. This is a key feature of erlang and go. There are ways to simulate it, but it's not the same thing. (I'd love to be wrong about this).
- pjmlp 13y agoYes, you need to peek() the queues, so it is not really being blocked on select like Go. But then, one can use something like Akka, which I forgot to mention, and still be on the JVM.
- voidlogic 13y ago>so it is not really being blocked on select like Go. Select in Go only blocks if you don't feel out the "default:" case... select { case: foo := <-fooCh fmt.Printf("got %v\n", foo) default: fmt.Println("got nothing") }
- lacker 13y ago"Those not versed in Cilk Plus" is a pretty large set
- digitalzombie 13y agoErlang scheduler time share each processes. So if you have an infinite forloop, it while stop for several ms for other processes to run. Preemptive scheduler, I doubt Go have this, then again Go doesn't have a VM/OS system.
- kapilvt 13y agogo 1.2 has preemptive scheduling http://golang.org/doc/go1.2#preemption http://golang.org/doc/go1.2#preemption
- jerf 13y agoIn fairness, it's worth pointing out that Go 1.2 has partial preemption. Preemption is still checked only on function entry. However, unlike something like Node, this is not built in the language semantics, it's a characteristic of the runtime, and I imagine over time this will be fixed.
- voidlogic 13y ago>Preemption is still checked only on function entry. And I believe also heap allocation... the two cases together make what is still "partial preemption" pretty damn effective.