A New Solution to Removing the GHC Dependency

Hi, Note first as a caveat that I've had three hours' sleep in the last 36. That said, I'm not the only person who thinks this is a good, and practical, idea. Requiring GHC as a dependency is a real drag on evangelizing xmonad, and for adoption. The payout, of course, is having the full power of Haskell in our configurations. But GHC is a very, very heavy dependency for someone who doesn't already have it, and it raises the bar to running xmonad. This led to the creation of PlainConfig, but while that removes the cost of GHC, it also sacrifices the benefit of powerful configuration. The new idea would allow users to keep all the benefits of Haskell config files without the cost of having GHC themselves. We would present a web interface where a user can paste in their xmonad.hs (or maybe Browse... upload?), probably select release vs. darcs version, and then submit the form. The get back a download link to a compiled, standalone xmonad-i386-linux, the complete executable. There are a couple of hurdles for this approach to work. 1. We need a donated machine with sufficient computing power and bandwidth. 2. xmonad-i386-linux files tend to be around 3.5-4MB. If this began to see a decent bit of use, that could take a bite out of the upload bandwidth for the donated machine. 3. The mod+q semantics: what does it do when there's no ~/.xmonad/xmonad.hs, but there is a ~/.xmonad/xmonad-i386-linux? Hopefully that keybinding should be harmless for someone without an xmonad.hs, and it would just treat mod+q as a no-op. On the user end, they would require libX11 and various other libraries, but not X11-1.4.2, mtl, the RTS, nor any other Haskell bits. Anyone with a X11 system (and an x86 architecture) should be able to run these binaries. Some form of captcha would be necessary to prevent spamming the form and crippling the box. Since it's only compiling and not executing the config files, it shouldn't require any lambdabot-like sandboxing. I'm willing to set up this system, and my family has a server machine that could be used as a testbed, but it isn't beefy or reliable enough to be used long-term. Braden Shepherdson shepheb

On Mon, Jul 21, 2008 at 10:32 PM, Braden Shepherdson
Requiring GHC as a dependency is a real drag on evangelizing xmonad, and for adoption.
I don't know about other distros, but I'm in ubuntu, and just had to install ghc6. It seems to be taking about 124 MB, unpacked. Are you sure this is a big problem?

* On Monday, July 21 2008, Braden Shepherdson wrote:
... Some form of captcha would be necessary to prevent spamming the form and crippling the box. Since it's only compiling and not executing the config files, it shouldn't require any lambdabot-like sandboxing.
I'm willing to set up this system, and my family has a server machine that could be used as a testbed, but it isn't beefy or reliable enough to be used long-term.
Or if those resources end up costing more than the small benefit, a middle ground would be to provide binaries for a some sample configs that show what can be done, without every other config being just a slight modification of original sample config. But if setting up a compiling server is that easy, then go for it: it might be enough to encourage those stingy people to take ghc.

Braden Shepherdson
Requiring GHC as a dependency is a real drag on evangelizing xmonad, and for adoption.
This is perfectly true. Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. If I wanted to scuk 124 MB just to manage my windows, I would install Gnome or KDE. I am in the market for lightweight tiling window managers, because I like to keep my software light. So far in my life since about 2004 I have gone the path: ion -> ratpoison -> wmii -> xmonad My main requirement is that is must not depend on the mouse, and wmii has some things you can only do with the mouse, like moving floating windows, which is unacceptable to me. But now I see, that to configure xmonad I need to install a huge new programming language which I would not use for anything else, so I think I'll try awesome. I might go back to wmii some time in the future, once the things that you can only do with the mouse now, are doable with the keyboard. -- Miernik http://miernik.name/

On Tue, Jul 22, 2008 at 4:31 AM, Miernik
This is perfectly true. Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. If I wanted to scuk 124 MB just to manage my windows, I would install Gnome or KDE. I am in the market for lightweight tiling window managers, because I like to keep my software light.
XMonad is light in terms of lines of source and errors per line. If you're in some kind of disk space crisis that nobody else in the world knows anything about, you can definitely get some WM that takes fewer bytes on disk. But maybe just think for a minute about whether that would make any sense.

brian wrote:
On Tue, Jul 22, 2008 at 4:31 AM, Miernik
wrote: This is perfectly true. Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. If I wanted to scuk 124 MB just to manage my windows, I would install Gnome or KDE. I am in the market for lightweight tiling window managers, because I like to keep my software light.
XMonad is light in terms of lines of source and errors per line. If you're in some kind of disk space crisis that nobody else in the world knows anything about, you can definitely get some WM that takes fewer bytes on disk. But maybe just think for a minute about whether that would make any sense.
Liking to keep software light is similar to liking to compile from source. You can try to make a technical argument for it, but it doesn't come out very convincing. It's mostly a psychological and aesthetic thing, not technical. Which certainly makes it no less real! Whether or not you understand the viewpoint, the fact remains that the weight of xmonad's dependencies hurts its spread. Braden Shepherdson shepheb

