I & you
hot & ice
stand up & lie down
inside & outside
Slide 10
Slide 10 text
stateless & stateful
Slide 11
Slide 11 text
Function is stateless. f : x -> y
e.g. Web server
Slide 12
Slide 12 text
Dialogue is stateful.
Alice : X.
Bob : Y.
Alice : X.
Bob : Z.
Most of the system is stateful.
Slide 13
Slide 13 text
Elixir
Slide 14
Slide 14 text
Elixir is a functional programming language.
Functional programming is stateless.
All data of Elixir is immutable.
[x, 3, x] = Enum.map([1,2,1], &(&1 + 1))
assert 2 == x
// Many lines that don't reassign to `x`.
assert 2 == x
State should be updated in a transaction.
State shold interact & isolate each other.
Accessing to state should be scaled in-out.
Server with state should be updated gracefully.
Elixir has all of these!
Slide 18
Slide 18 text
State should be updated in a transaction. (No shared
state)
State shold interact & isolate each other. (Application,
Supervisor)
Accessing to state should be scaled in-out. (GenStage,
Task, Register, Erlang cluster)
Server with state should be updated gracefully. (Hot
code swap)
Slide 19
Slide 19 text
We can create stateful system easy, by constructing
stateless parts.
Slide 20
Slide 20 text
How we can start Elixir?
Let's create some applications.
* Web application with Phoenix.
* Slack bot.
Slide 21
Slide 21 text
Phoenix is a Web application framework that familiar
with WebSocket.
https://hexdocs.pm/phoenix/overview.html
Slide 22
Slide 22 text
React is available (✿
>ヮ ╹
)-♡
Let's create a realtime interaction ∩
(> ◡
<*)∩
♡
https://speakerdeck.com/ne_sachirou/phoenix-livereact
Slide 23
Slide 23 text
Create a Slack bot.
https://github.com/BlakeWilliams/Elixir-Slack
(Easy, so no topic.)