ElixirConf 2023 - Jason Stiebs - A LiveView is a Process

Discover the process model in AirLang, a concurrency-centric language, where every process runs in isolation, communicates through message passing, and is managed by the scheduler for efficient execution at ElixirConf 2023.

Key takeaways
  • Every process is completely isolated and runs in serial, with no shared memory or CPU.
  • Processes communicate with each other through message passing, which is copied, not referenced.
  • In AirLang, every process is a gen server, and LiveView is a gen server that runs in a process.
  • The scheduler is responsible for managing processes and allocating CPU and RAM, and is able to run multiple processes concurrently.
  • The scheduler uses heuristics to determine which process to run next, based on factors such as CPU usage and RAM availability.
  • Processes are immutable, and any changes to state are made by sending new messages to the process.
  • LiveView is a process that monitors a browser process and communicates with it through message passing.
  • The process model is similar to a traditional CPU, where each process runs in serial and communicates with other processes through message passing.
  • Processes can be thought of as a fundamental unit of execution, and are the basis for concurrency and parallelism in AirLang.
  • The scheduler is able to handle millions of processes per second, and is able to restart processes if they crash or exit.
  • The dbg module in AirLang allows for tracing and debugging of processes, and can be used to monitor and debug LiveViews.
  • The microsecond symbol in the logs is a useful tool for debugging processes and understanding the timing of events.
  • In Elixir, processes are identified by their PIDs, which are globally unique and can be used to send messages to specific processes.
  • The self function in Elixir returns the current process ID, which can be used to send messages to the current process.
  • The spawn function in Elixir is used to start a new process, and can be used to create a new process to handle a specific task.
  • The receive function in Elixir is used to wait for a message from another process, and can be used to implement a receive loop in a process.