Discover this podcast and so much more

Podcasts are free to enjoy without a subscription. We also offer ebooks, audiobooks, and so much more for just $11.99/month.

Actor Model and Concurrent Processing in Elixir vs. Clojure and Ruby with Xiang Ji & Nathan Hessler

Actor Model and Concurrent Processing in Elixir vs. Clojure and Ruby with Xiang Ji & Nathan Hessler

FromElixir Wizards


Actor Model and Concurrent Processing in Elixir vs. Clojure and Ruby with Xiang Ji & Nathan Hessler

FromElixir Wizards

ratings:
Length:
48 minutes
Released:
Dec 21, 2023
Format:
Podcast episode

Description

In this episode of Elixir Wizards, Xiang Ji and Nathan Hessler join hosts Sundi Myint and Owen Bickford to compare actor model implementation in Elixir, Ruby, and Clojure.
In Elixir, the actor model is core to how the BEAM VM works, with lightweight processes communicating asynchronously via message passing. GenServers provide a common abstraction for building actors, handling messages, and maintaining internal state. In Ruby, the actor model is represented through Ractors, which currently map to OS threads.
They discuss what we can learn by comparing models, understanding tradeoffs between VMs, languages, and concurrency primitives, and how this knowledge can help us choose the best tools for a project.
Topics discussed in this episode:
Difference between actor model and shared memory concurrency
Isolation of actor state and communication via message passing
BEAM VM design for high concurrency via lightweight processes
GenServers as common abstraction for building stateful actors
GenServer callbacks for message handling and state updates
Agents as similar process abstraction to GenServers
Shared state utilities like ETS for inter-process communication
Global Interpreter Lock in older Ruby VMs
Ractors as initial actor implementation in Ruby mapping to threads
Planned improvements to Ruby concurrency in 3.3
Akka implementation of actor model on JVM using thread scheduling
Limitations of shared memory concurrency on JVM
Project Loom bringing lightweight processes to JVM
Building GenServer behavior in Ruby using metaprogramming
CSP model of communication using channels in Clojure
Differences between BEAM scheduler and thread-based VMs
Comparing Elixir to academic languages like Haskell
Remote and theScore are hiring!
Links mentioned in this episode:
theScore is hiring! https://www.thescore.com/
Remote is also hiring! https://remote.com/
Comparing the Actor Model and CSP with Elixir and Clojure (https://xiangji.me/2023/12/18/comparing-the-actor-model-and-csp-with-elixir-and-clojure/) Blog Post by Xiang Ji
Comparing the Actor model & CSP concurrency with Elixir & Clojure (https://www.youtube.com/watch?v=lIQCQKPRNCI) Xiang Ji at ElixirConf EU 2022
Clojure Programming Language https://clojure.org/
Akka https://akka.io/
Go Programming Language https://github.com/golang/go
Proto Actor for Golang https://proto.actor/
RabbitMQ Open-Source Message Broker Software  https://github.com/rabbitmq
JVM Project Loom https://github.com/openjdk/loom
Ractor for Ruby  https://docs.ruby-lang.org/en/master/ractor_md.html
Seven Concurrency Models in Seven Weeks: When Threads Unravel (https://pragprog.com/titles/pb7con/seven-concurrency-models-in-seven-weeks/)by Paul Butcher
Seven Languages in Seven Weeks (https://pragprog.com/titles/btlang/seven-languages-in-seven-weeks/) by Bruce A. Tate
GenServer https://hexdocs.pm/elixir/1.12/GenServer.html
ets https://www.erlang.org/doc/man/ets.html
Elixir in Action (https://pragprog.com/titles/btlang/seven-languages-in-seven-weeks/) by Saša Jurić
Redis https://github.com/redis/redis
Designing for Scalability with Erlang/OTP (https://www.oreilly.com/library/view/designing-for-scalability/9781449361556/) by Francesco Cesarini & Steve Vinoski
Discord Blog: Using Rust to Scale Elixir for 11 Million Concurrent Users (https://discord.com/blog/using-rust-to-scale-elixir-for-11-million-concurrent-users)
Xiang's website https://xiangji.me/
Feeling Good: The New Mood Therapy (https://www.thriftbooks.com/w/feeling-good-the-new-mood-therapy-by-david-d-burns/250046/?resultid=7691fb71-d8f9-4435-a7a3-db3441d2272b#edition=2377541&idiq=3913925) by David D. Burns Special Guests: Nathan Hessler and Xiang Ji.
Released:
Dec 21, 2023
Format:
Podcast episode

Titles in the series (100)

Elixir Wizards is an interview-style podcast for anyone interested in functional programming and the Elixir Programming Language. Hosted by SmartLogic engineers Sundi Myint, Owen Bickford, Bilal Hankins, and Dan Ivovich, this show features in-depth discussions with some of the brightest minds in the industry, discussing training and documentation in Phoenix LiveView, the evolution of programming languages, Erlang VM, and more. In the current season, we're celebrating a decade of Elixir and exploring what the next ten years hold for this powerful language. With expert insights from guests including José Valim, Hugo Baraúna, and Saša Juric, we discuss emerging trends in cyber security, cloud infrastructure, web transports, machine learning, static vs dynamic types, and what the future might hold for Elixir developers. Learn more about how SmartLogic uses Phoenix and Elixir. (https://smartlogic.io/phoenix-and-elixir?utm_source=podcast)