haikus

The first thing I wrote in SwiftUI (back after a 20 year break from programming):

When writing a haiku, you're constantly recounting syllables. This does the count automatically and gives visual confirmation, per-line and per-stanza.

Counting syllables is an interesting and tricky problem (for apps, not you). I tried many linguistic rules, but they all were too easily fooled. Notably, LLMs are poor at it (as of Feb '26') - probably because they don't know how words sound. My "Welcome to 21st century" programming moment: realizing I could just embed a dictionary file in the app containing every English word, in every variation, with its syllable count. And that file was still smaller than the icon graphic.

My other naïve effort was worrying about performance. I wanted dynamic updates, but surely I couldn't look up every word in the dictionary on every keystroke, right? The app caches each line's tally and only looks up words in the line which has changed. In fact modern CPUs could look up every word a dozen times per keystroke with no perceptible delay.

i use dryer sheets
i can't say they do jack shit
but still, just in case