My talk from Swift Heroes 2024 has just been published. If you're interested in Noncopyable types, type-level programming, and State Machines, go check it out.

I had a lot of fun researching the feasibility of Typestate programming in #swiftlang, and I'm happy with how this talk turned out.

https://youtu.be/qPHjDlqHsUQ?t=65

Typestate - the new Design Pattern in Swift 5.9 | Swift Heroes 2024 Talk

YouTube
@alexozun
The talk was amazing! Everything aligns perfectly with my ideology until the point where "nothing happens." It seems to miss the essence of "making the impossible state unpresentable." I understand it's safe, but the fact that we can still call the method makes me wonder if there might be a better approach.
@thai_d_v Ya, a proper solution would require Swift type system to have first-class support for f typestate to allow reusing the same variable for values of the same type with different typestates, similar to how Rust does it.
@thai_d_v Obviously, this would require some new syntax for differentiating generic type parameters from type state parameters. Something akin to this: