> How I Fell in Love with Erlang_

31 Oct 2025

How I Fell in Love with Erlang

When Math Lies

I was eight years old when I first tried to hack the intro screens of Commodore-64 games. I found a BASIC programming book and opened it with all the enthusiasm of a kid who thought he was about to unlock the secrets of the universe. Page after page of mysterious commands, strange symbols, promises of power.

And then I saw it:

10 X = 5
20 X = X + 1
30 PRINT X

I closed the book.

X equals X plus one? That’s not math. That’s a lie. Zero can’t equal one. This was nonsense, and I wanted nothing to do with it.

Little did I know that this moment of confusion would define the next two decades of my life.

The Years of Cooking Without a Recipe

Years passed. I played games, broke things, learned just enough to be dangerous.

Then university happened. First year, sitting in the library, and there it was: The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie. The famous K&R book. The Bible.

I opened it.

I didn’t understand anything.

void swap(int *a, int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}

What is `a? Why the asterisks? What doesvoid` mean? Why are there two stars?*

But something was different this time. Instead of closing the book, I started cooking. I didn’t understand the recipe, but I started mixing ingredients anyway.

This led to what I now call my “Linux formatting era.” I had two partitions on my home computer:

  • Partition 1: Championship Manager (because priorities)
  • Partition 2: Shell, compiling, and breaking the system

I formatted Linux so many times that I could do it in my sleep. Every experiment, every compilation error, every segmentation fault was a lesson. I was learning by destroying and rebuilding, over and over.

X = X + 1 was starting to make sense, but only in the most mechanical way. I could write loops. I could increment counters. But I still didn’t feel it.

The Question That Changed Everything

During those years, while I was formatting Linux partitions and debugging segfaults, I had another life: competitive bridge. I was good enough to make the national team, spending weekends at tournaments, playing hands with people who could calculate odds in their sleep.

One of my partners was an older engineer. Between games, after a particularly brutal hand, he asked me a simple question:

“How can you sum the numbers from 1 to 10 without using a loop?”

I stared at him.

“Without a loop? I just learned x = x + 1. Are you kidding?”

He smiled. He knew something I didn’t.

Someone Is Finally Talking to Me

Not long after, I found a Prolog book. And there it was: recursion.

sum(0, 0).
sum(N, Result) :-
    N > 0,
    N1 is N - 1,
    sum(N1, Sum1),
    Result is N + Sum1.

Wait. What?

?- sum(10, X).
X = 55.

This wasn’t X = X + 1. This was Y = X + 1. This was a relationship. This was math telling the truth again.

Suddenly, that engineer’s question made sense. You don’t need loops. You don’t need mutation. You just need to describe what something is, not how to compute it step by step.

For the first time since that Commodore-64 book, I felt like someone was talking to me in a language I could understand.

The Swedish Connection

Bridge tournaments are funny places. You’re competing against people one moment, sharing stories the next. During a break at one tournament, I got to talking with a player from Sweden. The usual stuff at first—tough hands, bad luck, that feeling when you know your partner’s about to make a mistake and you can’t stop them.

Then, somehow, we got to programming.

“Have you heard of Erlang?” he asked.

“Erlang? No. What is it?”

“It’s from Sweden. From Ericsson. It’s for telecom systems. You can build distributed, fault-tolerant systems. It’s functional, like Prolog.”

Those were the days when we finally had internet at home. I was trying to write a multiplayer socket-based bridge game for our home network—something so my friends and I could play without being in the same room.

I went home. I found Erlang. I compiled it.

And I fell in love.

The Ping and the Pong

Let me show you what blew my mind. What made me stay up until 4am, what made me skip bridge practice, what made me realize I’d found something special.

I could write this:

Node 1 (ping.erl):

-module(ping).
-export([start/0, ping/1]).

start() ->
    register(ping, spawn(fun() -> ping(0) end)).

ping(Count) ->
    receive
        {pong, Pong_PID} ->
            io:format("Ping received pong (~p)~n", [Count]),
            Pong_PID ! {ping, self()},
            ping(Count + 1)
    end.

Node 2 (pong.erl):

-module(pong).
-export([start/0, pong/0]).

start() ->
    register(pong, spawn(fun pong/0)).

pong() ->
    receive
        {ping, Ping_PID} ->
            io:format("Pong received ping~n"),
            Ping_PID ! {pong, self()},
            pong()
    end.

Starting the magic:

% Terminal 1
erl -sname ping -setcookie secret
(ping@localhost)1> c(ping).
(ping@localhost)2> ping:start().

% Terminal 2
erl -sname pong -setcookie secret
(pong@localhost)1> c(pong).
(pong@localhost)2> pong:start().
(pong@localhost)3> {ping, 'ping@localhost'} ! {pong, self()}.

% Watch them talk to each other across nodes!

Two separate Erlang nodes. On different machines, different networks, different continents if I wanted. And they could just… talk. No HTTP. No REST API. No serialization headaches. Just message passing. Just actors doing their thing.

This was functional (no mutation, just recursion and pattern matching) and distributed (processes on different nodes) and fault-tolerant (if one crashes, the other keeps running).

This was everything I’d been searching for since I was eight years old and couldn’t understand why X could equal X plus one.

The Declaration

I was good at bridge. National team level. But when I found Erlang, the choice was easy.

I stopped going to tournaments. Stopped spending weekends calculating card probabilities. This strange, beautiful language from Sweden had shown me something more interesting than any hand of cards ever could.

Erlang wasn’t just a programming language. It was a philosophy:

  • Let it crash (don’t try to handle every error)
  • Processes are cheap (spawn millions if you want)
  • Share nothing (isolation is safety)
  • Message passing (communication without coupling)

It was functional programming and distributed systems and fault tolerance all in one elegant package.

I was in love.

If You Want to Understand Why

If you want to understand why Erlang captured my imagination, why it changed the way I think about building systems, watch this:

Erlang: The Movie

Erlang: The Movie

This video, made by the people who created Erlang at Ericsson, captures the spirit of what made me fall in love. The philosophy. The elegance. The sheer fun of building systems that don’t fall apart.


Welcome to my blog.

This is where I’ll share what I’ve learned over 30+ years of building software systems. From that confused 8-year-old closing a BASIC book to now.

I’ll write about Erlang, Elixir, functional programming, distributed systems, and all the things I wish someone had explained to me when I was young.

P.S.: Next posts will cover Clojure (JVM—you know why), then Scala, F#, and back to Elixir/Erlang with practical patterns and war stories. Stay tuned.