Re: [dwm] xmonad: dwm clone in Haskell

From: Donald Bruce Stewart <>
Date: Tue, 3 Apr 2007 23:28:36 +1000

> On Mon, Apr 02, 2007 at 09:09:30PM -0700, wrote:
> > Looks like they're shooting for <400 lines of code:
> >
> >
> >


(I'm one of the xmonad/dwm-in-haskell devs).
> I think it's very cool that people try to clone dwm in different
> PLs. However, I doubt it is achievable in lesser than 400 LOC
> without hiding a lot of stuff into a separate package/lib namely
> X11-extras - which is part of dwm itself ;)

There's only a little logic in there. Mostly its just bindings from C to
Haskell, same with the X11 package.

I think the main lines-of-code savings have been two things, I'd say:

    * data structures
        - lists are a lot simpler to manipulate in Haskell than in C

    * higher order functions
        - whenever we do the same thing twice, we abstract it out as
        a combinator, and use that instead.

> As a side-note: I believe that a higher level library than Xlib
> might be a great invention - something between widget libs and
> Xlib itself, which can be used for drawing and which does work
> with threads instead of a state machine... Such a lib would
> allow to finish simple X apps in a couple of hours and to hide
> all braindamage which has evolved during ICCCM and now EWMH
> times...

We've been considering binding to XCB instead of Xlib -- which we hope
will simplify things, as well as making threading actually work. We'll
see if Spencer (other xmonad dev's) summer of code project gets

Cheers (and gratitude for inspiration!)
Received on Tue Apr 03 2007 - 15:28:44 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:40:19 UTC