↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Go and Elixir - Separated at Birth?

The author compares Elixir (and Erlang) to Go in how they handle concurrency, noting that both use patterns where isolated processes communicate via messages, akin to the Actor model. After reflecting on an article about the end of performance gains from Moore’s law and the shift to multi-core processors, they argue that efficient algorithms and good resource management are becoming crucial. In this context, they express doubts about Ruby’s long-term viability because it is interpreted and lacks strong support for true concurrency, suggesting compiled languages and more robust concurrency primitives as a better path.

Reading notes
#

  • Elixir and Erlang handle concurrency with many small processes that each have a single responsibility, following the Actor model.
  • The author finds process communication in Elixir and Erlang particularly easy compared to other environments.
  • Go also makes inter-process (goroutine) communication relatively easy, though the author finds it less straightforward than in Elixir.
  • In Go, concurrency is based on goroutines, and communication between them or with the main process happens via channels.
  • Go’s concurrency philosophy is summarized as sharing state by communicating instead of communicating through shared state.
  • The author realizes that Go’s approach is essentially the same pattern used in Elixir for concurrency.
  • They mention having heard that Scala and Clojure use similar patterns to manage concurrency effectively.
  • The author wonders if there is a growing consensus in the programming community around this kind of concurrency model.
  • After reading a Nature article, the author notes that CPU clock speeds have plateaued due to heat and power constraints.
  • Processor performance has been improved recently by adding more cores instead of making individual cores faster.
  • The author describes this multi-core shift as a workaround that is also approaching its limits.
  • They argue that future software must rely on efficient algorithms and careful resource management rather than expecting ever-faster hardware.
  • The author questions Ruby’s place in this future, given performance and concurrency demands.
  • They point out that Ruby, as an interpreted language, is significantly slower than compiled languages from the start.
  • The author sees Ruby’s lack of true concurrency support as a more serious long-term problem than interpretation overhead.
  • They consider that MRI Ruby might be replaced in practice by JRuby, which offers true threading.
  • Threaded programs are described as prone to difficult and subtle bugs, which complicates relying on threads alone.
  • The author suggests that using a compiled language is likely more efficient over time than sticking with JRuby in its current form.
  • They express pessimism about Ruby’s future unless it gains much stronger concurrency primitives.