More Details. · Apr 16, 01:56 AM

So after a couple of hours hammering out the real details, I can give a more accurate picture of what’s going on.

Styling
I had forgotten that Python’s curses library has no wide-char support, so I can’t eliminate C all together, but I have pared down the C quite a bit, moving more of the higher level formatting code to Python.

The change now is that all of the styling (changes in actual layout) will be done by writing a Renderer class. Now that sounds a little more complicated than it is. You can subclass your own style from the default style and by overriding some simple (two or three line) functions, you can change the content of any part of the GUI.

In these functions, you have access to the entirety of the story object and its feed object, allowing you a lot more flexibility than using the escapes previously set up. In addition, it makes the rendering run a whole lot faster.

Speed
Converting to the new class based renderer, the interface is a tad bit slower, with half as much C code, but without any memory wasted with the old memoization method. I’m sure that I can have it performing better with some tweaking. Worst comes to worst, I’ll do generational memoization and then it will outperform the previous code.

I haven’t reimplemented the reader or input boxes yet, so the code isn’t ready for commit.

Config
In addition, I’m going to scrap both configuration formats and just use the python interpreter to handle configuration. This will allow the user to use all of python to generate and manipulate his config and, if he doesn’t want to do that, the format is still really simple.

So in short, gains for you:

And the gains for me:

All in all, I hope it’s worth the wait.

— Jack Miller

---

Commenting is closed for this article.