“Mutable> either makes the wrong thing mutable, or makes too much stuff mutable.”
You may be reading `Mutable` overly literally. I just used generic notation for familiarity; that doesn’t mean it’d map directly to a struct. Have it be a `mut[able]` keyword if you prefer. The point is, it can be applied to any type, and eliminates the need for let and var definitions.
“Pointer> would make the whole language more complicated”
Why? We’ve gone from ten single-purpose types to three general-purpose ones: Mutable, Pointer, and Buffer. (And, in practice, Buffer would merge with Data, so really it’s two.)
“The Swift devs in fact are not amateurs, and it shows in how they managed to keep things simple”
Oh really. There is nothing simple about Swift, a language designed by C++ programmers to be a “better C++”. Just the fact it implements every collection type (String, Array, Dictionary, Set) twice—once as a class and then again as a struct—puts the lie to that.
And then, of course, adopted by Apple and bodged into a “better ObjC++”. Which has even more hair on. See also:
https://www.quora.com/Which-features-overcomplicate-Swift-Wh...
“You don't just hand-wave mutability being a composable trait.”
And yet, C’s `const` is composable. (Albeit not as a trait of the type itself, but I can’t think of a reason it couldn’t be.) Plus, with [im]mutability disentangled from collection implementation and a general purpose “pointer” for referring specifically to variables, the class+struct duplication can be eliminated. Let the user describe the behavioral constraints for their code, and leave the machine to decide when to allocate on heap vs stack and when to reference-count, single-owner/borrow, or pass-by-value.
I may not know much about compiler engineering, but I do have a bit of experience in (Lisp-y) language design. Whereas the Swift team are compiler engineering wizards (no contest), but compiler engineers do not necessarily make good language designers (since they’re liable to design it to suit the language’s compiler engineers rather than its end users).