Thoughts on representing variations and commenting on them


This is an exploratory post, trying to gather my thoughts on the topic and kindly requesting feedback.

I enjoy playing abstract board games: Go, TwixT, Hex, etc. I play Go on a torus board and TwixT on large boards. After playing a game, it’s helpful to be able to discuss what went right, what went wrong, and what could be improved. This is best done in the real world, but there are some wonderful facilities to do it online too. These use different ways to comment on games and show variations.

The three ways I’ve seen to comment on games and show variations/branches (do have a look at the linked examples; they’re much clearer than my explanations):

  1. The usual tree of moves (nodes) with comments on any node. Most popular, used by eg EidoGo, KGS, and Sabaki. Henceforth “tree”.
  2. A linear sequence of moves, with comments on any node creating expandable variations inline. Seen used only on GoKibitz. Henceforth “inline variations”.
  3. A linear sequence of moves, with a global linear sequence of comments. Each comment can show an arbitrary number of variations starting from any move. Seen used only on TwixT Commentator. Henceforth “global comments”.

The tree is the most ubiquitous, and I’m sure it’s the best if you want to analyze a game extremely thoroughly. The main drawback is that it’s not obvious in which order you should visit the variations and read the comments.

The inline variations allow you to go through the game and see the variations from each move as you visit it. If there are more comments by different people on these variations, they will be ordered by time and easily skimmable. I feel this is the better user experience than the tree, perhaps unless the variations are extremely numerous with a lot of branching (in which case no one will understand them anyway).

The global comments take inline variations to the extreme. It is a true conversation between people, you can see all the comments at once and choose which variations you want to explore based on the words that accompany them. I like this system a lot, though I guess it’s suited for light commentary and might fall apart for particularly heavily commented games.

Which one is the best depends on the use case. Analysing a situation to death requires different tools than two casual comments after the game. Still, I’m leaning towards the inline variations. They’re simple, and should be easy to convert to global comments, and also it should be easy to display the full tree from them. Appears to me like the most flexible solution, leaving the most doors open. (Not necessarily saying opening those doors is a good idea.)



He was smiling. An unassuming middle aged man waiting to cross a busy street with no pedestrian crossing, patiently standing by the side of the road with cars whizzing by.

In such situations my instinct is to be annoyed. Why are there so many people in cars? Can’t they take the public transport or walk? I’d like to cross already! Should I make a run for it or wait until it clears? I have other things to do, and certainly don’t want to spend my precious time standing by the road, inhaling your exhaust fumes. Why don’t they paint a crossing here?

Isn’t it unfair that this man was smiling while I’d be upset in the same situation? After some pondering, I recalled a quote by Thich Nhat Hanh:

So next time you’re stopped at a red light, you might like to sit back and practice the fourth exercise: “Breathing in, I’m aware of my body. Breathing out, I release the tension in my body.” Peace is possible at that moment, and it can be practiced many times a day – in the workplace, while you are driving, while you are cooking, while you are doing the dishes, while you are watering the vegetable garden. It is always possible to practice releasing the tension in yourself.

Perhaps it was a holy road-crosser. Perhaps he was standing there just to remind me that we can influence what we think and can decide how we feel in the situation we find ourselves in.

Oh Ubuntu


I’ve been a happy Ubuntu user for 17 years, since 2005.

Ubuntu always pushes something on me I don’t want. They pushed Unity, and I hated it. Then Unity was replaced by stock Gnome and I longed for Unity. I got used to Gnome by now. It actually is pretty customizable.

Snaps. Everyone hates them. I swore I’d switch to Debian because of snaps. And yet… I’m on Ubuntu 20.04 and my neovim is old. I’d like to try a newer neovim. Well, apt remove neovim && snap install nvim. Eh, that was almost too easy?



The sound of police sirens.

If it’s an ambulance or firefighters, that’s cool. But with police or politicians, it always annoys me. Who are you, so important you have to disturb my and other peoples’ peace?

Well, I watched King Charles’ first audience with the prime minister1 and there it was: the sound of sirens. And who are you, so important you have to disturb both the king and the prime minister?

  1. I just wanted to see how old he looked and how he was holding up. This was the first video that popped up. 

Social loops


It has happened again!

I’m friends on Facebook with people called TK and VBV. They have never met, don’t know each other, and aren’t Facebook Friends™.

There exists a person with initials PC, whose Facebook profile I noticed because he’d organized a tournament of Through The Ages. Now PC is friends with both TK and VBV, but I have never met PC nor knew about his existence until about five minutes ago.

Interestingly, TK and VBV are in a similar situation: each of them knows both me and PC, while not knowing each other.

