MAR
17
2002

Python/C# Mania: New Bindings Expand KDE Languages

Today marks a special coincidence. First,
Adam
Treat
released the initial version of
Qt bindings for C#,
which consists of 476 Qt classes converted to C#.
The bindings work with the Mono
compiler, runtime environment and class libraries, enabling a fully Open Source implementation of C# for Qt. While not yet ready for
a real application, Adam has managed to write and execute a
Hello World! program
(screenshot).
KDE bindings are on the drawing board. Shortly thereafter,
Phil Thompson, Jim Bublitz and
theKompany.com
released KDE 2 and KDE
3 bindings for Python
. Together with the Java, Objective C and C bindings in the
kdebindings
module, as well as the
Ruby
bindings
, KDE is providing developers a broad gamut of application
development languages. Great work, Adam, Phil and Jim!

Comments

It's great that there are news on the language binding front. But, when will we ever see new Perl bindings for Qt/KDE? There are lots of skilled Perl programmers out there, and I'm sure they could benefit the KDE community to no end if there were bindings available.

And, no the Qt bindings on CPAN doesn't seem to work :-( Could this be a conspiracy to force Perl people to switch to Python!!!! :-)


By KAP at Sun, 2002/03/17 - 6:00am

"But, when will we ever see new Perl bindings for Qt/KDE?"

Yes, Germain Gerand, TJ Mather and myself are working on Perl bindings for Qt 3/KDE 3, and they should be ready for KDE 3.1.

The bindings are generated from 'Perl Interface Generator' .pig files that used to be prepared by hand. We've added a .pig file generation option to the kalyptus bindings generator to autogenerate them. Germain has regenerated the bindings for Qt 2.2.x and KDE 2.2.2, and pretty well got that working in TJ's cvs.

But the big problem with Qt 3 is that the bindings assume the moc works the way it did for Qt 2. The was a type in Qt 1.x/2.x called 'QMember' which was a pointer to a function for the target slot to be called. In Qt 3 the moc has been changed so it uses an integer offset into the slot table as 'QMember' to invoke a slot. So the slot/signal handling needs to be redone (and the code is quite tricky to follow).

-- Richard


By Richard Dale at Sun, 2002/03/17 - 6:00am

Is there a link where you post the information regarding the progress of your development?

Thanks.


By Ricardo Pacheco at Tue, 2002/07/16 - 5:00am

"Could this be a conspiracy to force Perl people to switch to Python!!!! :-)"

THAT would be a good conspiracy theory for a change *ducks away from flamethrowers and runs home* :-)


By Danny at Sun, 2002/03/17 - 6:00am

Don't make me bring out my Swiss Army Chainsaw! :-)


By Carbon at Mon, 2002/03/18 - 6:00am

Yes, there is still plenty of work, but things are moving...

Here is a little screenshot with only PerlQt apps (running Qt-2.3.1).
Some more skilled Perl/C/XS programmers would be quite welcome though...


By Germain at Wed, 2002/03/20 - 6:00am

uh oh... seems the attachment thingy didn't work...

http://www.phoenix-library.org/germain/shots/PerlQt-2.3.1.png


By Germain at Wed, 2002/03/20 - 6:00am

Great news, good to see that mono will have support for both the major desktop environments.


By rogue at Sun, 2002/03/17 - 6:00am

Now you get Mono for free under KDE? Genius... but will this require you to install GNOME? Not so good...


By ac at Sun, 2002/03/17 - 6:00am

No, you are not required to install Gnome. Mono is _not_ a part of Gnome... yet ;-) Even if Mono is included in Gnome in the future, the Qt bindings will only require Mono's runtime (jit and corlib) and compiler (mcs).


By Adam Treat at Sun, 2002/03/17 - 6:00am

all hail the genius! :-)

good job, man.


By ac at Sun, 2002/03/17 - 6:00am

ac, you better get your act together man.
I've seen you on gnome-news also.
You're the one always posting controversial stuff.
Now what is "Genius... but will this require you to install GNOME? Not so good..." supposed to mean?
Have you no respect for the gnome-developers?
And no, if you would know what a compiler was, you wouldn't be asking this question...
Didn't you figure out yet, that it's all about the community.
Who cares what DE you like. All the developers are there to give a product to the community. Should you therefore continue to bash them?
Silly man, crawl back in the hole where you came from...

