22 September 2006

Choosing the right scripting language

First thanks to everyone who gave feedback and suggestions on the scripting post!

I think most of the "advanced" users (hey, I didn't say geeks!) agree that it would be nice to have such a feature. The killer argument of course is the NetNewsWire has it too. The real problem is which scripting language to choose.

There are several soliticing candidates:
  • Python: because it's widely used in GNOME and Liferea is often used in a GNOME environment.
  • Perl: because it can be found on almost every serious Unix installation
  • LUA: because it never crashed my favourite Angband variant while I was fighting evil mass summoners on level 97 after running three days and several million turns.
  • Javascript: because Liferea uses Gecko/XPCOM anyway
But there are contra arguments:
  • Python: 15% of the users won't have it installed, another 35% will hate programs forcing them to install it
  • Perl: 5% of the users won't have it installed, maybe 15% will hate programs forcing them to install it
  • Python+Perl: many unnecessary language features and function modules
  • LUA: pretty unknown, it's is rarely installed per default
  • Javascript: doesn't work with the GtkHTML2 rendering module, and XPCOM might scare you
How to decide?

Of course the percentages given above are just some guessed numbers. But I think they illustrate the problem that using a standalone interpreter language, no matter how sophisticated and object oriented, will leave some users without scripting support. The advantage on LUA and Javascript is that as a compile time library dependency each will be available when the program itself is usable. If it is not then it is a problem of the package maintainer who needs to ensure the correct dependencies.

Scripting Support Plugins

In the end there is no really obvious candidate. I think for a GNOME-related program either Python or a very simple embedded-only scripting language are most suited. And therefore I'll stay with LUA. But I realized it as a scripting support plugin and it should be really simple (patches are welcome) to write an alternative Python support plugin. The advantage of having plugins is also that maintainers can provide optional scripting support packages with the correct dependencies.

No comments: