Mathias Hasselmann

GTK+ Binding Usage

Misread a statement from Mikael Hallendal on gtk-devel-list today.

He wrote:

For example the C# bindings are not on the GNOME bindings page, even
though it is one of the most used and high quality bindings for GTK+.

I read:

it is the most used and high quality bindings for GTK+

Wanted to counter proof this statement he never did, so I ran this tiny script on apt's package list:

for b in libgtk2.0 python-gtk libgtk2.0-cil libgtk2-perl libgtk2-ruby
do
  c=$(expr 0 $(grep -c "^Depends:.*\\<$b" \
      /var/lib/apt/lists/*archive.ubuntu.com_ubuntu_dists* |\
      sed 's/.*:/+ /'))
  printf '%-15s %5d\n' $b: $c
done
Gutsy Hardy
libgtk2.0: 1535 1530
python-gtk: 208 221
libgtkmm-2: 85 89
libgtk2.0-cil: 54 54
libgtk2-perl: 42 45
libgtk-(java|jni|cni): 24 22
libgtk2-ruby: 17 18
liblablgtk2-ocaml: 15 15
libgtkada-2: 7 7
libghc6-gtk-dev: 10 5

Nothing surprising it seems.

Update: Readers pointed out that I missed the widely used gtkmm bindings. Added them and some less frequently used bindings. Added emphasis.

Comments

A. Walton commented on March 27, 2008 at 1:12 a.m.

Nice analysis, but I think you missed gtkmm;

libgtk2.0: 1534
python-gtk: 221
libgtkmm-2.4-1c2a: 76
libgtk2.0-cil: 55
libgtk2-perl: 45
libgtk2-ruby: 18

And for kicks:
libgtkada-2.8: 7

Aaron Bockover commented on March 27, 2008 at 1:18 a.m.

Of course your analysis doesn't take into account the actual code size of the applications consuming the bindings...

I'd venture to guess that most pygtk applications are fairly small, and that a greater number of Gtk# applications are larger and more complex on the whole.

I recommend fetching all of those packages, extract their sources, and get a total line count for each language. That might be a more representative approach.

Just a thought.

Milosz Tanski commented on March 27, 2008 at 1:29 a.m.

Alright dude, you deliberately manipulated the quote.

"it is the most used and high quality bindings for GTK+"

and he said

"it is one of the most used and high quality bindings for GTK+"

You directly took out "one of" and balded it to sound worse two.

Yes the C# gtk bindings are ONE OF THE MOST used bindings, they are more used then perl, ruby, ada, D, haskel, ocalem, i could keep going on. The only bindings that they not more popular is c++ or python.

So the original is correct, and your miss representing his comment on prepuce.

Some Fellow. commented on March 27, 2008 at 3:04 a.m.

"Alright dude, you deliberately manipulated the quote."

He acknowledged the statement was never made: "Wanted to counter proof this statement he never did"

He was just curious to see what that actually meant.

"Of course your analysis doesn't take into account the actual code size of the applications consuming the bindings..."
Of course, your analysis doesn't take into account that code size is a very poor metric for judging the quality and usability of said applications consuming the bindings. We can go on for days like this.

Anonymous commented on March 27, 2008 at 3:09 a.m.

"Prepuce" is probably the absolute best misspelling of "purpose" *ever*

Johannes commented on March 27, 2008 at 9:25 a.m.

jhs@idefix:~$ for b in libgtk2.0 python-gtk libgtkmm-2.4 libgtk2.0-cil libgtk2-perl libgtk2-ruby; do c=$(expr 0 $(grep -c "^Depends:.*\\<$b" \
/var/lib/apt/lists/*archive.ubuntu.com_ubuntu_dists* |\
sed 's/.*:/+ /')); printf '%-15s %5d\n' $b: $c; done
libgtk2.0: 1530
python-gtk: 221
libgtkmm-2.4: 89
libgtk2.0-cil: 54
libgtk2-perl: 45
libgtk2-ruby: 18

Murray Cumming commented on March 27, 2008 at 10:59 a.m.

More importantly the C# bindings ARE on the list of official GNOME bindings, as I said in that mailing list discussion.

Mathias Hasselmann commented on March 27, 2008 at 11:47 a.m.

Aaron: This little test doesn't aim for scientific quality, it's just some kind of simple reality check.

Still considering lines of code would be quite bogus: First of all code density differs dramatically for the various languages. Python and Perl code usually requires significantly less lines of code, than C#, C++, or even C code. Well, and then code lenght also is highly dependant on the experience of it's programmer. Experienced coders tend to produce more compact code, than unexperienced programmers in my experience.

So for an absolutly accurate measurement you'd want to have a scientific method to classify packages as small/medium/large, trivial/normal/complex and use that information when counting. Far too much work for a simple reality check. Well, and nevertheless people not likeing the results would try to challenge your method.

Johan Dahlin commented on March 27, 2008 at 12:33 p.m.

I think using the apt-cache rdepends command can accomplish the same thing, in a less hackish way.

Mathias Hasselmann commented on March 27, 2008 at 12:44 p.m.

Johan: That's the problem with powerful tools. Nobody knows all their features. Thanks for the hint. My method still has the slight advantage of focusing on packages from ubuntu.com, and ignoring custom apt sources that I have in my sources.list.

John Stowers commented on March 27, 2008 at 12:46 p.m.

Its interesting that python-gtk usage increased sharply gutsy-->hardy, while the number of users of other bindings decreased, or remained unchanged. [1][2]

[1] Small sample set, not enough information to be conclusive, etc, etc
[2] Excluding perl and gtkmm, which registered modest increases

Boke commented on March 27, 2008 at 2:13 p.m.

By "even though it is one of the most used and high quality bindings for GTK+"

Mikael maybe meant "even though it is LATELY one of the most used and high quality bindings for GTK+"

There are lots of old python-gtk and gtkmm projects out there.
GTK# is pretty recent in comparison.

Mathias Hasselmann commented on March 27, 2008 at 2:51 p.m.

Boke: I really just misread Mikael's statement. Did my stats. Searched his statement for this posting. Read it again. Realized my mistake, well and I kind of agree.

AFAIK python-gtk and gtkmm are very vital and heavily used bindings. gtk-sharp also is very vital, but not as big as its fans want us to believe.

Quite certainly the numbers differ among distributions. I am quite sure Mandriva has more Gtk::Perl based applications. Wouldn't be surprised, if SuSE ships more gtk-sharp applications.

Probably gtk-sharp also is used more frequently for in-house development, than other bindings - but those in-house deployments are impossible to measure. So we only can measure is public use of our bindings.

Murray Cumming commented on March 27, 2008 at 3:02 p.m.

> Probably gtk-sharp also is used more
> frequently for in-house development,
> than other bindings

I doubt this, personally.

Mathias Hasselmann commented on March 27, 2008 at 3:20 p.m.

Yes Murray, we absolutly do not know what happens in-house. Meant "maybe", wrote "probably".

Eduardo de Oliveira Padoan commented on March 27, 2008 at 3:55 p.m.

Boke: "There are lots of old python-gtk and gtkmm projects out there.
GTK# is pretty recent in comparison."

And yet, the number of PyGTK apps in Ubuntu is increasing, while GTK# numbers are still the same in this (ok, short) period.

Miguel de Icaza commented on March 27, 2008 at 4:06 p.m.

Thanks for sharing with us the list.

Gnome is truly a multi-language framework, congratulations and thanks to all binding authors!

Miguel.