Weeknotes 2026-W07 [2026-W07]
- February 12, 2026
- Jon Sterling
Thinking about mutable value semantics [01KA]
- February 12, 2026
- Jon Sterling
I recently heard about a very experimental interesting language called Hylo, which is closely related to Swift but makes a number of different choices that could lead to a cleaner story for memory safety and structured concurrency. The main idea is a bit industry-language jargon called mutable value semantics; it took me a while to understand what is meant by this term, but the essence seems to be that you have references without reference types. So, you can pass things by (mutable or immutable) reference but you cannot return a reference. In addition to mutable and immutable borrows, there are “sink” bindings that consume the resource entirely.
There’s some obvious problems with a naïve version of this idea: for example, how would you return a reference to a position in an array or hash table or a struct? Hylo deals with this problem by evolving a solution already invented in Swift: the subscript. Subscripts are essentially in-place lenses. I won’t detail it here, but I encourage you to check out the Language Tour.
The Hylo mutable value semantics model is very restrictive, but it is also very simple. So simple that it can almost certainly be given denotational semantics using 1990s technology, expressive program logics using 1990s technology, etc., without any need for step-indexing. That’s what first attracted me to it, but I’m seeing that from the programmer’s point of view there are also a lot of potential advantages. For example, in this model there is no need for explicit lifetimes; I am not certain, but I have a feeling that the tangled web of modes that is emerging in the exciting OxCaml language will also be unnecessary. Structured concurrency in Hylo is also far simpler than the corresponding version in Rust, Swift, and O(x)Caml; and in contrast to Swift, there is no function colouring. Similar to OxCaml, care is taken to make explicit when values may leave the stack, opening up many possibilities for high performance programming like Anil’s very fast zero-allocation webserver in OxCaml.
I think there is room for languages that have full references, and all the complexity with lifetimes and semantics this entails. But I’m really excited to also explore potential sweet spots that require only lighter-weight technology, both in the syntax and the semantics.
Am I the only one still wondering what is the deal with linear types? [01KB]
- February 12, 2026
- Jon Sterling
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.