After a break in our “new lan­guages” series, today we present Elixir. This func­tion­al lan­guage, cre­at­ed in 2011 and using the Erlang VM, is known among oth­er things for its fault tol­er­ance and hot swap­ping.

Fifth major language

Elixir is the fifth “major” lan­guage to be sup­port­ed on always­da­ta. We recent­ly explained in detail what con­sti­tutes a major lan­guage, so we won’t reit­er­ate that here. We’ll just men­tion that we’re offer­ing the lat­est ver­sion of Elixir (1.5.2), oper­at­ing on Erlang 19.2, and that a new type of site has appeared in our admin­is­tra­tion pan­el.

Example: deploying a Phoenix application

Phoenix is one of the pri­ma­ry web frame­works for Elixir. Which is why it’s the one that we’ll be using in our deploy­ment exam­ple.

Let’s log into our SSH account, then install Phoenix, and cre­ate a new appli­ca­tion:


We need to edit the file config/prod.exs in such a way as to replace the line:


with:


Finally, we have to com­pile the appli­ca­tion:


Last step, let’s go into alwaysdata’s admin­is­tra­tion pan­el, then cre­ate an Elixir web­site and spec­i­fy:

  • com­mand: mix phx.server
  • work­ing direc­to­ry: myapp
  • envi­ron­ment: MIX_ENV=prod

And there you have it, our appli­ca­tion is reach­able via the web and will show Welcome to Phoenix!

Next lan­guage to get its moment in the blog’s spot­light: Java.