Created Elixir on 2012
Ex-member of Rails Core Team
Platformatec
2 Million concurrent connections in a single machine using Erlang and just 10 developers.
Created on 1986
Ericsson Computer Science Lab
Open Telecom Platform (OTP)
Open sourced on 1996
Fault-tolerant
Concurrent
Distributed
Functional
I liked everything I saw in Erlang, but hated the things I didn't see.
- Jose Valim
Unfriendly Syntax
Unreadable Macros
No Polymorphism
Lack of Web Tools
Runs in Erlang Virtual Machine
Can use any Erlang Module without penalty
Best suited for Web Application Development and Embedded System
Elixir is a dynamic, functional language designed for building scalable and maintainable applications.
- elixir-lang.org
Amazon
Yahoo!
Heroku
CouchDB
RabbitMQ
World of Warcraft
Ericsson
No please ...
"Hello World"
$ mix new tech_talk
...defmodule TechTalk do
def factorial(n) do
if n == 0 do
1
else
TechTalk.factorial(n-1) * n
end
end
end$ iex -S mix
...
iex> TechTalk.factorial(1000)
...defmodule TechTalk do
def factorial(0) do
1
end
def factorial(n) do
TechTalk.factorial(n-1) * n
end
endiex> TechTalk.factorial(1000)
...
iex> TechTalk.factorial(10000)
...
iex> TechTalk.factorial(100000)
...COMMUNICATION AMONG DISTRIBUTED APPS
$ iex --sname node_1$ iex --sname node_2$ iex --sname node_1
iex> Node.list
[]$ iex --sname node_2
iex> Node.connect(:node_2@host)
true
iex> Node.list
[:node_1@hostname]iex> defmodule TechTalk do
iex> def say_hello() do
iex> "Hello from the other side..."
iex> end
iex> end
...iex> Node.spawn_link(:node_1@host, fn () ->
IO.puts TechTalk.say_hello()
end)
"Hello Developers"
#PID<9785.108.0>The future will be functional and concurrent.
IoT
Realtime
Concurrency
Microservice
Distributed System
(REALTIME)
defmodule TechTalk.TalkChannel do
use Phoenix.Channel
def join("talk", _payload, socket) do
{:ok, socket}
end
def handle_in("message:new", payload, socket) do
broadcast!(
socket,
"message:new",
%{user: payload["user"], message: payload["message"]}
)
{:noreply, socket}
end
end(MICROSERVICE)
$ mix new tech_talk --umbrella
tech_talk
├── README.md
├── apps
├── config
│ └── config.exs
└── mix.exs(CONCURRENCY)
defmodule TechTalk.TableTennis do
def greet do
receive do
:hello ->
IO.puts "Hello Alchemist"
end
greet()
end
end
(IoT)
Craft and deploy bulletproof embedded software in Elixir
Hardware Support
Production in huge scale
Well written libraries
(Distributed System)
State Management
Application Discovery
Failure Detection
Hot Code Swapping
3000+
Elixir Forum Treads
17,415
Slack User
Registered
4,963
Stack Overflow
Question
Backed by Ruby, Erlang and Node.js community
540,625
Downloads
Yesterday
5,539
Packages
Available
157,370,966
All Time Downloads
Web Framework
Rails inspired
Developer Friendly
Super Fast (Microseconds)
Lots of Resources
Context (version 1.3)
Text
EVERYWHERE
Clean, Readable Syntax
Mature Tooling (30 years)
Built-in Unit Testing
Meta-programming
Built-in Documentation
Distributed System
Concurrency
Fault-tolerant
High Availability
Choose Elixir for the code,
not the performance.
Screencasts
dailydrip.com
elixirsips.com
Most Important Link