Concurrency Comparison: Go v/s Elixir
January 28, 2025 · View on GitHub
Goroutines = CSP Process
- One goroutine only knows about channels, its not aware about other goroutines.
- There are anonymous
- Message passing is synchronous.
- Go routines are managed by Go runtime.
- Avg size in order on 2KB.
Example
go someFunction()
Elixir Process = Actor Model
- Processes communicate directly to each other
- Elixir process has an id (non-anonymous).
- Managed by BEAM Virtual Machine.
- Separate stack & heap.
- Average size of 0.5KB.
Example
spawn(fn -> ... end)
Resources
- Anna Neyzberg & Hannah Howard - Go vs Elixir: A concurrency comparison | Code BEAM SF 19
- Discussion on r/elixir about Go v/s Elixir
- The Soul of Erlang and Elixir • Sasa Juric • GOTO 2019 - MUST WATCH!
- Comparing Elixir and Go
- Elixir and The Beam: How Concurrency Really Works