Fixpoint

2019-11-14

yrc, a Unix IRC client: genesis

Filed under: Software — Jacob Welsh @ 18:44

The problem I chose to tackle in February 2017 was the need for secure real-time communications in my planned business. "Secure" here didn't mean in the cryptographic sense, but rather having a guarantee, or at least as close to one as could be practically had, that there exists no "magic packet" that could be sent from the outside network to compromise the terminal, at least through this particular hole.

Many of the traditional IRC clients were written in C, a notoriously poor language for providing any sort of guarantee, and inevitably seemed to be loaded with "features" I didn't need, and thus potential for nasty surprises, and reams of code to read if I wished to audit. On the ultra-minimalist end of the spectrum there was ii, but it was way to little, for instance in providing awareness of connection state or tracking multiple channels. (It was telling that they suggested a far more complex program, "multitail", for this.)

At the same time, I was interested in sharpening my skills in network and UI programming; I'd done the latter in various environments including Visual Basic, Qt, PyQt, and urwid, but hadn't found the elusive sweet spot. I decided to take a shot at writing my own client using a high-level language and low-level terminal facilities. "How hard can it be, it's just an event loop, displaying text, parsing a simple protocol, an input state machine and so forth." Hah.

I did make the practical compromise of using Python, due to its fairly robust system interface, rather than, say, the Scheme interpreter I'd been hacking together around the same time. Initially I used the bindings for the classic "ncurses" library. One nice thing it does is track screen state so you can render however inefficiently and screen updates will be sent differentially: originally good for slow serial connections and still good for slow network connections. The other supposed benefit was portability across terminal types. I soon found it to be nothing but trouble, an additional layer of crufty complexity and the supposed portability not being watertight. So I switched my reference to the original DEC VT100 user guide, from which modern Unix terminals are more or less derived, and found the experience altogether more pleasant.

Some 2400 lines of code and a couple revisions later, I have something that I find more or less usable.

Major things that it does NOT intend to support include Unicode and SSL. Notable missing features it ought to have, quoting the manual, include:

  • Prompt history, kill/yank commands
  • Indication of nick mentions (ring bell + bold the window name?)
  • Tab completion (nicks, slash commands)
  • Formatting for displayed messages (e.g. bold sender, highlight own nick)
  • Finish mode/op and close-net commands
  • Filtering of inbound PMs (/ignore or similar)
  • Scrolling based on rendered lines rather than messages
  • Scrolling + more efficient navigation of window list

A fairly detailed manual is included, so see within to learn more.

Download Vpatches

(Hash algorithm is Keccak with 256-bit capacity and 512-bit output. This is aping the previous vpatches I've seen; I do not know the rationale for these parameters.)

5 Comments »

  1. Presses fine as it is. Do you use own V and Keccak implementation?

    And had a chuckle at "microsoftesque"!

    Comment by Diana Coman — 2019-11-14 @ 20:00

  2. [...] valued at $2,500. Software7: Bitcoin, GnuPG, Gales Linux, Gales Scheme, Gales Bitcoin Wallet, yrc IRC [...]

    Pingback by JWRD Computing: The why, how, what and way forward. « Dorion Mode — 2019-11-16 @ 03:53

  3. I did a Keccak implementation in C (your articles and collected references on the subject were helpful). It can plug into the perl/python/awk V implementations by pipe. I'm aware that phf's vtools are more robust though.

    Comment by Jacob Welsh — 2019-11-17 @ 19:48

  4. Updated for genesis naming.

    Comment by Jacob Welsh — 2019-12-13 @ 06:15

  5. [...] Install an IRC client and register a nick with #freenode 5 ; Jacob Welsh (WoT: jfw) genesis'd his IRC client, yrc. [...]

    Pingback by Contribution Guidelines for TMSR OS « Dorion Mode — 2019-12-14 @ 06:32

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by MP-WP. Copyright Jacob Welsh.