There was an interesting question by ‘Fool’ recently on the StackExchange site for Boardgames: How do you play a game like Rock-Paper-Scissors with friends online? Or any other game where players have to simultaneously submit their moves (e.g. Diplomacy, or Rock-Paper-Scissors-Lizzard-Spock), which, as I just learned, are simultaneous action selection games. While there are websites dedicated to playing specific games, such as webdiplomacy.net, we could not find a generic one that you can use if you, for example, invent your own variants of a game.
So I created one: At you-say-first.nomeata.de you can enter rooms and share the URL with your friends. On the one hand, you have a regular chat room there. But there is also the possibility to enter moves (whatever a move may be to you) and only when all players have done that and marked the move as final, it is shown to everyone. If you want to try it out: There is an integrated, not very fancy Rock-Paper-Scissors-playing bot. Just enter a room, join and say „I want to play!“
Note that this site can be used for more than just for games. Have you ever observed that persons would often want other to express their preference (e.g. where to dine) first to not reveal their own preference, so that they can (or pretend to) change their mind if they would contradict? In such situations simultaneous action selection can be a fairer method.
A technical note: I created this web app using meteor (a JavaScript framework building on node.js and MongoDB that allows for reactive programming), and it is also hosted on meteor.com. I chose Meteor after someone mentioned Firebase to me, which looked very slick, but was not Free Software, so I looked for alternatives. I did not do any cross-browser-testing, and the UI design could be improved, so if you want to help out (or just complain), please use the GitHub code repository and issue tracker.
by nomeata (mail@joachim-breitner.de) at May 11, 2013 10:26 AM
By now, Debian ships quite a lot of Haskell packages (~600). Because of GHC's ABI volatility, whenever we upload a new version of a library, we have to rebuild all libraries that depend on that. In particular, if we upload a new version of the compiler itself, we have to rebuild all Haskell library packages. So we have to rebuild stuff a lot. Luckily, Debian has a decent autobuilding setup so that I just need to tell it what to rebuild, and the rest happens automatically (including figuring out the actual order to build things).
I was curious how much we use the buildd system compared to other packages, and also how long the builders are busy building Haskell packages. All the data is in a postgresql database on buildd.debian.org, so with some python and javascript code, I can visualize this. The graphs show the number of all uploads by autobuilder on the amd64 architecture, with haskell uploads specially marked, and the second graph does the same for the build time. You can select time ranges and get aggregate statistics for that time span.
During the last four days a complete rebuild was happening, due to the upload of GHC 7.6.3. During these 2 days and 18 hours building 537 packages took 48 hours of build time and produced 15kg of CO2. That is 94% of all uploads and 91% the total build time. The numbers are lower for the whole of last year: 52% of uploads, 31% of build time and 57kg of CO2. (The CO2 numbers are very rough estimates.)
Note that amd64 is a bit special, as most packages are uploaded on this architecture by the developers, so no automatic builds are happening. On other architectures have, every upload of a (arch:any) package is built, so the share of Haskell packages will be lower. Unfortunately, at the moment the database does not provide me with a table across all architectures (and I was too lazy to make it configurable yet).
by nomeata (mail@joachim-breitner.de) at April 24, 2013 11:36 AM
by Joachim Breitner (mail@joachim-breitner.de) at April 07, 2013 05:08 PM
by Joachim Breitner (mail@joachim-breitner.de) at February 18, 2013 07:21 PM
by Joachim Breitner (mail@joachim-breitner.de) at February 08, 2013 08:52 PM
I have just uploaded a new version of ghc-heap-view to Hackage that provides “Evaluation state assertions” in the module GHC.AssertNF.
Imagine you are writing a web application in Haskell that sports a global number-of-visitors counter in an IORef Int. For every request, you call modifyIORef (+1). Eventually, you notice your very popular web site to hog more and more memory. So you browse to the internal page that shows the counter, and you have to wait for a long time until you eventually see the result (or get a stack overflow). The reason: The applications of (+1) were not performed until you looked at the number; instead, a long chain of such computation first filled your heap and then your stack.
So you have learned the hard way that you might want to avoid space leaks, and want calculations to be done during the request that caused them, and want the IORef to always contain fully evaluated data. So you stumble about modifyIORef' in Data.IORef and indeed, this fixes your problem.
Later, you notice that you want to count POST and GET requests separately. You change the type to IORef (Int, Int) and call modifyIORef' (first (+1)) or modifyIORef' (second (+1)). And suddenly, the space leak is back (which you only notice after the next push to the real site, because your local tests never caused enough requests to make it noticeable). So you not only want to fix it, you also want to ensure that it does not break again.
In other words, you want to ensure the policy that values stored in an IORef are always in normal form. You achieve this with the following alternative to modifyIORef':
modifyIORef'Assert :: IORef a -> (a -> a) -> IO ()
modifyIORef'Assert ref f = do
x <- readIORef ref
let x' = f x
x' `seq` return ()
assertNF x'
writeIORef ref x'
Using this instead of modifyIORef' will print this warning to standard error output right the first time you call modifyIORef'Assert (first (+1)):
Parameter not in normal form: 2 thunks found: let x1 = (S# 1,S# 1) in _bh (_thunk x1 (_bco (S# 1)),_sel x1)
(Otherwise, the program runs as usual.) So obviously, you need to use a strict variant of first (or strict pairs):
first' :: (a -> b) -> (a, c) -> (b, c)
first' f (x,y) = let { x' = f x; r = (x', y) } in x' `seq` r `seq` r
With this, the warning goes away. Whenever you now change the type of the IORef or modify it in a too-lazy-way, you can be sure that you’ll be warned about it, before the space leak itself becomes noticeable.
In the production code, you might want to disable the check. For that, simply put disableAssertNF somewhere in your main function.
Why is this better than just calling deepseq in modifyIORef'Assert? Because this way, the code still creates unwanted thunks that are then evaluated before storing them in the IORef, whereas with assertNF you are told about the thunks and can prevent them from being created in the first place. Also, assertNF does not add a type class constraint.
This is just one example application for assertNF (and its variants assertNFNamed, which includes a name in the warning to better spot the cause, and $assertNFHere, which uses Template Haskell to include the current source code position in the warning), and I hope that there are more. If you happen to make use of it, I’d like to hear your story.
by nomeata (mail@joachim-breitner.de) at February 06, 2013 09:33 AM
Earlier this week, things were looking different, and I did have to cancel a Haskell talk in Freiburg on Monday due to illness. But I’m back on track and will be travelling to Brussels tomorrow.
I’ll be holding a talk on how we package Haskell in Debian, on Suday at 15:30. I hope it will be useful to Debian users (who will better understand the packaging), other Debian Developers (who’ll learn about the peculiarities of Haskell and the implications for the Debian infrastructure), other distro’s maintainers (to compare best practices) and Haskell developers (to learn about the needs and worries of downstream packages). The talk will be based on my DebConf 11 talk on the same topic. I’m also happy to answer questions about Haskell, Haskell in Debian or any other topic that you want to hear my opinion about, so just talk to me during FOSDEM.
In related news: GHC 7.6.2 was uploaded to Debian experimental the day it was released; the rebuilding of all libraries is still in progress (~370 of ~570 done).
by nomeata (mail@joachim-breitner.de) at January 31, 2013 08:03 PM

by Felix Brandt (nospam@example.com) at January 24, 2013 07:23 AM



by Felix Brandt (nospam@example.com) at January 12, 2013 07:29 AM
Janis Voigtländer has invited me again to give a lecture in his Advanced Functional Programming course at the University of Bonn. Like last time, when I talked about performance analysis in Haskell, I chose a topic that is more on implementationishy side to contrast the theoretic content of the rest of the course. I recycled my talk on the memory representation of GHC that I have held at last year’s Meta Main-Rhein Chaos Days. As usual I provide a transcript of the talk as intended (not as held). It is slightly revised over the old version and I have added a section on unboxed values in constructors, which I have nevertheless skipped today.
by nomeata (mail@joachim-breitner.de) at January 10, 2013 10:24 PM
by Joachim Breitner (mail@joachim-breitner.de) at January 01, 2013 01:49 AM
by Joachim Breitner (mail@joachim-breitner.de) at December 31, 2012 11:53 AM
by Felix Brandt (nospam@example.com) at December 27, 2012 10:00 PM
This weekend, Johannes and Solveig invited me and Sabine, a friend of theirs, to come along on a hike into the Tararua Forest region near Wellington. After a 2-hour drive through perfect weather, we were off to a good start. Our track went through beautiful temperate rainforest with lots of ferns and curious plants I had never seen before. Just before the bushline, the forest appeared to be from a fairytale, as all trees were completely covered with thick moss and lichen.
By the end of the day, we made it to a comfy hut and met some other hikers, who had conveniently already started an oven fire. We had some delicious dinner and stayed there overnight during heavy winds gusts. On the next morning, we had originally planned to follow a mountain ridge for several hours, which would eventually have led back to where we started. The heavy wind unfortunately made this too dangerous; nobody felt like getting blown off the mountain on that particular day, so it was finally decided to return along the same track we had used on the previous day. See below for a video of the winds and and some pictures.
<iframe class="youtube-player" frameborder="0" height="346" src="http://www.youtube.com/embed/Z0J84mduVkw?wmode=transparent" type="text/html" width="575">
</iframe>

Today was the last day of my vacation, which I spent in Amsterdam. I only had a little bit of time to walk through the Grachtengordel (canals) past the Bloemenmarkt (flower market). One can buy all sorts of specialty flower bulbs there.
On the way, I came across a specialized store which basically just sells three different types of gouda: young, medium, and extra-old. What a great idea! Of course I immediately fell for it and left with a noticeably heavier bag.
I finally ended up in Amsterdam’s shady corner, which was certainly interesting. As predicted by Olesya, I saw several school classes exploring the area. Crazy!

On Thursday, I took the train to Bruges in the topmost corner of Belgium. This gem of a city was once a very rich and thriving trade outpost. Almost all of the medieval architecture in Bruges is intact to this day, which seems unbelievable. It is truly gorgeous — I had trouble deciding where to point my camera.
This place of course attracts many visitors. I would not recommend going there on the weekend.





by Felix Brandt (nospam@example.com) at January 19, 2011 11:53 PM



by Felix Brandt (nospam@example.com) at January 11, 2011 04:09 AM


by Pascal Maillard (nospam@example.com) at October 08, 2008 06:18 PM
Since Tuesday, my new home, at least for the next year but maybe even longer, is Paris! When I first got into our cosy apartment, it was a light shock for me, for I knew it was small but that small? 25 m² for two persons isn't that much, is it? But it is really cute and lovely and beautiful and situated in a very lively area of Paris, called Belleville, so I am very happy to be here. My sweetheart is currently in Brussels but will arrive on the 18th, then we will be able to test if we can live together in one room for a whole year... Luckily we have plenty of places to go out to, first of all the university of course but then bars, clubs, theaters, casinos, coffee shops (no, not here) etc, etc, etc...
By the way, I have to take a picture of the university campus of Jussieu (my university), it is really ugly! Huge buildings in 70s-style with a lot of metal, dirty windows and walls, high concrete pillows... Fortunately, the math department has moved because of the construction works on the campus, they actually found a quite appealing building not far from it. My courses there will start on the 22nd, but next Monday I will already attend a course in physics: Introduction to Quantum Mechanics. Hopefully, I'll be able to understand a bit ![]()
by Pascal Maillard (nospam@example.com) at September 12, 2008 05:42 PM
by Pascal Maillard (nospam@example.com) at August 31, 2008 09:53 AM
by Pascal Maillard (nospam@example.com) at August 24, 2008 04:41 PM
by Pascal Maillard (nospam@example.com) at August 11, 2008 08:27 PM