Illustration
Abstract.

Describe the role of schedulers.

  1. CPU → BEAM → Scheduler
  2. BEAM → List Process
  3. A scheduler distribute the CPU time accross the processes of the associated BEAM.

Why Elixir?

  1. Less code than Erlang, thanks to Lisp like macros.

How many OS processes does the BEAM use?

1

How to define structures?

To define a structure $Name:

defmodule $Name do defstruct $fields $code end

Given a structure definition $Name, how to use it?

  1. Build an instance i.
  2. Read fields of i.
  3. Derive other instances from i.
  4. Use it like a Map without the protocols.
  1. We observe that:
    1. Given appropriate A and B:
    2. Enum.map : List(A) (A → B) → List(B)
    3. Enum.map : Range(A) (A → B) → List(B)
  2. How does it work?

This is an instance of parametric polymorphism.

  1. If: an actor act satisfies the Enumerable protocol,
  2. then: the Enum procedures are defined on act.

All instances of List and Range implement the Enumerable protocol.

Define how to build a protocol Proto.

The procedure du build a protocol Proto is:

  1. Build a new module called Proto using the defprotocol macro.
  2. Add procedure specification to the module.

Example:

defprotocol Proto do def area(term) end

Define how to use a protocol Proto

  1. Using a protocol Proto means that a module implements its procedures.
  2. If Elixir evaluated this code, then: the module Mod implements the protocol Proto. defimpl Proto, for: Mod do def area(term), do: # return the area of term, instance of Mod. end

What is an OTP compliant process?

  1. If: a process implements an OTP behaviour — e.g. GenServer or Supervisor,
  2. Then: it is an OTP compliant process.
  1. Only new ideas are recorded here.
  2. We use the Actor Model metaphor for a few interpretations.