Robin’s visit to London
My undergraduate supervisor (from the University of Calgary), Robin Cockett, was in town today on a short visit. My two current supervisors, Robin and I spent the entire day in a friendly research meeting. I suppose the biggest benefit was the everyone got to meet each other, but we also covered a lot of ground on Pola and what we should be focusing on.
The first big change is that we’re going to, again, redo peeks and cases. Peeks and cases have long been a problem with Pola and one which is, so far as I know, completely unique to Pola. In a typical functional language, case constructs are no matter at all: you have some datum and you case on it to see what it is (is it an empty list or a non-empty list?) and go on your way. In Pola things are not so neat and tidy: central to the workings of Pola is the idea that often you’re not allowed to reference a variable more than once (lest you break out of polynomial time). This restriction can be waived, very delicately, if you promise to only “peek” at a value but not use it. The distinction between a case (“consuming” a value) and a peek has always been a bit awkward, but also very dangerous to play with if you don’t want to accidentally allow non-polynomial things slipping in. I think we’ve finally figured out a good scheme.
The second big change is discussing how to the bounds inference. This is a huge one because having the compiler infer bounds is, in my mind, the raison d’être for Pola. I’m almost done implementing very loose, clumsy bounds. They’re correct as upper bounds, but they’re so loose as to be nigh useless. There will never be a perfect solution to getting totally tight bounds and I’m becoming increasingly aware that there is a huge trade-off between being able to get tight bounds on things and having to carry around a lot of typing information that allows you to infer those bounds. This is what I’ll be spending most of my time on in the near future.
As for the problem I mentioned last time about having to implement my own polynomial arithmetic: I just rewrote it myself and I’m happy with it. It works and it’s much cleaner than before.