|
|
|
|
|
by aatd86
905 days ago
|
|
Curious, aren't lifetimes and borrowing there in order to control aliasing that linear type preclude? I was seeing linear types as a kind of: manual ssa + definite assignment analysis + unused variable analysis with the goal to facilitate some typestate analysis by the compiler. I know barely anything on the subject, just wondering. |
|
At their core, the definition of linear and affine type systems don't reference SSA or dataflow analysis either. Type systems are generally described using the notation of logic (see this intro if you're unfamiliar: https://langdev.stackexchange.com/a/2693/910), and then to get linearity you define the inference rules such that a use of a resource removes it from the context (one way to write this: https://plato.stanford.edu/entries/logic-linear/#SeqCal).
Things like definite assignment are more user-facing convenience features that are also built on top of the core linear logic.