I seeded what are probably the last two beds of baby lettuce outdoors for the year: after this we’ll start planting in the greenhouses for the fall and winter. These little Ein-Dor microsprinklers are great: if you set them on these 15 inch stakes they’re only about 12 inches off the ground once you push the stakes into the ground a bit. So the spray doesn’t blow much in the wind, and they have nice even coverage. They do get broken sometimes but the actual sprinkler heads are only like 40 cents each (hmm. maybe more now) and they just press fit snug by hand so they’re easy to replace. I hate the new stake design: the sprinkler holder just clips onto the stake and they’re too loose so they pop off constantly. So we still mostly use the ones that were here when we bought the farm 16 years ago…
You can tell I’m very observant because I didn’t notice the rainbow when I was taking this picture.
I did only a little more work on the shunting-yard parser. I re-worded some things slightly to be hopefully more readable.
And I was watching Felienne Hermans’s talk Teach Your Kids To Program With Hedy, and that’s multi-lingual. She talks a bit about how much of a maintenance burden that is, maintaining so many different grammars. That’s for different levels of the language (she goes way farther than Racket: Hedy has 18 or 19 levels currently?) crossed with however many human languages.
And I’ve always thought that an operator precedence grammar could make it pretty easy to just internationalize the names of things and get most of the way there. Not all the way, because syntax might be totally different and not just different words. So… where was I going with that? Oh, right.
Since different languages are written in different directions, I wanted to swap out the associativity names from “left-to-right” and “right-to-left” for something less specific to English. It’s a bit clunky with things like “forward” and “reverse” and I suspect I can come up with better ways to word it, but good enough for now.
And then I spent a while musing about grouping operators. I finally realized that parentheses for grouping don’t exist in the final syntax tree. They just change the order of operations. So that’s actually separate from things like parentheses or brackets for lists of function arguments or data collection elements. Getting that distinction clear was nice. The original shunting-yard algorithm didn’t have lists and things. I think they fit pretty nicely, but… yeah. It’s good to be clear that I’m… not breaking new ground, certainly. But designing an extension to this particular operator precedence parsing algorithm.
So. I think I’m starting to figure out what I want and how to structure the code and data. I had a moment where I was trying to think through the data structures and had to stop and go back to think more about the code: “what do I want to do with this data?” and it struck me as funny that it was the opposite of Fred Brooks’s line: “Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious.” (The Mythical Man-Month, end of Chapter 9).