yrc re-genesis and patch for smooth scrolling and other fixes

Filed under: Software, yrc — Jacob Welsh @ 06:50

I revisit now my IRC client from the other side of seven months since initial public release and a full year since my last round of development on it. Its usage in this interval has been pleasantly free of unexpected problems; indeed the Unix process containing my own "daily driver" has an uptime of that full year, handling everything Freenode's managed to throw at it without a hitch. On the other hand, the software didn't see all that much attention from others, and I became rather complacent about its known quirks and problems.

The interval also saw me coming around to Mircea Popescu's insistence that indentation is done with tabs and not spaces(i) while line breaks are for conveying some kind of meaning beyond "my terminal is too dumb to wrap text on its own". I also switched to the tree structuring convention, prevalent in the software that grew in TMSR, of having a top-level directory named to match the project. As making these changes to an existing tree results in quite a noisy patch, perhaps to the point of effectively severing the connection to the previous state for all the good it does the reader, I've taken this occasion to re-bake the genesis patch yet again. As I'm unaware of anyone else having reviewed the code, I expect this won't pose any real inconvenience.

This out of the way, we get to the more substantive change: refining the scrolling model to count by lines on screen rather than full IRC lines, while still staying anchored to the visible text when the window is resized. I also managed to preserve algorithmic independence from scrollback log length: wrapping is computed on demand for only the necessary lines, ensuring UI responsiveness.

The reason for prioritizing this fix was that a new user pointed out its importance. There's more work upcoming, including tab-completion of names.

A few other fixes and improvements are included, including Python 2.6 compatibility (as yet untested by me); see the included NEWS file for details.

To install, you will need a Keccak V implementation such as my starter, plus the patches and seals:

Or download in bulk, e.g.:

wget -m --no-parent

Once the tree is pressed, see yrc/README.txt for futher instructions.

  1. I'm still not sure what if anything this says about Lisp. [^]


yrc, a Unix IRC client: genesis

Filed under: Software, yrc — 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.)

Powered by MP-WP. Copyright Jacob Welsh.