Harlie Status Update

Filed under: Harlie, Technology, computers, perl by tamber
7 January 2010 @ 07:11

And now, it’s time for an irregular status update on what’s happening with Harlie, that damned bot.

I’ve fixed all but one of the bugs in the bug-tracker, and have been updating the wiki (Once I scraped all the spam out of it.). However, in the process of trying to use heap memory in the commands (To save copying data around everywhere when there’s no real need to do so.), I discovered that the way I’d originally written the commands parser (and the commands functions) made this a little… difficult.

To be a little more precise, trying to add a reference to the POE kernel and heap to the arguments passed to the parser caused everything to disintegrate. For now, I shall leave it be, but I do want to rewrite this; probably causing lots of breakage in the process.

A lot of code in the parser (and in commands and so forth) relies on a reference to $main::irc to pass info to the kernel, and this just Will Not Do™. Other things that I see potentially causing problems is that a lot of the code is very ‘single-threaded’; or relies on manipulation of structures that should be internal to do common things such as adding a command with a plugin.

For example, to add a command with a plugin (ignoring that it doesn’t work anyhow. Hence why I wanted to rewrite the commands parser and so forth.), a plugin writer would have to add to the commands array themselves and track where their command was added so that they could later remove it on unloading the module.

This has a lot of potential for breakage, and I’d rather move to having a plugin api that allows a plugins author to do something similar to: add_command("command",\&handler::function,access_level); to add a command, and remove_command("command"); to remove it.

(By the way, I had a discussion about this with someone and I can’t remember who, but the gist of it went like this: Regarding security in plugins, there is none. That is to say, if a module wants to remove commands like “quit” and so forth, there will be nothing stopping them. It is the user’s job to make sure that the modules that they are using don’t do nefarious things. Plugins can do anything code in the main app can do, there is no sandboxing, etc, etc.)

And so, the list of things to do grows longer.