Skip to main content


Keys, Values and Rules: Three Important Shake Concepts

The title was a click-bait! This article will actually try to explain five instead of three important notions in Shake.

These are:
RulesKeysValuesThe Build DatabaseActions
This short blog post was inspired by the hurdles with my Shake based build, after the new Shake version was released, which had breaking API changes.

Jump to the next section if you are not interested in the why and how of this blog post.

Shake is rule based build system much like GNU make. Like make it is robust, unlike make, it is pretty fast and supports dynamic build dependencies.

But you knew all that already, if you are the target audience of this post, since this post is about me explaining to myself by explaining to you, how that build tool, I used for years, actually works.

Although I used it for years, I never read the paper or wrapped my head around it more than absolutely necessary to get the job done.

When Shake was updated to version 0.16.x, the internal API for custom rules was removed. Until then I w…
Recent posts

erlangs gen_fsm with queueing

OK no time for a full blow, polished blog post; When using gen_fsm I realized that often I want some sort of queueing. Two reasons promote this: to reduce the complexity caused by {States} x {Events}to implement some kind of asynchronous command execution processing model I usualle encounter both reasons and I ended up with two useful function that I copy into every gen_fsm I build: deq(State = #state{evtq = []}) -> {next_state, ready, State}; deq(State = #state{evtq = [Msg | T]}) -> ?MODULE:ready(Msg, State#state{evtq = T}). This requires one adds evtq as a field to the #state{} record. The function deq/1 will be used to work of events(one could say commands) until the queue is empty and finally rests in the state ready. This function is called at the point where one would return {next_state, ready, State} So instead of transitioning directly to ready we call the deq function which will process all defered events. On the other hand there is a function enq/2 whi…

My minimalistic xinitrc, xmonad.hs and xmobarrc

put this in ~/.xinitrc

# start trayer to contain apps like nm-applet trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 5 --transparent true --tint 0x191970 --height 12 &
kmix &
# some cool effects xcompmgr -c -f -F &
# Set the background color hsetroot -tile /home/sven/Wallpapers/abstract-bluelights-1280x800-.jpg
xset b 100 0 0 xset r rate 190 90 dbus-launch --exit-with-session xmonad

put this in ~/.xmonad/xmonad.hs
import XMonad
importqualified XMonad.StackSet as W
import XMonad.ManageHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.FadeInactive()
import XMonad.Hooks.SetWMName(setWMName)
import XMonad.Layout.NoBorders(smartBorders)
import XMonad.Layout.Tabbed(tabbed, shrinkText, defaultTheme)
import XMonad.Layout.LayoutHints(layoutHints)
import XMonad.Layout.LayoutModifier
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)

Installing GHC 6.12.2 on Red Hat Entrprise Linux 5.4 (i386)

Haskell, a general-purpose, purely functional programming language, has become more and more interesting for me, it allows me to write maintainable code, with acceptable performance even for tasks like analyzing large log files. I recently discovered how easy it is to write programs interacting with a unix like environment. It also very easy to write networking code. Haskell offers great opportunities for TDD and SDD through HUnit and QuickCheck, which - together with the pure and strong static type system of the language itself - enable trust in program correctness, which is vital for many commercial applications, or applications exposed to increased security requirements.

In order to leverage the outstandingly great features of Haskell, one has to have that beast running on a stable, proven and hence archaic and outdated operating system. Even if one is not a firm believer in magical awesomeness of Enterprise labels on top of ridiculously obsolete tools(like gcc 4.1 and glibc 2.5), t…