sábado, 19 de octubre de 2013

libgtk flavours

libgtk is one of the most known and used widget libraries. As the base of the GIMP drawing toolkit, as well as the base of the GNOME desktop environment, it has been a very active Open Source project in the last years.

In general, GNOME platform, together with glib, libgtk and many other libraries, it is not only a mechanism to implement graphic applications for GNOME desktop, but also a complete tool set to implement very different applications in top of varied purpose programming languages. Some examples of this kind of different libraries are:

- Pango: for text rendering
- Cairo: for 2D graphics rendering
- GStreamer: as Multimedia library for audio and video reproduction
- PulseAudio: as proxy for sound applications

Back to libgtk, this is basically a C library that allows programming widget base applications. However, there is a whole bunch of bindings to another languages that help on using and expanding the library to a wider set of programmers. Regarding this bindings, there are two well differentiated groups [1]:

- GNOME supported bindings:

Language2.102.122.142.162.182.202.222.243.03.23.43.6
C++ O [#][#][#][#][#][#][#][#][#][#][#][#]
C# O [#][#] _  _  _  _  _  _  _  _  _  _ 
Java O [#][#][#][#][#][#][#][#][#][#][#][#]
Python O [#][#][#][#][#][#][#][#][#][#][#][#]
Javascript O [#][#][#][#][#][#][#][#][#][#][#][#]
Vala O [#][#][#][#][#][#][#][#][#][#][#][#]
Perl O [#][#][#][#][#][#][#][#][#][#][#][#]

Legend

  •  O  Official GNOME Binding
  • [#] Supported
  •  @  Partially Supported
  •  _  Unsupported

Among the languages supported by GNOME, several of the most used programming languages are found, as C++, but also Java, Javascript, Python and Perl and C# (all of them are included among the 12 first places of the Tiobe programming language ranking).  It is somehow surprising that a minority language as Vala is also supported, indeed very well supported, from 2.10 to 3.6 versions, all GTK released versions are supported.

- GNOME unsupported bindings:

Ruby[#][#] @  _  _  _  _  _  _  _  _  _ 
Pascal[#][#][#][#][#][#][#][#] _  _ [#][#]
PHP[#][#][#][#] _  _  _  _  _  _  _  _ 
R[#][#] _  _  _  _  _  _  _  _  _  _ 
Lua[#][#][#][#] _  _  _  @ [#][#][#][#]
Guile[#][#] @  _  _  _  _  _  _  _  _  _ 
Ada[#][#][#][#] @  @  @  @  @  @  @  @ 
OCaml[#][#][#][#] _  _  _  _  _  _  _  _ 
Haskell[#][#][#][#][#][#][#][#][#][#][#][#]
FreeBASIC _  _  _  _  _  _ [#][#][#][#][#][#]
D _ [#][#][#][#][#][#][#][#][#][#][#]
Go _  _  _  _  _  _  _  @  _  _  _  _ 
Fortran _ [#][#][#][#] _  _  @  @  @  @  @ 


Legend

  •  O  Official GNOME Binding
  • [#] Supported
  •  @  Partially Supported
  •  _  Unsupported

Among unsupported languages, it is surprising that Ruby and PHP languages (13th and 5th most popular languages according to Tiobe programming language ranking [3]) are not supported bindings.

But, apart from the C++ binding, which is indeed the main development programming language on this project, which is the most popular binding ? Not much information is provided regarding this on the Internet, but initially, as one of the most popular programming languages, C++ and Java should be two of the most popular bindings. However, as an starting GTK developer, another binding always appears when looking on the Internet for information regarding GTK. That binding is pyGTK, So, from my ignorance, I would dare to assert that C++, Java, and Python should be the most used GTK bindings.

But why also Python? Well, as also a newbie in this programming language, I consider that the ease of programming with this programming language, as well as its increasing popularity in the Open Source scene, (obviously apart from Java, C/C++), help on this binding to be one of the most active ones.

But is Python on GTK really so easy? Well, a good example of this fact is the comparison of a GTK hello world provided by Tom Lee on his blog [4], Compared to other languages, it is shown that languages as Ruby, Perl or Python allows coding a "Hello World" application in much less words and lines that in other languages such as C:

- libgtk "Hello World" on C programming language:

#include <gtk/gtk.h>

int main (int argc, char **argv) {
  GtkWidget *window;
  gtk_init(&#038;argc, &#038;argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), "Hello, World");
  g_signal_connect (G_OBJECT (window), "delete-event", gtk_main_quit, NULL);
  gtk_widget_show_all (window);

  gtk_main();
  return 0;
}

- libgtk "Hello World" under Python programming language:

import pygtk
pygtk.require('2.0')
import gtk

window = gtk.Window()
window.set_title('Hello, World')
window.connect('delete-event', gtk.main_quit)
window.show_all()
gtk.main()

So, an eye must be kept on Python language binding, as it seems to be one of the most used and alive GTK bindings nowadays.

To summarize, no excuses around programming language used allowed to start programming visual interfaces on top of GTK, A wide bunch of  bindings are supported, and several of them around the most used and easy programming languages.

References:
[1] http://www.gtk.org/language-bindings.php
[2] http://tomlee.co/2008/01/gtk-hello-world-in-six-different-languages/
[3] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
[4] http://tomlee.co/2008/01/gtk-hello-world-in-six-different-languages/

sábado, 5 de octubre de 2013

Some numbers about Eclipse usage per programming language

Eclipse development tool set is, no doubt, one of the most popular development tools. Although difficult to estimate how big this popularity is, Eclipse is one of the most popular due to different aspects such as:

- Its modular architecture, plugin based.
- Its flexibility, as it can be used for different programming language, and to implement different type of tasks.
- Its ease of use.
- Its OpenSource nature, with all the benefits that this convey.

However, it is difficult to find market share statistics around Eclipse usage, as, due to its flexibility, it is present on different development tools market, being also hard to compare on a per programming language basis.

An interesting issue to explore are the profiles having to do with developers that download Eclipse. Next very interesting graphics, provided by eclipse howl, show the different flavors downloaded from Eclipse Kepler version after one million downloads:



From this graphic, it is obvious that Eclipse is mostly used for Java programming language. Considering that Standard version is, above all, suitable for Java developers, the total per-share percentage of usage for Java programming language above 84 %.

Another interesting graphic from eclipse howl, shows the statistics associated to the previous version of  Eclipse, Juno. In this graphic it can also be appreciated that Java was also the predominant programming language:



Based on this graphic, some assertions can be made on the programming languages used inside Eclipse:

- Java is the most used programming language for Eclipse.
- C/C++ programming appears always as the second programming language being used.
- No third programming language appears associated to the Eclipse version. The rest of flavors are, indeed, more functional oriented, in terms for flavors for Mobile, flavors for Modelling tools, Flavors for Parallel application development, and so on, and so forth.

However, some differences can also be observed from previous graphics [1]:

- Mobile flavor has disappeared.
- C/C++ flavor continue to decrease its position
- Java continues to increase its position respect to the rest of programming languages (72% -> 84%)

Some doubts can appear around the usage of Eclipse for other programming languages. How do we know that Python, in example, with its PyDev plugin, is not being widely used, even more than Java?

With the lack of statistics around this issue, another good thermometer for this per programming language usage of Eclipse is the Eclipse OpenSource developer report. This report shows some statistics around Open Source issues and development usage, such as:
- Operating System.
- Application server.
- Server Framework.
- Source code control version system.
And, of course:
- Programming language.

Java programming language predominance can also be observed on this report, with a share of 67%. Very far is C++, with 11% share, PHP, with 5%, Python, with 4%, C, with 3% and JavaScript, with also 3%:



So, to summarize, Eclipse is a nice set tool for programming but, indeed, there is no doubt that it is an indispensable development tool for Java.

References:
[1] eclipse howl: http://eclipsehowl.wordpress.com/
[2] Eclipse OpenSource developer report: http://www.slideshare.net/IanSkerrett/eclipse-survey-2013-report-final