ABI
now believe that the better way to think of ABIs as just a different application of type systems:
- Application Binary Interface: A type system with a specified serialization format and calling convention 2.
- Programming Language: A type system with runtime behavior (operational semantics).
The Wasm Component model doesn't just define types like "string" or "record", it also has a (limited 3) notion of generic types too. For example result and option are generic types, so you can define functions which return a result<string, error> to indicate they're fallible. I never considered that ABIs could contain ADTs 4, but WIT clearly has it. Which to me signals that (with some constraints), we can apply the wealth of type system theory we've built up over the years to ABIs as well.
...
in its broadest terms: I believe an ABI must define a data encoding, but doesn't need to define runtime semantics.
And a programming language must define operational semantics, but doesn't have to define an encoding