On Tue, 22 Jul 2008 06:49:54 -0500
brian
On Tue, Jul 22, 2008 at 4:31 AM, Miernik
wrote: This is perfectly true. Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. If I wanted to scuk 124 MB just to manage my windows, I would install Gnome or KDE. I am in the market for lightweight tiling window managers, because I like to keep my software light.
XMonad is light in terms of lines of source and errors per line. If you're in some kind of disk space crisis that nobody else in the world knows anything about, you can definitely get some WM that takes fewer bytes on disk. But maybe just think for a minute about whether that would make any sense.
It definitely would for those using dialup of paying the connection per
downloaded megabyte. I've been in that club for quite some time, and I wouldn't
probably have been using fvwm all that time if I needed a kde-like download
size to use it.
Now I have broad band, but you can bet that that's not the case for everyone.
One of the "problems" of the internet is that it reaches all around the world,
and you have to consider lots of things, not only your own circumstances.
I agree that storage space is a lesser issue nowadays. But it still might
be important in some configurations/hardware.
So, as you see, things are not always black or white. There are lots of people
with different needs.
--
Jesús Guerrero

On Tue, Jul 22, 2008 at 06:49:54AM -0500, brian wrote:
On Tue, Jul 22, 2008 at 4:31 AM, Miernik
wrote: This is perfectly true. Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. [...]
XMonad is light in terms of lines of source and errors per line. If you're in some kind of disk space crisis that nobody else in the world knows anything about, you can definitely get some WM that takes fewer bytes on disk. But maybe just think for a minute about whether that would make any sense.
You should be aware that there's more than only big fat i386 and amd64 (or x86_64 or what it's called on Linux) with hundreds of GB of disk space. For example, there's the Zaurus C3000, with impressive 4 GB disk space. Well, I'm a snob, I own a C3200 with 6 GB, and once GHC is ported to arm, which may happen within the next 6 to 12 months, I'll of course install it on my Zaurus, but other users may just want to run XMonad, without having to depend on a full GHC installation. And there are some similarly limited toys in the wild that are much less exotic than a Zaurus running OpenBSD (think of the Eee PC). For now, people who want to use XMonad on such gear have to either stick to the default configuration or to install GHC. Ciao, Kili

On Tuesday 22 July 2008 13:31:37 Miernik wrote:
Someone here said that "124 MB is not a lot, are you sure its a problem?". Well, it bloody is, its just killing the idea of using a light window manager. If I wanted to scuk 124 MB just to manage my windows, I would install Gnome or KDE.
xmonad is lightweight due to its memory footprint: ddc@ddclpc:~ $ ps -o %mem,args -p 5836 %MEM COMMAND 0.2 /home/ddc/.xmonad/xmonad-x86_64-linux If You trade the disc consumption for the configurability and flexibility, go install dwm. Or just install ghc, configure xmonad and through ghc out, if You can't stand it wasting Your disc space. -- Dmitrij D. Czarkoff

Dmitrij D. Czarkoff
If You trade the disc consumption for the configurability and flexibility, go install dwm.
Right now I installed awesome, which is a much better dwm. miernik@przehyba ~ $ ps -o %mem,args -p 25681 %MEM COMMAND 0.5 awesome miernik@przehyba ~ $ I don't need to install a whole programming language just to configure it, it has a powerfull but still intuitive ~/.awesomerc plain text file, no need to recompile anything to change config. What I plan to do is to build a linux image which is packed whole into an iniramfs image and boots from an USB flashdisk, all into RAM, and then after boot I remove the flashdisk, haveing the system all in RAMdisk, and then do XiP (execute in place) there. That's why I care about size - because RAM is about 25$ per GB now, so keeping the whole GHC in RAM costs 3$ wasted RAM space, and also power consumption (electricity cost) of the RAM chips. 3$ is not a lot, but it's also not nothing, 3$ here, 3$ there and I waste a lot of money. And money is time, so I want to waste less time, waiting for my applications to load from disk, by keeping it all in RAM all the time, and having no disk besides of RAMdisk on the machine. While I used xmonad for a few days, now I have awesome as my window manager since a few hours. Can you give me any reason in what xmonad is better then awesome, any reason to switch back? For those who don't know awesome: http://urukrama.wordpress.com/2008/07/10/first-steps-with-awesome-window-man... -- Miernik http://miernik.name/

