The slides
ODP (LibreOffice/OpenOffice) — Slides and notes (6.6 MB)
PPT (Office) — Slides and notes (6.8 MB)
PDF — Slides only (5.9 MB)
PDF — Slides and notes (7.4 MB)
The Phoenix demo app — GitHub, with authentication, admin scope and a chat with channels.
The video
I suggest you watch the video together with the slides embedded at the bottom of it. The ones in the video are too far away to be readable.
I googled the answers to some questions that have been made to me in the Q&A session.
- Can Elixir run on a Raspberry PI? Instructions here.
- Can we call Erlang from Ruby? Probably yes, with ErlPort.
The videos of all the other presentations at Ruby Day 2014 are here.
Elixir resources
Crash Course — elixir-lang.org
Getting Started — elixir-lang.org
elixir-lang/elixir — GitHub
Elixir Conf 2014 - Introduction to Elixir for Rubyists — YouTube, 50'37"
Elixir for Rubyists — slideshare
Elixir Sips — RailsCasts for Elixir
Understanding Elixir Macros — fundamental posts about Elixir metaprogramming.
Elixir's New Continuable Enumerators — elixir-lang.org
OTP
OTP is (more or less) the Erlang standard library. Some modules are wrapped by Elixir ones, some must be called directly.
Erlang/OTP — www.erlang.org
Phoenix resources
phoenixframework/phoenix — GitHub
Programming in Elixir with the Phoenix framework building a basic CRUD app
Phoenix guides — GitHub
Other web frameworks
Dynamo — Sinatra style
Weber — Rails style
Misc
A Week with Elixir — Erlang's creator thoughts about Elixir
How to start
Install Erlang
This is a requirement for Elixir. Install prebuilt packages following the instructions for your OS at https://www.erlang-solutions.com/downloads/download-erlang-otp
# The Ubuntu version $ wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb $ sudo dpkg -i erlang-solutions_1.0_all.deb $ sudo apt-get update $ sudo apt-get install erlang # Install the high performance runtime $ sudo apt-get install erlang-base-hipe # To return to the standard runtime # sudo apt-get install erlang-base
Install Elixir
Installers for most OSes are linked at this page.
You might also want to get the latest stable version of Elixir from GitHub. Check what's available now. Updates are frequent.
# Compiling from sources $ wget https://github.com/elixir-lang/elixir/archive/v1.0.0.tar.gz $ tar xzf v1.0.0.tar.gz $ cd elixir-1.0.0/ $ make $ make test $ sudo make install $ iex Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Interactive Elixir (1.0.0) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> IO.puts "Good to go!" Good to go! :ok iex(2)> i^C BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution a
Install Phoenix and create a project
$ cd $ git clone https://github.com/phoenixframework/phoenix.git $ cd phoenix $ mix do deps.get, compile # From this directory! Important! $ mix phoenix.new my_project ~/my_project $ cd ~/my_project $ mix do deps.get, compile $ mix phoenix.start
Go to http://localhost:4000 (NoScript will complain about this link)
$ git init $ git add config/ .gitignore lib/ mix.exs mix.lock priv/ README.md test/ web/ $ git commit -a -m "Empty project"
Console, which also serves web requests!
$ iex -S mix phoenix.start
Debugger
Add this into the function you want to debug
require IEx.pry def func do ... IEx.pry ... end
Run the process with a shell, wait for the pry request to debug. Type Y.
$ iex -S mix phoenix.start ... Request to pry #PID<0.299.0> at your_program.ex:26. Allow? [Yn] Y pry(1)>
Break in case of danger!
If you run into an error that you really (really!) can't explain maybe the dependencies got messed up.
This might fix it.
mix deps.clean --all mix do deps.get, compile