29 November 2007

On pykeylicious, Python vs Perl, and the state of Konqueror

If you use KDE, as I do, you should check out KDE-apps; it's a nice site full of all sorts of programs and add-ons for the desktop environment, from full-featured applications like K3B and Amarok to simple enhancement to the UI, kicker replacements, etc etc.

On this site, there is a fantastic little feature that allows you to "subscribe" to an application; when the application is changed/updated, you get a reminder via email. I personally subscribed to a few little apps (KShutdown, QtEmu, kio-locate...) that are not included in the standard KDE and are often off-the-radar for mainstream distribution packagers, so they are a bit difficult to track in the regular ways.

One of these apps was konqil.icio.us, an addition to the Konqueror right-click menu to do a few things with del.icio.us. Last night I found the email saying that a new version was out, so I went there and downloaded it; while reading the description, I immediately thought "why do I need to do all this messing with folders and permissions, a little installer could do it for me!". Then I checked the dependencies, and found that the script was in Perl... there was no chance I'd write an installer in Perl (I hate it) and send it to the original developer; also, adding a dependency on python for the installer looked a bit silly. So I decided to rewrite the script in python, add the installer, and upload it, and pykeylicious was born.

All this reminded me of how easily "tweakable" Konqueror (and KDE in general) is. You add a file in the right place under $HOME/.kde/, and you have just hooked the interface to your programs and scripts. The problem is often finding the right place; documentation exists in non-obvious places, as KDE developers tend to talk more about the C++ infrastructure.

I personally think this is one of the factors that stopped people from moving to Konqueror from Mozilla/Firefox: developing third-party extensions seems hard in comparison. This might or might not be the case; as konqil.icio.us demonstrated, it is fairly trivial to build a simple extension... however, if you want to manipulate webpages and the internal DOM, you have to write a C++ plugin, which might be easy for C++ coders, which net-people usually are not. Net-people like "easy" languages like java, javascript, python or ruby.

Last time I brought this up (yes, it's one of my pet-subjects) on the pykde list, I found out that yes, you can probably build plugins in python, but you have to jump through several hoops and basically try to fake that you are a C++ program. Not good enough. The day this sort of things becomes easy is the day that Konqueror goes back to be a serious alternative to FF in the Linux world.

2 comments:

Anonymous said...

Have you looked at 2.0 yet? I've taken some of your better ideas (kdialog) thrown out the bad ones (rewriting it in the monstrosity that is python ;)) and hopefully the result is more usable. I also intend to implement your installer idea, but I'm figuring out how best to do that in light of the changes I've already made. Keep in touch though, hopefully competition is good ;).

toyg said...

Yeah, I've seen! At the moment I envy your "system-wide install" support, I should probably do it as well. At the moment, I'm trying to add another feature though... Competition is good indeed! :) BTW, I'll probably send you a patch tonight for the italian translation.