Jesper L. Andersen

CS hacker, researcher, and investigator.


Erlang and code style

Musings on mostly defensive programming styles


Correct Erlang usage mandates you do not write any kind of defensive code. This is called intentional programming. You write code for the intentional control flow path which you expect the code to take. And you don’t write any code for the paths which you think are not possible. Furthermore, you…


On Scalability, Capacity, and Sensitivity

Often, when one hears the word “Scalable” used in a context, it is used in an informal way. It is a fuzzy term, used by people to say that their system can handle the future. As if one has divine knowledge of what happens.

What is often meant is how the system handles additional load, for some measure of load. That is, if a…


Breaking Erlang Maps #4

In this update, we continue the work on QuickChecking Erlang maps, and extend the model further by adding more layers on top of what we already have. There are already previous parts:


Breaking Erlang Maps #3

Easter hacking on the Maps Erlang QuickCheck model is progressing nicely. And I have new interesting findings to report. I started by trying to generate very large maps, in order to get some collisions on the underlying hash value. At 25.000 elements and a 32-bit hash, we can approximate the chance of a collision by a Taylor expansion of the birthday paradox. If we take


Breaking Erlang Maps #2

This is part 2 in my work on using QuickCheck for Erlang to find errors in maps. The first part was already posted on medium:


Breaking Erlang Maps #1

Introduction

Erlang got a new data structure in release 17.0, the map(). This structure is a finite mapping from keys to values with a flat internal representation: a map is essentially two arrays: one of sorted keys and one of values. In turn, maps in this so-called flatmap representation are efficient for small map sizes, but they don’t perform…


Solving the Go Challenge 1 in Erlang

The first Go challenge is over. So by now, I can take my Erlang solution and write about how you would go around solving the challenge in Erlang. I’m deliberately skipping some details in Erlang, so don’t expect me to explain all the nitty-gritty parts. I do hope a reader with some programming language experience can follow along, even if you have had…


Ranking 4 Million Quake Live duels in 1.5 seconds.

The last couple of days, I’ve been toying with a little hobby project of mine.

The project is to rank players which player Quake Live duels, and I have reported on it before. I’ve been gathering duels since February 2012 up to now. The project is written as a hybrid. Most of the code for storage, retrieval and…


ProgLang design with evidence

Let us assume the programming language market is effective and free. In this case, the best programming languages are the most popular ones: PHP, Javascript, Java, C#, C, C++ and so on. By definition, fringe languages can’t be the best languages. New fringe languages, like Go and Rust still has a chance in this world order, but long-time languages like Common…


Codes of Conduct

This is a plea. It seems we are stuck with So-called “Codes of Conduct” (CoC) in many projects now. So we better handle them with care, and I need a piece of text to refer to so I can give my stance toward them.

It seems CoCs stem from ancient times where they defined rules and responsibilities for parties, groups, or organizations. Some of these, like “The…


Mnesia and CAP

We start out with the TL;DR treatise: The mnesia database is not CP, nor AP. And it cannot be CA, because CA doesn’t make any meaningful sense. In short, it is broken with respect to the CAP theorem.

Note: Things get subtle once you begin digging into the intricacies of the CAP theorem. I am not a native speaker of English, though Danish is “dangerously close”…