
I don't know what your level of interest in IRC is, but it's a good
recent example.  On most systems if you wanted an IRC client
you'd just port some other IRC client and end up with an IRC
client.  But Plan 9 isn't really a good base for running external
programs.  There's no X11, there's only rudimentary cursor
addressing, so you'd have to port a command-line program.
(If you want to run a Unix program, that's what Unix is for.)
The Plan 9 way to attack the problem would be to step
back and wonder whether there was a simpler and/or more
general interface that might be good.  


I occasionally use IRC and AIM and ICQ, and would like to be
able to do so in Plan 9 rather than switching to Windows XP.
I wrote an ICQ implementation six years ago, but it ran in a
window by itself and I'd always forget about it, and it still
didn't really fit well with the rest of the system.  A few
months ago I started thinking about this again, and have slowly
(a few hours here and there, very occasionally) been building
a generic chat file system interface:


/*
 * Chat file system.  Conventionally mounted on /net to provide /net/chat,
 * for some value of chat.
 *
 *  clone           open and read to obtain new connection
 *  n               connection directory
 *      ctl             control messages (like connect user)
 *      data            retrieved data
 *      err             last error
 *      local           local name
 *      remote          remote name or channel
 *      status          connection state
 *      who             list of people in chat room
 *      ...             other protocol-specific files
 *
 * The connect message typically takes the following possible addresses:
 *
 *  #channel    a channel
 *  chat room   a chat room
 *  user        a user
 *  *snoop*     all traffic
 *  *mop*       traffic with nowhere else to go
 *
 * It would be more true to form if there weren't a *mop* but instead
 * you announced chat!you and then listened for connections.
 * The *mop* is good enough.
 *
 * The data file returns messages one at a time.  The messages are attr=value
 * lists that can be parsed with the attribute parsing routines in auth.h [sic].
 * Typical attributes include:
 *
 *  src     who is sending the message
 *  dst     destination for message (you, a chat room)
 *  cmd     command being sent
 *  args    other arguments
 */


I have an IRC implementation of this pretty much done,
and I plan to do an AIM TOC implementation too.  Once you've
got this as a building block, it's easy to build whatever
interfaces you want on top of it.  I have a fairly nice Acme gui
pretty much done.  (Because of Acme and win, it's hardly
any code.)  You could build a really simple gui using rio
windows (using the same code, actually) with one window
per conversation.  In a pinch, con -l 'irc!#plan9' would work
reasonably, and it's great for debugging.  Another nice
thing is that suppose you want to write some sort of 'bot.
It could be something complicated, or something as trivial
as logging a particular chat session (or all your chat sessions).
Since all the programs can use the fs interface, none of them
have to worry much about the details of connection setup
or anything like that.  And one connection can be shared
between many programs without any extra effort.
While there will probably be slight differences in syntax
and the frills commands that can be executed on each
network, the core interface is the same meaning that I'll
have multiprotocol guis for free.


