by tinix · 2y ago · 0 comments
interfaces describe behavior, types describe shape and structure. the difference is subtle but important.
Shape and structure are behavior. There's more to behavior than "abstractly produces X result". Behavior is "produces X result in Y form given Z in W form".
They shouldn't be. Conflating two things that can be separated is just compounding complexity. You don't need to know how a database lays out memory or the structure behind a web server.
You do, however, need to know what logical columns are in a table and the types of those columns to be able to effectively query against the table. And you need to know what the types of the inputs to a query wrapper function are to be able to call it properly.
Memory layout has nothing to do with type, because physical memory layout is completely separate from the semantic logical layout and form represented by the bits. You now appear to be the one conflating two unrelated things.
That something is treated as an integer fundamentally matters to its use. That the thing comprises some number of adjacent bits in big/little-endian arrangement is a very unrelated implementation detail.
That's the interface.
Memory layout has nothing to do with type,
So float, int, unint64, int8 and a vector/array don't have specific memory layouts?
the semantic logical layout and form represented by the bits
This is nonsense and doesn't mean anything.