Elixir

  • Is a functional programming language
  • Is metaprogrammable ( dynamic )
  • Runs on top of the Erlang VM

No objects

Only modules

defmodule Calc do
  def sum(a, b) do
    a + b
  end
end

# And we call it elsewhere as:
# Calc.sum(2, 3)
# => 5

Tooling

Mix - build tool: tasks for creating, compiling, testing, manages dependencies, more

ExUnit - Test unit framework

IEx - REPL

Hex - Package Manager

OTP - Set of libraries that ships w/ Erlang. Used to build robust, fault-tolerant applications

# In Elixir, the = operator is actually called the match operator


iex> x = 1
1
iex> 1 = x
1
iex> 2 = x
** (MatchError) no match of right hand side value: 1
# In Elixir, the = operator is actually called the match operator


iex> x = 1
1
iex> 1 = x
1
iex> 2 = x
** (MatchError) no match of right
                hand side value: 1

Elixir / Phoenix

By José Duarte

Elixir / Phoenix

  • 224