Elixir is a functional, concurrent,
general-purpose programming
language that runs on the Erlang
virtual machine (BEAM).
https://en.wikipedia.org/wiki/Elixir_(programming_language)
Slide 3
Slide 3 text
defmodule ModuleName do
def hello do
IO.puts "Hello World"
end
end
http://elixir-lang.org/crash-course.html
Slide 4
Slide 4 text
IEx
Elixir’s interactive shell
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
Why would I want to
learn Elixir?
Why invest the time and effort? I’m happy with Ruby and OO.
Slide 7
Slide 7 text
Three Main Reasons
Spoiler Alert: Concurrency is not one of them.
Slide 8
Slide 8 text
1. Speed
Elixir runs circles around Ruby and Python.
Slide 9
Slide 9 text
2. Stability
Speed is nothing without stability.
Slide 10
Slide 10 text
3. Hot-Code Upgrades
Zero Downtime!
Slide 11
Slide 11 text
Some Code Examples
Slide 12
Slide 12 text
Assigning Values to
Variables
Slide 13
Slide 13 text
iex(1)> a = 1
1
iex(2)>
Slide 14
Slide 14 text
iex(1)> a = 1
1
iex(2)> a = 2
2
iex(3)>
Slide 15
Slide 15 text
iex(1)> a = 1
1
iex(2)> a = 2
2
iex(3)> ^a = 3
** (MatchError) no match of right hand
side value: 3
mix phoenix.new blog
Y
cd blog
vim config/dev.exs
brew install postgres
brew services start postgres
createuser -W --createdb blog
demo
mix ecto.create
mix phoenix.gen.html Post posts subject body
vim web/router.ex
resources "/posts", PostController
mix ecto.migrate
mix phoenix.server
Blog Example