Phil was invited to speak at the Goto conference in Copenhagen last November. By now the video has been uploaded to Youtube for everyone to enjoy:


Clojure and ClojureScript provide fine-grained control over the state of a running application. Especially when combined with a reactive front-end framework like React, features like hot-swapping code reach far beyond simple live reloading.

Applying a reactive paradigm means that changing the data updates the user interface. Clojure's functional nature, with its strict separation of data and code, lets us use the reactive paradigm for...

Learning a new programming language can be hard. However, learning idiomatic JavaScript is not if you're already a Clojure developer. In fact, this statement could be extended to say that JavaScript will be rather easy to pick up for many developers that are knowledgeable in a functional programming language.

Generally speaking, functional programming can be boiled down to the idiom that you write your programs through intense usage of a few versatile data structures and many composable functions. Clojure is such a language. JavaScript initially was created with Scheme and Self in mind, therefore it supports both the paradigms...

This is a talk Alain gave at the Web Zueri Meetup in Zurich, Switzerland on July 24, 2018.

The complexity of software is growing at an exponential rate. The biggest challenge is the growing complexity of dynamic state which makes it hard to reason about a system. There are many paradigms aiming to ease the situation. To reduce incidental complexity "Functional Programming" and "Code Hot-Reloading" have become much talked about topics in the web development community.

In this talk, Alain shows how to supercharge your development setup with true code hot-reloading in a truly functional programming language.

Please find the slides and...

Redux is a popular choice when it comes to dealing with state in larger single page applications. But even smaller applications might benefit from a redux architecture. I will show you how to implement redux in less than 30 lines of ClojureScript to get a clean application structure and to reduce cognitive load.


(ns redux.reducer)

(defmulti Action
  (fn [state action]
    (:type action)))

(defmethod Action :default [state {:keys [type] :as action-data}]
  (prn "Action of " type "...

Today we are going to write a bot using Clojure to beat the game 2048. We are going to use a variation of the minimax algorithm called expectimax.

1. game rules

You can merge tiles by merging the whole board either horizontally or vertically. If you manage to get the 2048 tile, you win. After a merge (= player's turn), a tile will appear randomly on an empty slot. The chance of that tile being a 4 is 0.1, the chance of it being a 2 is 0.9. After reaching the 2048 you can keep playing and...

I'm happy to be able to share one of the building blocks of the software solution I'm currently working on: fsdb - a Clojure library that provides a reasonably convenient database on top of the file system.

Don't get me wrong, I'm not talking about a file system database like sqlite here. I'm using the term database loosly. Think of a bunch of config files that make up a database that you want to query. That's what fsdb can do for you. You point it to a directory and it reads the data from the directory tree and returns a...