Such situations, in which each of the four people knows exactly two others but not the third, apparently arise pretty often. I’m not a very advanced Facebook stalker, yet I’ve seen this happen at least five times. Wild, isn’t it?

Some back-o-the-napkin calculations:

Say there’s 10 million Czechs.1 Say an average Czech has 200 other Czechs friended on Facebook.2 Say the distribution is random. To count the number of friends of friends, 200×200=40k, but I guess there’s vast overlap among those, so say 10k friends of friends per person? So for each friend-of-a-friend, there is a one in 10m/10k=1k chance they’re also a friend-of-another-friend. With 10k friends of friends, about 10 should be connected through two different friends.3

However, the distribution is not random. The people one hangs out with and the other people one hangs out with probably have something in common. With TK and VBV and PC, we all come from towns with 10k+ inhabitants, and each of us has lived in one of the two largest cities in the Czech Republic.4 This clustering further increases the number of shared friends-of-friends. So perhaps this is not so surprising after all?

  1. For simplicity, let’s limit this to the Czechs. I’ve seen this happen with a person where one of our common connections was a Czech non-go-player and the other was a foreign go player, which is even wilder. 

  2. In 2012, an average Facebook user had 245 friends according to WaPo. By 2019 supposedly 338 friends on average. Not all of them will have been Czechs. Furthermore, I don’t care about accuracy. Ballpark is fine. 

  3. For 10k unique friends of friends, it’s 10 connected through two different friends. For 20k it’s 40, for 30k it’s 90, and for 40k it’s 160. The number of shared friends of friends grows exponentially with how many friends people have. 

  4. In fact I’m the only one of us four who has never lived in Prague! And it just began to dawn on me – maybe I’m the weird one! They all lived in Prague, no surprise some of them met. But, how did it happen I met both VBV and TK? 

My programming career


I started my programming career writing Idris. It’s a programming language similar to Haskell, with dependent types. That means types are first class citizens, so you can perform computation on them. It’s quite a bit of hassle, all for the dubious benefit of program correctness. The library ecosystem was almost nonexistent.

Then I had a brief stint with Elm and Scheme Lisp. Elm is like an easier Haskell or Idris, with friendly error messages. I no longer had to deal with the higher-kinded types. Scheme is a language with almost no syntax, hence very well suited for beginners like me.

After that, my career progressed to Scala, the first commercially successful language I’ve used. Oh boy, let me tell you about Scala – apart from the functional programming paradigm, it supports object-oriented programming, allowing one to mutate shared state. Also it runs on the JVM, which is pretty cool, with many third party libraries available.

I’ve also used Python a bit meanwhile, and who hasn’t? Yes the 2 vs 3 was a fiasco but the ecosystem is amazing and it reads like pseudocode, nevermind that one doesn’t know which functions mutate things in place and which return new things. Also I drink a beer every now and then, one only lives once (OOLO), leave me alone mmkay?

Later I’ve come to the pinnacle of my programming career: PHP. I’ve spent a good deal of time with PHP, using domain driven development, test driven development, and doing continuous integration, like a good developer should. The language might have its warts, but the productivity is amazing. We used Vagrant and Chef to manage our environments, also we’d deploy things using Docker.

Finally, I stopped using the Symfony Framework, and started using various in-house frameworks, and sometimes even no frameworks at all. At some point I stopped using Subversion and started copying PHP files straight to the web servers. Also I found out that apart from object-oriented programming, PHP also supports “imperative programming”. This means one does not have to write code within classes and instantiate objects, rather one can directly mutate global state. This further decreased the ceremony and increased my productivity.

One Friday, upon coming back from lunch break, I learned the customer wanted to have a points-based eshop ready by Monday morning. Their customers had been collecting points for doing whatever, and now was the time for them to buy merch using those points. Here’s the list of the merch, including photos and prices in points, please send us a weekly list of who ordered what, ta! Do you think I spent the weekend working? Nope! I buckled up, wrote five hundred lines of PHP in several hours of perfect flow, tested it a little, fixed a bug or two that came up, copied the files over to the production server, called it a day, and went home for the evening. Come Monday, everything worked just fine.

Is this a joke? Well, the timeline, perhaps, a little bit. Apart from that, not so much. I really did write the points-based eshop in PHP in an afternoon, and it really did work. As people grow their career, they achieve more and more. Me, I achieve less and less. I really don’t have anything to point at that I wrote in Idris. [insert shrug emoji]

Elm and Maximum call stack size exceeded


A-ha, this will be an easy blog post!

So perhaps your JavaScript console tells you Uncaught RangeError: Maximum call stack size exceeded.

That probably means your recursion isn’t tail-recursive. A recursive function calls itself. A tail-recursive function calls itself as its final step – it does not further modify the result of the recursive call.

