3 ms·
I believe GoLang supports efficient sharing of large data-structures between cores of the same processor, whereas ErlangLang does not.
by amelius 8y ago
I believe GoLang supports efficient sharing of large data-structures between cores of the same processor, whereas ErlangLang does not.
- masklinn 8y ago> I believe GoLang supports efficient sharing of large data-structures between cores of the same processor, whereas ErlangLang does not. AKA Go does shared-memory multitasking, while Erlang does shared-nothing multitasking.
- amelius 8y agoYes, and when used in an immutable way, the GoLang approach is very powerful and efficient, because it allows one to pass large (parts of) immutable data-structures without copying.
- jeremyjh 8y agoHow do I declare an immutable data structure in Go?
- jerf 8y agoAn unexported value type provided through an interface is immutable. The "context" object uses this. But it isn't really a solution for immutable value programming.
- jeremyjh 8y agoIts immutable everywhere, or just outside the package that declares it?
- jerf 8y agoOutside the package that declares it, though if you have it as an interface value you'd have to do work to penetrate it. Since it's not like I'm trying to sell this as a solution to all immutable data requirements, I didn't worry too much about that detail. In the end it's all about effort, anyhow; with the right invocations in Haskell I can mutate "immutable" data just fine. So even an interface in the package that declared it is still nontrivial protection against accidentally mutating it.
- RyanZAG 8y agoWhat about lists? Eg, an immutable list of packets.
- jeremyjh 8y agoI don't think thats really true about Haskell, unless you are talking about C code you've invoked through FFI in which case all bets are off in every language. Isn't it a lot simpler to just say that Go has no feature support for immutable data? The fact that you can hide accessors in a package is small comfort if I have to read all the source code in that package to know the actual semantics.
- darkr 8y agoAFAIAA, the only immutable core type in go is string.
- twic 8y ago"ErlangLang"?
- pritambaral 8y agoWhile 'ErlangLang' is obviously wrong, I should point out that the '-lang' part of 'Erlang' is not related to the root word 'language'. Perhaps the name 'Erlang' was chosen because it already ended in '-lang', perhaps not, I don't know. But it was quite likely named after the Danish mathematician Agner Krarup Erlang.
- haneefmubarak 8y agoIIRC "ERicsson LANGuage" because it was created for networking stuff at Ericsson. EDIT: Yep, we're actually both right! From the Wikipedia page: > The name "Erlang", attributed to Bjarne Däcker, has been presumed by those working on the telephony switches (for whom the language was designed) to be a reference to Danish mathematician and engineer Agner Krarup Erlang as well as a syllabic abbreviation of "Ericsson Language".