Elixir and Phoenix

Introduction

Saw a post on reddit about this new web framework phoenix. It is an elixir based framework. Elixir is based upon erlang. Erlang has been around a while (open-sourced in 1998) and is a massively scalable and highly reliable language used in telecoms, banking and instant messaging (among others).

Elixir brings very ruby-ish syntax to the language. Phoenix framework is like rails for elixir, and is pretty full featured.

Experimenting

To exercise the framework, I wanted to create yet another chat app.

This time using slash commands for text-based social actions.

For example typing :) Fred or /smile Fred the following would happen (assuming your username is Bob):

  • You would see You smile happily at Fred.
  • Fred would see Bob smiles happily at you.
  • Anyone else in the app would see Bob smiles happily at Fred.

Technical Details

Not much to say, using a pure functional language was tricky but doable once you get the hang of it. Going to leave it closed source for now. Will put more info here if that changes.

In the meantime there are some good tutorials out there:

Todo

I did not get around to testing the scalability of phoenix and the erlang virtual machine. I’ll just take their word for it for now.

Conclusion

Overall, if your used to ruby and rails, phoenix is not a far leap. Going functional requires a different mindset (its not like C).

Emotext Session


comments powered by Disqus