A thing that caught me out just now, while f (a b) and f <| a b are functionally equivalent, the former is tail recursive while the latter is not.

From Basics.elm:

{-| Saying `f <| x` is exactly the same as `f x`.

It can help you avoid parentheses, which can be nice sometimes. Maybe you want
to apply a function to a `case` expression? That sort of thing.
apL : (a -> b) -> a -> b
apL f x =
  f x

In f (a b), the a b part is evaluated first, and then f is called as the last thing. In f <| a b, the <| itself is application of a function, thus breaking the tail elimination as f is not the last thing called.

Elm says no runtime exceptions. Generally true, not too much of a stretch. But you still do have to watch out a tiny little bit…

Audio books


Long walks, I get plenty of them these days. Usually listening to podcasts. I choose podcasts to learn something, but if you ask me what I listened to a week ago, I probably won’t be able to tell. So, if it’s just entertainment, I could listen to fiction as well?

It turns out there’s plenty of good audiobooks on LibriVox. Here’s Ruth Golding’s list of British readers on Librivox.

I recently finished listening to The Count of Monte Cristo, and the following quote near the end of the book quite struck me:

There is neither happiness nor misery in the world; there is only the comparison of one state with another, nothing more. He who has felt the deepest grief is best able to experience supreme happiness. We must have felt what it is to die that we may appreciate the enjoyments of living.

School is easier than work


You think having to go to school is bad? These are the easy years, life is going to get much tougher when you’re an adult and have to work.

So adults told me when I was little, and I believed it, because I had no point of comparison. And it might be true, but misses the point.

School is forced upon children by adults, and even if it weren’t too bad, it wouldn’t be how children would choose to spend their time. Adults, however, have it exactly like the children think: adults have freedom and can do whatever they want. I’m not surprised kids want to be adults, because they want to have this same freedom. Children don’t want to have it easy, they want to have freedom.

I still regularly see adults claiming kids should be grateful for being kids. Why do adults do this? It feels like taking advantage of the kids’ naivety. Adults should be grateful for being so lucky as to be adults!

Adults: you have to work? Nope. You’ve just made some calculations and choose to work, because you want to have a roof over your head and food on the table and buy clothes and what not. It’s a choice, you can stop going to work anytime. Perhaps you can get another job, or you can do without and live under a bridge.

Children: you want to have freedom? Good news – you have freedom. When adults tell you that you must do something, you don’t have to listen. Bad news – if you don’t do what the adults want, we’ll probably punish you. I’m so sorry.

New Blog 2021


I’ve not only stopped writing things on the blog, I also stopped updating its various workings, styles, etc. Time to change the latter, and see if it leads to the former. Knowing life, it probably won’t.

Why not WordPress?

WordPress has served me well since 2006. 15 years? Not bad – there are few things with this longevity in my computers. But I’ve grown afraid of it:

  • The interface keeps changing. I’m old and don’t like it when interfaces improve.
  • Everything is stored in MySQL. Fine, I can take a mysqldump every now and then? But what can I do with it really? And I have to actually keep running a MySQL server! If WordPress were able to use SQLite, I might’ve stuck with it.
  • PHP, WordPress… guess how often I updated them? Yes – how didn’t everything get hacked yet?

Why Jekyll?

I like versioning things with git. I like simplicity. I like plain text files I can just edit. Digital restraint or hipsterism?

I’ve used Middleman in the past, and now can’t update my tsumego website. Apparently my Ruby is too new for my dependencies, so I update the dependencies, and then run into a Thor issue, which also is tracked on Debian and Ubuntu, and I really don’t care about any of this and just want things to work. Jekyll seems to continue working. I hope it continues working for the next 10 years at least. And if it breaks, I’ve got everything in relatively plain html/markdown files and should be able to take it from there.


Your wonderful comments were often much more interesting than my posts, and I worked hard to preserve them. Unfortunately, I’m not sure how to make commenting possible without suck. Some options:

  1. Disqus, Facebook, etc: yes it’s easy, but where is the simplicity? I wanted more control and predictability and safe feelings, using a centralized third party to handle your precious comments would be downright irresponsible.
  2. The Jekyll resources page lists some options that allow commenting using GitHub issues: I quite like that a bit, but the end result looks dodgy – each commenter has to agree to give some random app the write access to their soul.
  3. The poor-man solution. As this is mirrored on GitHub anyway, just go and create a PR to add a comment? It’s not exactly user friendly, but hey, at least there’s a barrier to entry. I’ve written down instructions how to add comments. If GitHub ever goes away, the comments will be part of the repo and I can take them elsewhere. That, plus no one comments here anymore anyway.