Articles

Xerl: empty modules

2013 30 Jan

Let's build a programming language. I call it Xerl: eXtended ERLang. It'll be an occasion for us to learn a few things, especially me. Unlike in Erlang, in this language, everything is an expression. This means that modules and functions are expression, and indeed that you can have more than one module per file. We are just starting, so let's no go ahead of ourselves here. We'll begin with writing the code allowing us to compile an empty module.

Read More

Build an FTP Server with Ranch in 30 Minutes

2012 14 Nov

Last week I was speaking at the London Erlang Factory Lite where I presented a live demonstration of building an FTP server using Ranch. As there was no slide, you should use this article as a reference instead. The goal of this article is to showcase how to use Ranch for writing a network protocol implementation, how Ranch gets out of the way to let you write the code that matters, and the common techniques used when writing servers.

Read More

Erlang Tic Tac Toe

2012 17 Oct

Everyone knows Tic Tac Toe, right? Players choose either to be the Xs or the Os, then place their symbol on a 3x3 board one after another, trying to create a line of 3 of them. Writing an algorithm to check for victory sounds easy, right? It's easily tested, considering there's only 8 possible winning rows (3 horizontal, 3 vertical and 2 diagonal). In Erlang though, you probably wouldn't want an algorithm.

Read More