(To other folks, sorry you had to read this, but I've seen this fellow more than once, with no good word coming out of his mouth)

Yours truly,
Pissed of blashyrkh


By blashyrkh at Sun, 2002/03/17 - 6:00am

Does GNOME require the install of KDE? See that would be bad just like it would be bad if the install of KDE required GNOME. Nothing controversial here. Self-important anti-trollers like you are just as bad as the real trollers.


By ac at Sun, 2002/03/17 - 6:00am

First of all, Mono doesn't require you to install GNOME as it isn't a part of GNOME.
Second of all, GNOMErs might start using aRts, which IS
actually a part of KDE. There is nothing wrong with either.


By anti-ac at Sun, 2002/03/17 - 6:00am

:: Second of all, GNOMErs might start using aRts, which IS actually a part of KDE.

No offense, but I've heard this for awhile without anybody who states it being able to back it up. Where did this "common knowledge" come from - it's been repeated quite often, but I haven't seen any links to any developers actually discussing it. I'd like to have documentation to potentially back up this.

--
Evan


By Evan "JabberWok... at Mon, 2002/03/18 - 6:00am

There was occasionally talk about using CSL by Stefan and Tim Janik, and that can output to OSS, Arts and Alsa, but no-one seems to know whats going to happen


By iain at Mon, 2002/03/18 - 6:00am

Weird! Iain replied to you earlier, but his response has disappeared. At any rate, there has been discussion on the GNOME lists (from last August or September, I think) about using aRts. No decision has been made yet, and there is no default sound server/sound system for GNOME 2.0. The developers decided to wait and see how things play out in development between the different contenders. The two front-runners are aRts and GStreamer: the former is a little more mature, while the latter is more integrated with GNOME (it uses GLib). A decision will most likely be made for GNOME 2.2. Cheers!


By aigiskos at Wed, 2002/03/20 - 6:00am

Anyone working on php-qt or php-kde ?
Since php-gtk is available, it should be possible to get a binding with your favorite toolkit :)


By Moby at Sun, 2002/03/17 - 6:00am

php-gtk is just a proof of concept, it's not usefull at all for real development


By Benko at Sun, 2002/03/17 - 6:00am

Well, I have to say it is.
For little apps, it's very good.
You see, PHP is the easiest language out there IMHO, and I already did some really good php-gtk programs with it.
Yes, the real problem here is that a php compiler is missing, so distribution of it is very hard on linux machines.
But indeed it's very good and very, very cool. I would love to have qt-php :)


By Iuri Fiedoruk at Sun, 2002/03/17 - 6:00am

This is such a non-sense. Php is a scripting language for dynamic web page. If you want an easy scripting language, yet powerful, take python.


By Philippe Fremy at Sun, 2002/03/17 - 6:00am

What? Php-gtk is far from useless. I have written a proof of concept query tool in it, and it runs very fast, and because of PHP's excellent DB functionality, can connect to virtually any databas eunder the sun. PHP-Mole (http://www.akbkhome.com/Projects/Phpmole-IDE/) is a feature-rich IDE being written entirely in PHP-GTK. I'd suggest checking out stuff next time before making sweeping assumptions.


By Jason Keirstead at Sun, 2002/03/17 - 6:00am

I have to disagree... as both a python and PHP programmer, both are useful and very complete languages. PHP is extrodinarily good at generating text files of any sort (due to the way it handles output), but can be used to do virtually any task. I have a PHP script that goes through my MP3 files, renames them (capitalizing words, spacing dashes, etc), and resets the ID3 tags (a binary operation) in them to what the filename suggests.

Like Perl and Python, PHP supports modular, loadable libraries, and also supports classes. It is very much capable of being interfaced to Qt and KDE and producing useful applications. And even if your view is *still* that it is "just a HTML scripting language", let me kick this idea out - DCOP aware webpages on your intranet.

--
Evan


By Evan "JabberWok... at Sun, 2002/03/17 - 6:00am

Yep, I'll second that. I have a PHP project that runs as a daemon, using SQL based mp3 playlists
to play music, and talking about it (and automagically downloading and reading news) with
Festival. I probably could've gotten better performance if I had written it in C or even Perl, but
it didn't take me long to develop, and it was a good exercise to finish up learning PHP.

*Shameless code promotion* That app isnt in devel anymore, but you can get it at
geekradio.sf.net, and I might just continue to work on it if there's any demand.


By Carbon at Mon, 2002/03/18 - 6:00am

s/python/ruby/


