4 ms·
> That works because an unsigned 8-bit integer is one piece of data. No, the same holds true for any struct as well. If you declare x to be {a: uint8, b: uint8
by mikojan 5y ago
> That works because an unsigned 8-bit integer is one piece of data.
No, the same holds true for any struct as well. If you declare x to be {a: uint8, b: uint8} you cannot magically turn it into {x: string, y: string, z: string}.
The real problem is that in most languages the expressiveness of this system is severely limited. You cannot do it in Javascript at all, but Typescript gets you very far.