Let's Put A Cap On Shoes

August 23rd 01:41
by why

I don’t know about you folks, but when Anselm Garbe moved from wmii to dwm, I ended up following him. I know, I know. I’m not crazy about the elitism of dwm (you have to alter config.h to change the window manager colors,) but I really go for the minimalism. The window manager clocks in at 1,891 lines according to sloccount. And it does all the right things.

Shoes is definitely a minimalist’s GUI toolkit. It’s at about five-thousand lines of C. Compare with wxWindows which sloccount reports is anywhere between 300,000 and a half-million lines of C. FOX is at 130,000 lines of cpp. And I still feel like Shoes is getting bloated quick.

Frankly, I don’t know how these guys do it. Five-thousand lines is seriously a lot. I think I need to put a cap of 10k because if it goes past that, it’s gonna be bankruptcy.

Three-hundred THOUsand lines. Scary, right??



said on August 23rd 03:27

Try out xmonad. Under 500 lines of haskell!


said on August 23rd 04:23

I was thinking of a weird solution to keep the code short (maybe?). The idea is to introduce “springs” in elements and between it’s adjacent elements. Based on a tension factor, the size and positioning of each element can be determined. Depending on their strength, they also determine which element or element-space grows/shrinks the most on resize. A tension limit on which spring break can also be added so that less-relevant items disappear in small displays. This is not my idea, but merely an adaptation or Knuth’s work on TeX (or how I think it works to produce that highly readable smooth text).


said on August 23rd 05:01

zimbatm <3

I always wanted that in HTML.


said on August 23rd 05:11

What nornagon said.


said on August 23rd 06:52

why, are there any things you would miss in dwm compared to wmii?


said on August 23rd 07:07

I understand your reasons for putting a cap on Shoes, and agree it’s a good idea. However, I’m worried that it might incline you (and other contributors) to use camping-style tricks to keep the source short. It’s fun for camping, and doesn’t really matter there, but isn’t it important to keep Shoes source readable, to make it easier for people to contribute?

The unabridged version of camping is readable, but it’s still a pain to keep track of the context (I find myself scrolling up and down a lot to remember what one one-letter variable did, while reading a different one-letter method).

Other than that, awesome! Looking forward to using Shoes when I have a use for it.


said on August 23rd 08:31

Can we fit trees and grids under that cap?


said on August 23rd 09:36

Give some breathing room; cap it at 12,345 lines.


said on August 23rd 09:43

zimbatm: Oh, clunk, I hadn’t thought to find inspiration in TeX.

Lucas: Shoes is written in C. That’s already one layer of obfuscation too many!!

jeem: You can emulate trees and grids by piling up stacks and flows. I guess I’m hoping someone will do it as a lib.

silby: And with 6,789 comments, I’m sure.


said on August 23rd 09:50

A cap goes on one end, and shoes goes on the other. I like the symmetry.

However, if you stop writing code when you hit 10k lines we’ll never be ready for the enterprise.

Oh, wait.


said on August 23rd 10:27

The only thing that got me back on wmii from dwm was the lack of a stacking window mode. That’s the feature that got me on wmii from ion, and I really couldn’t work comfortably without it.


said on August 23rd 10:45

One of the things I love about dwm is how well it works with fullscreen virtual machines. It leaves just its little bar across the top, so I can run a bunch of VMs fullscreen on different tags. I used to use stacking mode, too, on wmii-3, but it was really just a luxury. Giving each window its own tag is all I need really.


said on August 23rd 12:33

Well, I’ve become kind of addicted to being able to spawn a terminal with a single keystroke, do stuff in it, and close it again without interfering with any other windows. Or not close it. I ended up spending a lot more time thinking about my window layout, which is exactly what dwm and allies are intended to prevent.

So these days, it’s wmii, ion, or ratpoison. The edge for wmii is actually just because it plays more nicely with Cedega.

Speaking of dwm, though, I did end up writing a status bar controller for it, which is at least tangentially germane to hackety.org.


said on August 24th 10:03

IronRuby is in alpha now, and the developers showed off a little demo of writing Ruby to make a simple windowed app:


I think it’d be neat to see a direct IronRuby/Shoes comparison, I bet Shoes would come out a lot more compact.

tree and grids

said on August 24th 10:07

_why, I meant tree and grid controls, not layouts.


said on August 27th 13:28

Oh my, dwm is amazing. I just installed it on a server at work, and I’m in love. This is going on my own machine asap!

That aside, I really like what you’re doing with Shoes. I remember being terrified of starting GUI programming. The world is in desperate need of a truly intuitive toolkit, and this seems to fit the bill nicely. Great work, as always :)


said on August 29th 05:58

klondike: The tie-between for the API comes as a bi-product of their shared type system. It seems there are some specific restrictions or allowances, based on language (see the discussions over in python land), but really the GUI stuff has basically no existence on the ruby side, and is plain old .NET stuffs.

_why: Can any of the significant offenders be abstracted further, or maybe code generated?


said on September 7th 22:15

@klondike: most of the work in that sample is done by the WPF engine. We’re also missing a lot of Ruby features in that version of IronRuby, so we’re limited in what we can do. To do things correctly, we need instance_eval, and we haven’t implemented that yet in our trunk …

Comments are closed for this entry.