By Guillaume Laurent at Mon, 2002/03/18 - 6:00am

I would really like to see a phpQt.

Maybe now is the time since PHP5 is about to come out.


By jaxn at Tue, 2003/11/11 - 6:00am

Can PHP shares toolkit from other language if PHP is ported to Parrot?


By Vee Satayamas at Thu, 2004/03/11 - 6:00am

Does somebody knows if php-Qt is being developed? if not it could be a great project that i thought about a time ago.


By Ayoze at Thu, 2004/09/09 - 5:00am

Hi,

What a surprise, I had the same idea yesterday.
However, since php is written in C, this would require to
adapt the C bindings into a php extension.

The next idea was to implement a dcop client wrapper for
php. Since dcopc has only about 30 functions, it should
not be too difficult.

I started yesterday, and if there is any progress, you will
read about it on the dot.


By Matthias Lange at Mon, 2002/03/18 - 6:00am


By nobody at Fri, 2006/01/20 - 6:00am

TheKompany's page says the 6th alpha version of the KDE2 bindings are released. Nothing about the final release or KDE3 bindings.


By Philippe Fremy at Sun, 2002/03/17 - 6:00am

Plus, I wasn't able to build the Python binding code, plus it is not included in most (any) distro.

For Python to really make it as a language under KDE, you would need to have support at the core level. That is, you install KDE, you have the Python bindings, period.

http://www.ondelette.com/indexen.html - visit the wavelet forum!


By Daniel Lemire at Mon, 2002/03/18 - 6:00am

For Python to really make it as a language under KDE, you would need to have support at the core level. That is, you install KDE, you have the Python bindings, period.

