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...

  • clojure
  • clojure
  • javascript
  • programming

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...

  • clojure
  • 200ok
  • talk
  • clojure
  • clojurescript
  • functional programming

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.

redux.reducer

...
  • clojure
  • clojure
  • redux
  • clojurescript
  • state management

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...

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...

  • clojure
  • opensource
  • clojure
  • filesystem
  • database

TL;DR I was looking for a prototype of a Clojure macro that fulfills three requirements: (1) Generates a function. (2) Takes options as parameters and provides those to the generated function. (3) And lastly the generated function takes arguments. Spoiler! This is it...

...
  • clojure
  • macro
  • metaprogramming
  • prototype