Weeknotes for 12 June 2026 (week 23) [2026-W23]
- June 12, 2026
- Brent A. Yorgey
Family
- June 12, 2026
- Brent A. Yorgey
We enjoyed time with visiting family this week. On Thursday, I hiked up Pinnacle Mountain with my sister-in law and 6 of our kids (2 of mine and 4 of hers). It's a strenuous hike (about 220 meters elevation gain over a 1.8km trail) with a lot of fun scrambling over rocks that pays off with a lovely view at the top.
Blog post on FTA proof in Agda
- June 12, 2026
- Brent A. Yorgey
I worked a bunch more on this blog post/tutorial I mentioned last week. I'm very close to completing a first pass through the entire proof: cleaning up, reorganizing, and writing prose to explain everything. Next week I'll make a second pass through editing and polishing; then I'll go through and create a version with holes for people to download and play along. The plan is to have it published in the next week or two.
Swarm type + requirements system
- June 12, 2026
- Brent A. Yorgey
One of the most interesting things about Swarm is the core mechanic where you must obtain and craft devices that allow you to unlock programming language features. So we have to be sure robots are able to run their code. We can (and do) use dynamic runtime checks, but it would be very annoying and tedious if this were the only safeguard. When you build a robot to run a program, you don't want to manually install all the required devices (there could be dozens, if you are using many language features); you also don't want robots to get halfway through running their programs only to crash because they are missing some required device. So there is a requirements analysis which figures out what capabilities a program requires, and which devices could provide them; when building a robot, those devices are automatically installed (or, if you do not possess the necessary devices, the build fails). However, this requirements analysis is an ad-hoc step bolted on after typechecking. At the time I wrote it, I didn't really understand what I was doing.
Over the years, however, this ad-hoc bolted-on requirements analysis has led to all sorts of bugs. I've come to realize that the requirements for a program should really be part of its type, with requirements analysis integrated into the type system, similar to other existing work on type-and-effect style systems. The twist is the distinction between required capabilities and required inventory; the \mathsf {build} command turns the former into the latter, since in order to execute \mathsf {build} you must have the correct devices in your inventory in order to equip them on the newly constructed robot.
I've spent some time this week working on a formal writeup of a system that I think will fit the bill. The interesting part is that we really need requirements polymorphism, which means that instead of just keeping track of sets of requirements, we need to keep track of expressions involving requirement variables, and then solve equations over these expressions after generating them during type inference. I am hopeful that this will work out nicely, but there are always unforeseen wrinkles.
Piano corner
- June 12, 2026
- Brent A. Yorgey
I have Chopin's waltzes polished up through number 7. Number 4 in F major is one I've never played before, but it's a lot of fun; most of my time this week has been spent learning it. Number 8 is another one I've never played, so next week I will be learning that one.