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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Mario Alberto Chávez
November 05, 2015
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Elixir
Presentation about Elixir programming language
Mario Alberto Chávez
November 05, 2015
More Decks by Mario Alberto Chávez
See All by Mario Alberto Chávez
Ruby Internals V3
mario_chavez
0
70
Beyond the Rails Way
mario_chavez
1
130
Elm, una mejor manera de hacer frontend
mario_chavez
0
250
Rediscovering ActiveRecord
mario_chavez
2
350
From Ruby to Elixir: Developing Web Applications
mario_chavez
0
430
Pitch para Startups
mario_chavez
1
150
Understanding KPIs
mario_chavez
1
120
Logic Programming
mario_chavez
0
130
El nuevo comercio electrónico
mario_chavez
0
87
Other Decks in Programming
See All in Programming
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
240
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
760
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
100
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
6
1.1k
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
260
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
770
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
130
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
400
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Odyssey Design
rkendrick25
PRO
2
700
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
840
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
The untapped power of vector embeddings
frankvandijk
2
1.8k
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