6 ms·
How does Go compare to Erlang these days? When would you choose one over the other?
by amaccuish 8y ago
How does Go compare to Erlang these days? When would you choose one over the other?
- qaq 8y agoNot sure where I would choose Go, but Elixir + Rust is an extremely capable combo for BEAM (Erlang VM) projects.
- Thaxll 8y agoErlang is slower, and beam is not relevant anymore with kubernetes and the like which are much more powerful and language neutral.
- brightball 8y agoI keep hearing stuff like that but it’s not even close to accurate. BEAM and Erlang give you tooling that you can’t get from any other language, regardless of how it’s deployed. Using Kubernetes doesn’t make up for any of that...it just gives you a way to deploy containers.
- Thaxll 8y agoWhat tooling please give an example.
- edholland 8y agostrictly ordered message queues between processes
- brightball 8y agoFor a detailed example, just see the previous posted. There’s a lot. https://news.ycombinator.com/item?id=13497505 https://news.ycombinator.com/item?id=13497505
- battlebooth 8y agoI dont know whether this is a good thing or not.... The best nuggets of information on HN are at the mercy of a good soul digging up the link and dropping it on a new thread. You'd think that this knowledge retrieval/storage problem could have a more elegant solution built by the HN folks. Example solution: Topic X stored in category, ranked to the top, its next 'commit' or successor is chained on kind of like how unroll works with twitter.. but with long HN threads instead. Think a 'git tree' of knowledge descending down, with merges too maybe... Engh.. maybe thats part of the charm of HN... the old school style message board.
- pdimitar 8y agoThe machinery of the BEAM is in-process (and between nodes when you need it). Kubernetes and the BEAM VM address different levels of the architecture. Apples to oranges.
- amelius 8y agoI 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.
- brightball 8y agoPrevious discussion https://news.ycombinator.com/item?id=13497505 https://news.ycombinator.com/item?id=13497505
- amaccuish 8y agoThanks. Did a search before asking but couldn't find anything. Sorry to rehash!
- brightball 8y agoEasy enough to miss. That one is Elixir and Go but for most purposes Elixir/Erlang/BEAM are fairly interchangeable.
- battlebooth 8y agoNo. Thank You. Go vs Erlang/Elixir back n' forths are the reason I read HN comments!
- masklinn 8y agoNo change from when Go was released AFAIK: Go has no reliability/failover story (whether locally or in terms of distribution), uncaught panics will bring down the entire system, and the runtime has no support for routine hierarchies. So I guess you'd choose Go if you want to build a local service — especially if it has some amount of concurrency (e.g. network daemons) — or CLI tools (fast startup). You'd use erlang if you want to build a system which really should not die, especially if it so should not die that you're willing to spread it over multiple physical machines.
- anonymous_fun 8y agoNot an expert, nor to take anything from Erlang (was amazed at how robust RabbitMQ was first time I stress tested it) but fault tolerance seems to be a part of OTP. To me, k8s ~ OTP, GO ~ Erlang, and Erlang syntax is a bit easier than GoLang, but might just be the way I was brought up.
- masklinn 8y agoOTP is the standard distribution & library of Erlang, and most of the fault tolerance is either that or the core Erlang runtime e.g. supervisors are part of the standard library[0] and the underlying systems are basically built into the language[1]. Distribution is likewise built into the runtime and language, most of the distribution-related BIFs are not only part of the "erlang" module/namespace but also part of its "prelude" (auto-imported in all modules by default). So no, it is absolutely nothing like kubernetes in relation to go. [0] http://erlang.org/doc/man/supervisor.html http://erlang.org/doc/man/supervisor.html [1] http://erlang.org/doc/reference_manual/processes.html#id88612 http://erlang.org/doc/reference_manual/processes.html#id8861...
- sheeshkebab 8y agoI think parent was referring to similarity of k8s to OTP from user's prospective..
- 8y ago