We should not repeat GNOME's mistake of requiring python and probably 200 other languages for a base install just because some applications are written using it. We don't want a 1 GB base install... (Remember that we could do just the same thing for C#, Java, C, Objective-C bindings... There's no real reason why Python is more important than any of those).

It's a sort of chicken and egg problem - distributors will start picking up PyKDE once there are applications for it. Developers will pick up PyKDE once they're aware of it, which is often by seeing it in a distribution.

For a start, I'll add PyKDE in one of the next Red Hat Linux releases; it's too late for the next one, unfortunately.


By bero at Wed, 2002/03/20 - 6:00am

Geesh, I would love to see updated versions of Ruby/Qt and Ruby/KDE and sweep away all of those Python and Perl crowds ;D


By unnamed man at Sun, 2002/03/17 - 6:00am

Ruby bindings have been updated to 0.15, look in the app box to the right.


By ac at Sun, 2002/03/17 - 6:00am

Nope, they aren't updated. They appear in apps.kde.com as updated 'cause it is the first time they are added to the apps index. They are still for KDE 1.x and Qt 2.0.x


By unnamed man at Sun, 2002/03/17 - 6:00am

"look in the app box to the right"

What's this then? Sounds like an adventure game to me :)

Which version of Qt/KDE does the 0.15 release of the Ruby bindings relate to? As far as I know Nobuyuki Horie hasn't updated the bindings for the last six months.

I've added a Ruby bindings code generation option to the kalyptus bindings generation utility - usage 'kalyptus -fruby '. It needs a bit more work (maybe only a week or so to add method overloading code generation), but then it should be much easier to keep up to date than maintaining SWIG interface files.

-- Richard


By Richard Dale at Sun, 2002/03/17 - 6:00am

The Ruby bindings were done with SWIG ( http://www.swig.org/ ) , which doesn't exactly automate the process of writing wrappers around C++ code.

I really doubt bindings will be able to keep up with KDE unless something more efficient comes along.


By Neil Stevens at Sun, 2002/03/17 - 6:00am

It seems to be that something could be drawn from one of the indexing programs such as lxr. (http://lxr.kde.org/) which automatically parses the classes in KDE. Failing that, the documentation is kept in a structured format, so bindings could be autogenerated from that information, complete with documentation for the bindings.

--
Evan


By Evan "JabberWok... at Sun, 2002/03/17 - 6:00am

What you've just described is Kalyptus. It is a modification of KDoc by Richard Dale, and it is excellent. Basically, all of these bindings (Java, C, Objective-C, C#, and perl) are drawn from Richard Dale's work. Look a few posts above and you will find that Richard is working on some new Ruby bindings as we speak.


By Adam Treat at Sun, 2002/03/17 - 6:00am

Since it took the person who wrote Ruby bindings for GNUStep only about a day to do it (he didn't know anything aobut GNUStep and was a newbie to ruby) how long can it take to write Ruby Qt ... an hour?

Oh yeah I forgot KDE/Qt is C++ ... blech :-)


By NameSuggesterEngine at Tue, 2002/03/19 - 6:00am

yeah, but kdec/qtc is C :P


By dc at Tue, 2002/03/19 - 6:00am

KDE has language bindings for dynamic languages like Objective-C or Java, so it should be possible to write a dynamic bridge to those languages like the Ruby/GNUstep one (or even use the same code). I think JPython should work well with the Java bindings.

But it isn't that much effort to write static bindings, once you don't have to prepare heroic amounts of SWIG interfaces by hand.

-- Richard


By Richard Dale at Tue, 2002/03/19 - 6:00am

Now, these days, it seems that most programs are written in a programming language. It also happens that most utilize an application programming interface (API).

In trying to understand what .NET was, I decided to split it into the C# language and the API (which is called CLI or something). C++ was the object oriented derivate of C, and one example of API is Qt (of which KDE looks like an extension), another is GTK+ (of which GNOME looks like an extension) with its C++ bindings. Then comes Objective-C and OpenStep, Java and Java (um, Java language and Java API)...

I don't think the world needs another one!


By .NET is a big w... at Sun, 2002/03/17 - 6:00am

Bah.. yet more trolling. .NET is actually a good idea. First of all, C# looks like a nice language, although a pretty unoriginal java-copycat.

But the second idea, of a CLI (Common Language Interface), which makes it so you won't have to write new bindings for each and every language is a good idea.

If it works, MONO would be a very nice development platform for it seems BOTH Gnome and KDE. Way to go!

Perhaps it will also mean that you can program once, and have it run under both Windows, KDE, and Gnome with native look and feel.


By Gaute Lindkvist at Mon, 2002/03/18 - 6:00am

We can port program in Java since years and it work very well.
In Java, there is even a native toolkit integration. It is called AWT.
And nobody uses it! It is not because it not slow or because the API is bad.
It goes even very fast.

But when you write your application for a OS (ex Linux), it looks awful
in another one (ex Windows). To solve that, you finish by having a part
of your code that handles the difference between the OS. Just because
of that, nobody uses it.

I do not want to see .NET. Just because it is Microsoft. They do not
compete by technology but by a huge distribution channel.

In the Java world, everything is not perfect too.

I think there is no public implementation of AWT in QT. It is just Motif.
Trolltech has written one for the Zaurus. But it is not available on Linux.
It should be very, very good to have it as a standard part of the JDK on Linux


By Marc at Tue, 2002/03/19 - 6:00am

AWT was terrible, you probably mean SWT?
Swing is also terrible, first you need a good look & feel,
combining the new XP look+feel with JGoodies is a good way...

But with Java you can't make quickly some dialogs, with C#
and .NET you can get good looking dialogs very quickly.
Just like I could for years with Delphi.

Java has its strong points, but GUI development is not one
of them. And for Gnome and KDE we need GUI's not backend
programs.

C# is a good programming languages, it has most of the things
I liked from Delphi, and as a big improvement over C++ and C, it
has internal string class. It would be nice if Trolltech would help
and make a version where the QString class is not needed any
more for the QT/C# bindings.

But I don't see many differences between using Mono with GTK#
or QT#, and Java using SWT, for every plattform you need a
new GUI Design. Hopefully one day someone will come up with
a better solution for that...


By Boemer at Tue, 2005/02/22 - 6:00am

Now, these days, it seems that most programs are written in a programming language.

No, really ? Wow, that's really deep. Makes one think, doesn't it ?


By Guillaume Laurent at Mon, 2002/03/18 - 6:00am

Alright, I know this is totally offtopic. But in the Hello World screenshot (http://qtcsharp.sourceforge.net/snapshot.png) there is an xmms... thing in the toolbar of kate. Is this application specific? What is the source?

I don't think it's xmms-kde, but I could be wrong.

The screenshot is at

And to keep things vaguely relevant...

The speed of open source & especially KDE development never ceases to amaze. I guess a tower is much easier to vuild when the foundations aren't wrapped in bubble wrap.

Alex W


By moreati at Mon, 2002/03/18 - 6:00am

No, that's just regular old xmms minimized and placed in that location by me for easy access when working ;-)


By Adam Treat at Mon, 2002/03/18 - 6:00am

Pages