background preloader

Elixir

Facebook Twitter

Elixir/Phoenix — Build a simple chat room – Stephan Bakkelund Valois. Hello, how are you?

Elixir/Phoenix — Build a simple chat room – Stephan Bakkelund Valois

In this blog post I want to discuss how to write a very simple chat room with a list of online users. The user will need to register an account before being able to enter the chat room. We will use both elixir and JavaScript, as well as a brand new authentication package I’ve been dabbling a bit with. Modules and dependencies Coherence “Coherence is a full featured, configurable authentication system for Phoenix”For those of you who are coming from Ruby on Rails, this package will look familiar to the lovely Devise gem. Phoenix Channels For client-server communication over web sockets. Phoenix Presence Provides tracking for processes and channels.

Setting up the project We’ll start off by creating our new project, I will call mine Chatourious: Take Off With Elixir – Big Machine. Elixir and IO Lists, Part 1: Building Output Efficiently. Poteto/elixirconf-2016: ElixirConf 2016 summary. Elixir.md. (my response to I haven't yet came across readily available resources for large-scale application architecture for Elixir apps.

elixir.md

I found Programming Phoenix to be a good start for that though. And there's ~30 years of knowledge in the Erlang land :) For web apps, I found the abstractions that Elixir/Phoenix provides to be really helpful. Indeed, the list below is somewhat ORM focused. In the small, Ecto.Schema, Ecto.Query, Ecto.Changeset, and Phoenix.View allow me to build highly composable and side-effect free modules. In the large, one builds the system out of modules and applications (collection of modules). Elixir RAM and the Template of Doom. Elixir — Where is your state? 06/04/16 by Markus Krogemann No Comments In this post, we will look at Elixir’s Agent abstraction, which provides a way to manage state in an Actor-based, functional programming environment.

Elixir — Where is your state?

We will also look in more detail into its building blocks, implemented in Erlang/OTP. Along the way, an implementation of TicTacToe will serve as an illustrating example. State So what is the issue with state? Real-world IT systems however are regularly faced with the task to maintain state, be it in some external storage system, or in memory/at runtime. TicTacToe Kata For this post, I have implemented a solution to the TicTacToe kata. Solution Design The implementation is available on github and consists of four Elixir modules, dealing with different aspects such as UI, game logic and state handling. Model The game state is modeled as a map, using three lists to represent the three rows of the game’s grid plus some additional fields such as the player who is to make the next move.

Agent Testing Conclusion. Which Elixir books should I read? Tl;dr: Programming Elixir then Elixir in Action.

Which Elixir books should I read?

Skip Programming Elixir if you're already familiar with functional languages, pattern matching, etc. Elixir has some great books for such a relatively new language. This post is a mini review of the ones I've read and what I'd recommend you read if you've limited time/budget. Elixir School · Elixir School. DRY’ing Elixir Tests with Macros – Eidge's Blog – Full-time geek with a crush on full-stack dev and biz. Paragliding pilot.

I’ve been experimenting with Elixir/Phoenix for a while now and I must say it has been an excellent journey.

DRY’ing Elixir Tests with Macros – Eidge's Blog – Full-time geek with a crush on full-stack dev and biz. Paragliding pilot.

Phoenix brings Rails happiness and productivity without imposing to much of its ideology upon you. Which to be honest is kind of refreshing. This week I set up user authentication using Guardian and, as an avid RSpec user, I wondered what the shared_examples_for [1] would like in Elixir. If you don’t know RSpec, shared_examples_for let you share test cases between different test collections.

One common use for such would be making sure your endpoints are being authenticated correctly. It looks mostly like this: A lifetime with Ruby has grown in me a distaste for DSLs, albeit good looking, when used too often they tend to obscure simple concepts. With Elixir, I didn't want to add another DSL just for sharing tests across units.

Let’s start with a simple, vanilla exUnit test: While this works, my OCD can’t bare the amount of repetition that’s going around. Sans titre. Workshop - All Aboard The Elixir Express! - RailsConf 2014. Is the Elixir ecosystem “mature” enough for production apps? Learn elixir in Y Minutes. Elixir is a modern functional language built on top of the Erlang VM.

Learn elixir in Y Minutes

It’s fully compatible with Erlang, but features a more standard syntax and many more features. Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself! Programming Elixir. Elixir is a modern, functional programming language designed for high availability and concurrency.

Programming Elixir

It has Ruby-like syntax married to the power and reliability of the Erlang VM. If you wanted to get into functional programming but were put off by the academic feel, now’s the time to jump in. Études for Elixir.