PHP/GTK

I am considering using PHP-GTK for a decent sized user interface project. The project has some fairly unique requirements:

  • M$ windows and X-windows support
  • Major parts (if not all) need to be easily distributed
  • Pretty fast (10 updates/second)
  • Extremely responsive (think machine control)
  • Customizable for each installation


I tried to use PHP-GTK once before (2004?), but it was way too beta. PHP-5 seems to do some decent garbage collection based on the tests I tried. Before I was running out of memory in a hurry and a typical session for this app will be days or weeks. Although I was pretty disappointed in the documentation for the project. I guess if it were me I would have copied the API for gtkmm, but I am shameless code raccoon fond of leveraging existing work. I mean, many of the functions don’t even list the arguments!

I guess given that even though PHP seems to have matured wrt programming applications, PHP-GTK is not quite there. So I think I will stick with gtkmm and C++. The drawback of that is the distribution part is going to be difficult. I have done some looking at libglade, but I am thinking that it will not be flexible enough to accomplish the task. Although it would be cool to use a layout tool to create screens rather than a text editor.

One thought that crossed my mind (perhaps due to the late hour) is to use Java. But it has left a bitter taste in my mouth (I don’t drink coffee either). It has been a few years for that too. Am I just doing it wrong or does Java suck in the real world? My previous forays were with applets, maybe that was the problem. I’ll have to do some more research on that…

2 Responses to “PHP/GTK”

  1. Nate Kohari Says:

    If PHP-GTK is fast enough, I’d think that Java would be fast enough too. Applets are terrible and not really indicative of normal performance. You can always optimize out critical sections of the code to native languages, too. Still, Swing is probably not fast enough for what you want. There are probably bindings for native UI libraries like GTK, though.

    Most useless comment ever, right? :) Nice blog, though.

  2. bmr Says:

    It is the most useful comment on my blog so far. I guess I was thinking that if I use Java, then I would not use GTK. C++/gtkmm is probably the safest bet since it can definitely provide everything I need and, as you said in some other post, it is easier to find resources to work on C++ rather than some halfway commented pet project like PHP-GTK. Although I still think PHP-GTK could be cool.

    Probably the right thing to do is to generate a little more formal specification for what we are trying to do and then discuss it more. I can’t seem to settle on a technology for this, so that is not a good thing. However, the approach that I have isolates the UI code from the backend code via a socket. So any wasted effort in picking the wrong tool should be minimized.

    I am starting to realize that I have done way too much off-the-cuff design in the past.

Leave a Reply