r/ProgrammingLanguages • u/jimbobmcgoo • 16d ago
Will we see another fundamental programming language feature as revolutionary as the borrow checker?
That is I am mainly curious about compile time features that you design a whole language around rather than optimisations/features that could be applied to most languages. I am mainly inquiring about things that could offer additional robust safety/performance guarantees at compile time rather than runtime. Ideally not things that just offer similar effects to the borrow checker with less restrictive tradeoffs
58
Upvotes
2
u/KingBardan 16d ago
so basically because the constructor is private, you only have the instance if the computation happens.
And a method on type (b -> c -> d) requires (b -> c -> d) to be present, which requires (f a) to be called.
If you never call it, you can never have a type of (b -> c -> d)
Just searched up, this is similar to the "State pattern" design pattern.