Xmonad was announced today on the haskell-cafe mailing list. It supports multiple monitors through xinerama. The unique part of this window manager is that it is written in Haskell in under 500 lines. Haskell is a purely functional programming language with very strong static typing to ensure correctness.
it looks like good old larswm…
hooray for haskell! it’s not often you see software written in this wonderful language.
I was thinking about writing a WM in Haskell only a few days ago… but I doubt I could do such a good job. The code is very clean and I’m glad to see that one of the authors is doing the Summer of Code project for the X11-Haskell bindings. Very promising.
Very interesting and very impressive. Yet this will be of use to a very small subset of users as most window management operations have been standardized by now and most users would be at a loss without the usual minimize, mazimize and close buttons.
I think user adoption rate is a little far from the author’s motivation. It seems that he had something in mind for himself and if others have a use for it too, then score. Otherwise, I doubt he cares if he ever shows up as a blip against the various other WMs out there.
Lucky for him Microsoft dropped the “Monad” codename for their new shell already or he could have been ceased and desisted into another name.
Edited 2007-04-23 02:33
Lucky for him Microsoft dropped the “Monad” codename for their new shell already or he could have been ceased and desisted into another name.
Even with “monad” being a language concept from Haskel, and the wm’s code containing a monad named X, and thus naturally referred to as “the X monad”, leading to the name Xmonad being pulled directly from its own source code?
Yeah, I already know the answer – “This is Microsoft we’re talking about.”
Have you heard of <a href=”http://en.wikipedia.org/wiki/Stumpwm“>Stumpwm
“[…] most users would be at a loss without the usual minimize, mazimize and close buttons.”
At least, some window managers don’t follow this concept. Excuse me for just mentioning this: I’m using WindowMaker for more than five years now. It does not have any minimize or maximize buttons, and I never found I needed or missed them. I’ve even turned off the close button for some applications (since I closed one accidently). Instead, roll up or blind out, next to focus follows mouse, focus on window in background, set window back (instead of just setting it to front) are the functions that are important to me. And NB, that’s my very individual opinion without any claim that others should share it.
As always in the UNIX and Linux world: Choose the tool that does fit your needs best. 🙂
To come back to the article: Haskell is an interesting language and it offers some opportunities for educational use. I’m surprised to see such a useful tool written in this language, really impressing, because I never found Haskell programs in the “real world”…
Very interesting. I’m bored with C-like languages and the scripting language of the day. While I have a preference for data flow languages (I miss Prograph), Haskell looks cool.
I’t does not look very advanced but below 500 lines is still impresive.
It looks good.
I use dwm, it’s C cousin as my current WM.
It’s really nice.
Abundance of IO, just like in every other Haskell program. What’s the point of pure functional programming, if I have to use IO at every other line?
> Abundance of IO, just like in every other Haskell program. What’s the
> point of pure functional programming, if I have to use IO at every other
> line?
There is no real justification for that. The IO monad just models imperative programming in a purely functional way. There is no advantage over other imperative languages that way, except that you can easily combine imperative and functional programming without a lot of trouble. My guess is that we will see progamming languages in the future that support both functional and imperative programming and make programming in both, as well as combinations, simple (Lisp is not what I mean here because it doesn’t separate the two different concepts at all).
My experience is that a greal deal of a program can be done without IO. “every other line” is a bit of an exaggeration. I haven’t looked at the code of Xmonad, but for a simple window manager I expect a lot of X communication code to be present, which of course uses IO a lot. You can expect the percentage of IO-using code to drop as soon as the data models of a program grow more complex (that is, if you go and re-build something like GNOME/KDE in Haskell).
Call me a dissenter, but I think if you need something like monads to abstract something simple that every program has to do (mutation), then your language model is conceptually flawed. In elegant theories, basic concepts fall out of the fundamental logic. They don’t have to be wrapped up in order to be compatible with it.
But hey, I think LOOP is neat, clearly I have no taste…
> Call me a dissenter, but I think if you need something like monads to
> abstract something simple that every program has to do (mutation),
> then your language model is conceptually flawed. In elegant theories,
> basic concepts fall out of the fundamental logic. They don’t have to be
> wrapped up in order to be compatible with it.
I have to agree with you here. As much as monads are based on a solid theory, they are still a workaround to get mutation and side-effects into Haskell. A nice one, but still a workaround.
In the end, you have to estimate how much the monad handling will clutter your code for a given project, and then decide whether Haskell is your language of choice.
>My guess is that we will see progamming languages in the future that support both functional and imperative programming and make programming in both, as well as combinations, simple.
Such language exist since a long time: Ocaml allows both style, and it’s quite fast too.
While I don’t like much Ocaml’s syntax, its clone F# (on .Net) has a nice syntax.
Unfortunately while Ocaml has been around for quite some time, it didn’t gather a lot of momentum..
There’s Scala too which provide an interesting mix of OO and functional style, with a nice syntax (on top of the JVM so it has access to Java code).
I don’t know if Scala’s gathering developers mindshare or not..
What necessary separation do you see missing in Lisp? Are you referring to the fact that that imperative constructs aren’t clearly demarcated in Lisp programs?
I don’t disagree with your point, I’m just curious about the reasoning behind it.
> What necessary separation do you see missing in Lisp? Are you
> referring to the fact that that imperative constructs aren’t clearly
> demarcated in Lisp programs?
Yes, exactly. Lisp isn’t really *missing* anything in that regard, but you have to force yourself to keep the functional and imperative parts recognizable.
This WM reminds me of Ion.
Cool that it’s written in Haskell though.