July Summary
Bold is a fast text editor. You can find details on the home page.
This is the third month of the rewrite. I thought I'd be writing code to edit text by now, but it turns out there was a lot more I didn't understand well and wanted to get out of the way. Specifically, how to write async code without it being annoying, this involved
- Having the main and background thread talk to each other without race conditions and locks
- Dealing with messages that have 1 to many responses
- A way to change what events do that wasn't error-prone, my first draft didn't have enough types.
- Having different types of events, some of which are mandatory for proceeding. I'd need to receive the load font results before I could draw a window, but not necessarily the load project response (network drives may disconnect).
Without going too much into details, I end up having the async system separate from threading. This allowed me to choose events in a specific order and have them deterministically run in that order. This lets me write easy-to-understand unit test. For the lockless data structures and async communication, I had to audit and test separately. Once I was sure it was correct, I could be confident that any strangeness would be handling events in an unexpected order and not bugs in the thread code.
I read up on how different OSes file API and async functions, I don't really like any of them. I was busy enough with the above that I didn't write a wrapper to deal with it, although I did experiment with a directory iterator. The code made it easy to handle subdirectories, but didn't improve my confidence in what would happen if a network disk went down.
Something that has nothing to do with events or async was rendering. I went through all my drawing code and changed it to generate vertices instead of calling the graphics api directly. If I want to start caching parts of the window this would make it easier to do so.