Am I the only one still wondering what is the deal with linear types? [01KB]

One thing that is still pretty hazy to me is the claimed relationship between “linear types” (qua Cyclone/Rust/OxCaml/Swift/Hylo/etc.) and actual linear logic. I have gotten the feeling that people have spent years claiming that they have created a linear type system, etc., or talking about how their system is affine rather than linear when it is not clear to me what the precise relationship is to either affine or linear logic, etc. There are intuitions at play, but sometimes these intuitions are too far away from the mathematics to justifiably inform a point of view on either syntax or semantics or both. For example, there’s a lot of hand-waving that starts with intuitions about “the number of aliases in the past / future at runtime” and ends with “and this is why we have this modality”, but the former is so vague that I struggle to accept it as the basis for a mathematical definition or claim.

I watched Guillaume Munch-Maccagnoni’s ML ’24 talk Is there a use for linear types because the abstract promised to shed some light on this and related questions, but I have to say that the talk, shall we say, left me a bit cold: the abstract promised to shed some light, and all I can say after watching it twice is that the talk…also promised to shed some light. By the time Guillaume got to the criticisms of prior work on linear types, it seems he did not have enough time to make them precise enough to be evaluated on a mathematical basis; perhaps this was not the venue to do so, but I would have loved if he could have got a bit more technical here, as there is an opportunity to make some points understood that are actually not understood by almost anybody (including myself).

For example, he alludes to a “non-standard (and computationally uninteresting) interpretation of [the bang modality]” in what I assume is the paper Linearity and Uniqueness: An Entente Cordiale, but he doesn‘t ever say what it was! I assume he had planned to address this in the Q&A but unfortunately nobody asked the pertinent question. My guess is that the dereliction rule in that paper looks a little dodgy because it seems to require a cartesian context (contrast with Alms), but I really have no idea if that was the actual problem. It would have been nice if he could have said what the precise problem was. Similarly with the “overly-constrained definition of linearity not suitable for resource management”, which is something I definitely want to understand.

As Guillaume points out in his talk, the “opposition” or “duality” (which I agree not to be substantiated on a mathematical basis) between uniqueness and linearity really does make the system a lot more complicated, and it is part of the “rat king” of modalities that OCaml is presently turning into. If there is a practically and theoretically sound viewpoint that allows us to rethink this distinction, it is very urgent that we understand it now rather than later. That is why I sincerely hope that Guillaume will be willing to expand on his very interesting arguments in a position paper aimed at a mathematically literate audience. Guillaume is one of the very few people in the world who understands both sides of this divide very well, and I think the community would benefit greatly from him having the opportunity to intervene at a more technical level.

In the meanwhile, I have been reading with great interest the short paper Towards a linear functional translation for borrowing, written by Guillaume’s student Sidney Congard. Technical contributions in this area are very welcome, and I’m eager for more.