Linked by Thom Holwerda on Sun 22nd Apr 2007 20:06 UTC, submitted by ryan
Window Managers 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.
Thread beginning with comment 233074
To read all comments associated with this story, please click here.
axilmar
Member since:
2006-03-20

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?

Morin Member since:
2005-12-31

> 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).

Reply Parent Bookmark Score: 2

rayiner Member since:
2005-07-06

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...

Reply Parent Bookmark Score: 3

renox Member since:
2005-07-06

>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..

Reply Parent Bookmark Score: 2

rayiner Member since:
2005-07-06

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.

Reply Parent Bookmark Score: 2