Hello On Tue, Jul 22, 2008 at 05:07:22PM +0200, Miernik wrote:
Dmitrij D. Czarkoff
wrote: If You trade the disc consumption for the configurability and flexibility, go install dwm.
What I plan to do is to build a linux image which is packed whole into an iniramfs image and boots from an USB flashdisk, all into RAM, and then after boot I remove the flashdisk, haveing the system all in RAMdisk, and then do XiP (execute in place) there.
How about putting only the (already build & configured) xmonad binary into the initramfs? You do not need online reconfiguration in it (you would lose it to the next boot anyway, right?) And it is the only thing you will be missing, if you do not include ghc. Have a nice day -- I left the ssh key under the doormat Michal 'vorner' Vaner

On Tuesday 22 July 2008 19:07:22 Miernik wrote:
miernik@przehyba ~ $ ps -o %mem,args -p 25681 %MEM COMMAND 0.5 awesome
That's why I care about size - because RAM is about 25$ per GB now, so keeping the whole GHC in RAM costs 3$ wasted RAM space, and also power consumption (electricity cost) of the RAM chips.
You don't need GHC to *run* xmonad, only to *rebuild*. Just pack it and go.
While I used xmonad for a few days, now I have awesome as my window manager since a few hours. Can you give me any reason in what xmonad is better then awesome, any reason to switch back?
I don't know Your case. May be You should switch further to twm or something more minimalistic. And it would even save You one more penny! -- Dmitrij D. Czarkoff

On Tue, Jul 22, 2008 at 05:07:22PM +0200, Miernik wrote:
I don't need to install a whole programming language just to configure it, it has a powerfull but still intuitive ~/.awesomerc plain text file, no need to recompile anything to change config.
Ah: 1) As Braden mentioned earlier, xmonad just added this capability (in darcs) with PlainConfig. 2) This is not true of dwm, which requires you have a C compiler installed, and gcc's not any cheaper: ftp://ftp.thewrittenword.com/packages/by-name/gcc-4.0.2/i686-pc-linux-gnu/ But certainly, xmonad has a couple of runtime dependencies that a typical C-based WM wouldn't have (e.g. libgmp). </offtopic> I like the idea of having preconfigured binaries for predefined configs, but I can't imagine wanting the slow turnaround time of sending off a config to an upload form, etc. Perhaps wrapping it up in a curl-based script would make it livable. You might also consider making it scrape the haskellwiki (or if the version is new enough, use the MediaWiki WS API) for the configs on a cron basis. FWIW, it wouldn't apply to me, as my two binaries are xmonad-powerpc-darwin and xmonad-x86_64-linux. :P

One more thing -- (recalling my envangelizing experience with a friend who had an unfun install) -- much worse than having to go through several steps to install is not knowing what steps they are and/or having to backtrack. The most common example on #xmonad is finding out that X11.hs on debian didn't support Xinerama. Of course, he downloaded at a particarly difficult time -- IIRC, xmonad was dependent, at that point, on a newer version of Cabal than ghc-latest provided. So, download/install Cabal, ghc hide old Cabal...

public:
Dmitrij D. Czarkoff
wrote: If You trade the disc consumption for the configurability and flexibility, go install dwm.
Right now I installed awesome, which is a much better dwm.
miernik@przehyba ~ $ ps -o %mem,args -p 25681 %MEM COMMAND 0.5 awesome miernik@przehyba ~ $
I don't need to install a whole programming language just to configure it, it has a powerfull but still intuitive ~/.awesomerc plain text file, no need to recompile anything to change config.
I'll just note that this is simply because GCC and the C programming language, a 150MB monolith, is preinstalled on your machine. GHC only comes preinstalled on a very few distros. -- Don

* On Tuesday, July 22 2008, Miernik wrote:
That's why I care about size - because RAM is about 25$ per GB now, so keeping the whole GHC in RAM costs 3$ wasted RAM space, and also power consumption (electricity cost) of the RAM chips. 3$ is not a lot, but it's also not nothing, 3$ here, 3$ there and I waste a lot of money. And money is time, so I want to waste less time, waiting for my applications to load from disk, by keeping it all in RAM all the time, and having no disk besides of RAMdisk on the machine.
You can save more space, if your filesystem copied to ram is compressed using squashfs+aufs, like how livecds do it. Using gzip compression you halve the size of the filesystem, saving you $$! So, xmonad and friends will take about 85M, or $1.50. I have set up a system like that, and it is more useful in that I can spin down my hdd indefinitely, than the faster program startup time, since the programs I frequently use are started with xmonad.

