Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intro to Elixir
Search
Mario Alberto Chávez
November 05, 2015
Programming
0
150
Intro to Elixir
Presentation about Elixir programming language
Mario Alberto Chávez
November 05, 2015
Tweet
Share
More Decks by Mario Alberto Chávez
See All by Mario Alberto Chávez
Ruby Internals V3
mario_chavez
0
47
Beyond the Rails Way
mario_chavez
1
85
Elm, una mejor manera de hacer frontend
mario_chavez
0
210
Rediscovering ActiveRecord
mario_chavez
2
320
From Ruby to Elixir: Developing Web Applications
mario_chavez
0
400
Pitch para Startups
mario_chavez
1
120
Understanding KPIs
mario_chavez
1
82
Logic Programming
mario_chavez
0
100
El nuevo comercio electrónico
mario_chavez
0
63
Other Decks in Programming
See All in Programming
ReadMoreTextView
fornewid
1
470
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
310
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
800
Deep Dive into ~/.claude/projects
hiragram
7
1.3k
Effect の双対、Coeffect
yukikurage
5
1.4k
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
110
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
100
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
310
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
140
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
230
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
30k
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
A better future with KSS
kneath
239
17k
How STYLIGHT went responsive
nonsquared
100
5.6k
Raft: Consensus for Rubyists
vanstee
140
7k
Being A Developer After 40
akosma
90
590k
Designing for Performance
lara
609
69k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
700
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Docker and Python
trallard
44
3.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Transcript
Intro to Elixir Mario Alberto Chávez @mario_chavez
Compiles to BEAM byte code Runs on Erlang VM
Concurrency
Concurrency Lightweight processes |>Are applications |>Requires a minimum of 2k
of memory |>Are supervised |>Fault-tolerant |>Garbage collected independent |>Run on multicore machines
Concurrency Actor pattern |>Receive messages |>Process data |>Talk to other
processes |>Start new processes |>Respond to messages
Concurrency Distributed
OTP is simple to design complex systems
Functional
Functional Unlearn OO |>Inmutable data |>No objects |>No classes |>No
Inheritance
Functional Functions transform data |>Small and focused |>Composable |>Repeatable |>Don’t
have side effects |>Data is passed by Value
Simple, clean, fun syntax
Atoms :ok, :accepted
Tuples { :ok, 1, “data” }
Lists [1, “data”, :ok, {“a”}]
Maps data = %{ name: “Mario”, language: “Elixir” } data.name
=> “Mario” data[:language] => “Elixir
Keywords List data = [name: “Mario”, language: “Elixir”] data[:name]
=> “Mario” data.name ** (ArgumentError) argument error
Ranges (1..5)
Functions adder = fn(a) -> fn(b) -> a + b
end end add2 = adder.(2) add.(3) => 5
Inline functions Enum.map([1, 2], fn(value) -> value * value end)
=> [1, 4] Enum.map([1, 2], &(&1 * &1)) => [1, 4]
Named functions defmodule Math do def add2(value) do value +
2 end end Math.add2(5) => 7
Pattern matching
Match operator = a = 1 => 1 1 =
a => 1 2 = a ** (MatchError) no match of right hand side value: 1 ^a = 2 ** (MatchError) no match of right hand side value: 2
Deconstruction list = [1, 3, 5, 7] [1, a |
tail] = list a => 3 tail => [5, 7]
Deconstruction data = %{ name: “Mario”, language: “Elixir” } %{
name: name } = data name => “Mario”
Multiple clauses require Integer, only: [is_odd/1] defmodule Math do def
mult(0), do: 0 def mult(x) when Integer.is_odd(x), do: x * 3 def mult(x), do: x * -3 end Math.mult(0) => 0 Math.mult(3) => 9 Math.mult(6) => -18
Functions composition
Pipeline [7, nil, 3, nil, 5, 1] |> Enum.filter(&(&1))
|> Enum.sort |> Enum.map(&(&1 * 2)) |> Enum.join(", ") => ”2, 6, 10, 14"
Many more
Metaprogramming Language extensibility |>Metaprogramming is core to Elixir |>Add new
functionality |>Create DSLs
mix Compilation and tasks tools |>Compiles code |>Execute tasks |>Creates
project template
hex package manager |>Resolves dependencies |>Install libraries
docs beautiful and complete help
Web development Phoenix Framework
Learn more Resources |>Elixir playground http://elixirplayground.com |>Slack channel for help
|>Programming Elixir Book
Intro to Elixir Mario Alberto Chávez @mario_chavez