[JDEV] Scripting/Modules/Rant

Aaron Brady (insomnike) rewt at clubi.ie
Mon Aug 9 12:07:54 CDT 1999


I'd like to suggest something that a lot of people won't like :)

If we allowed loadable modules (.so,.dll) and standardised on an interface,
with standard hooks, we could do some impressive things, atleast
with some clients.

KDE/GNOME/JNix could load an .so with dlopen()
Win32 could load a .dll with ObscureCallW()
TCL/TK could load a .so via an additional TCL extension 'bridge'
I've a feeling PERL can but I don't know
Java - JNI? No idea

if we had something like 

->
int som_crypted_handler(JMsg *incoming);
 
 void on_module_load(void) {
  jab_add_ext_handler('som_crypto', som_crypted_handler);
 }
<-

Then som_crypted_handler is added as a handler for messages
with an ext tag of say "<ext type='som_crypto'>8123019AB865</ext>",
and takes a struct filled with god-knows-what information, it then
would call a function exposed from the main program, like
jab_display_msg_box(); etc. I haven't worked out details, but it's 
an idea.

There would be some standard changes to make to code so it would
compile as an .so on *nix and a .dll on Win32, but if we offered a
template then some enterprising souls could then design server modules,
or even client to client stuff, without having to worry about supporting
their code change in each of the code bases. This is the reason the
clients should have *some* sort of 'standard' extensibility.

For example, I create a plugin for my GTK+ client that can tell what
track XMMS(x11amp) is playing, and sends it in an <ext> tag marked
'mp3-playing'. If I add this to my client's codebase, I can send the diffs
to my Unix bretheren, and perhaps to TCharon, to add into the standard
distro. This presents the problems of a) bloat in the client, and b)
no support in the KDE client, or zABBER et al.

If I can however, write this as a module (or in a scripting language)
then I can distro it, and Win32 people etc can all use it aswell, without me
having to write a seperate version for them.

The advantage to modules, is they they allow *anything*, C is
fairly unlimited, and it can do CPU-intensive tasks in it's sleep.

Likewise, if I make a server mod that sends SMS messages to mobile phones,
I can send the message to phonenumber at ie.sms.jabber.org and have it
sent out, but if I want to include extra information, like a return
address, the sensible way to do it is in an <ext> tag, which the module
would fill, and it would add special text boxes (and handlers) to the
send dialogs for *sms* messages.

All a blur. Sorry. Make sense if you can find it.


-- 
 "I don't really love computers, I just say that to get them
  into bed with me" -- Terry Pratchet




More information about the JDev mailing list