Gwern raised a point on #xmonad that is the thorn in this idea: Template Haskell. The ability to execute arbitrary Haskell code at compile time makes it hard to trust code arriving over the net. Gwern shot down several ideas for overcoming this, but the final one seems to work. I don't know much about TH, but it needs to be turned on via either a command-line switch (which won't be present, clearly) or a {-# LANGUAGE ... #-} or other pragma inside the xmonad.hs file. Unfortunately there are numerous ways to active the flag: {-# LANGUAGE TemplateHaskell #-} {-# GHC_OPTIONS -XTemplateHaskell #-} and probably a dozen more and more esoteric ways. But, there is no need I can see for any {-# ... #-} pragmas at all in xmonad.hs files. Some people's configs on the wiki use it, but apparently only for things like -Wall or -fno-warn-missing-signatures, which are hardly essential. Even if, for some reason, one's config did require some extension, it seems justified for the web interface to disallow it. If your config is that exotic, you'll have to build it yourself. Is there some obscure other way to turn on TH without a {-# ? Or would ensuring that the config doesn't have any {-# in block that out completely? Braden Shepherdson shepheb

Some thoughts,
On Tue, Jul 22, 2008 at 5:32 AM, Braden Shepherdson
Hi,
Note first as a caveat that I've had three hours' sleep in the last 36. That said, I'm not the only person who thinks this is a good, and practical, idea.
Requiring GHC as a dependency is a real drag on evangelizing xmonad, and for adoption. The payout, of course, is having the full power of Haskell in our configurations. But GHC is a very, very heavy dependency for someone who doesn't already have it, and it raises the bar to running xmonad.
This led to the creation of PlainConfig, but while that removes the cost of GHC, it also sacrifices the benefit of powerful configuration. The new idea would allow users to keep all the benefits of Haskell config files without the cost of having GHC themselves.
We would present a web interface where a user can paste in their xmonad.hs (or maybe Browse... upload?), probably select release vs. darcs version, and then submit the form. The get back a download link to a compiled, standalone xmonad-i386-linux, the complete executable.
Different distros for various reasons may have different ways of having things compiled. I can't imagine this is as much of a problem for GHC, but it sometimes is a problem for other apps. Things compiled on one distro may not always work 100% on another distro. Perhaps waht you might want to do is include a series of sample configs, or even some kind of build daemon that can be packaged up on a per distro basis. Then, the xmonad package maintainers can include packages with prebuilt configs the user can choose from. The maintainer can also decide if it is a good idea to run the build daemon, and offer it as a service to the distro's users. Personally, I have no problem doing this for Fedora. I'm not sure we have the resources for a buildserver off hand, but including prebuilt configs is certainly an option. Just my 0,02 USD -Yaakov

I think this could be a good idea. However, allow me to play devil's advocate for a minute. There are a few questions that come to the top of my head immediately: 1. Is there any evidence that having to upload their config file to some webpage and downloading the generated executable would be any less onerous to users than installing ghc? It seems like it could be a lot of work for not much benefit. (Someone else suggested a command-line interface, which could certainly make things much nicer.) 2. At a more fundamental level--and I realize I am bordering on heresy here--*why* do we care about making it easy for people who don't want to install ghc to run xmonad? I'm not saying there aren't any good answers to this question, just that it should be considered seriously. Anyway, I reiterate that I am not trying to argue against this idea--I think it is fundamentally a good idea-- just suggesting some things for further thought. -Brent

On Tue, Jul 22, 2008 at 11:33 AM, Brent Yorgey
2. At a more fundamental level--and I realize I am bordering on heresy here--*why* do we care about making it easy for people who don't want to install ghc to run xmonad? I'm not saying there aren't any good answers to this question, just that it should be considered seriously.
THANK YOU. All of this bullshit evangelizing (mostly from non-coders) in the free software community has been getting obnoxious. The last thing small community projects need is influxes of clueless users attracted to the *marketing* instead of the functionality. The ghc dependency is the foundation of what makes xmonad unique -- the fact that the 'config file' is actually the program itself. If it didn't have that fundamental design, the implementation language wouldn't matter at all from a user perspective. Without it and the functionality it enables, the only other feature that really differentiates it from other tiling window managers is the way it handles Xinerama (independent viewports onto a pool of desktops), and that's broken on Debian because of their usual packaging bullshit ;) -- Fred
participants (13)
-
Adam Vogt
-
Braden Shepherdson
-
Brent Yorgey
-
brian
-
Devin Mullins
-
Dmitrij D. Czarkoff
-
Don Stewart
-
Fred Blasdel
-
Jesús Guerrero
-
Matthias Kilian
-
Michal 'vorner' Vaner
-
Miernik
-
Yaakov Nemoy