3 ms·
One thing I haven't seen yet is how a compiler would keep track of types and emit the corresponding assembly
by 7373737373 3y ago
One thing I haven't seen yet is how a compiler would keep track of types and emit the corresponding assembly
- FeepingCreature 3y agoclass Type { int size; } and then add methods for every conceivable type-dependent operation. Alternately, a sumtype or enum+pointer will also do. Then you just attach a type to every expression. At least, that's how you do it in a "forward-typed" language like C. In a language like Haskell it's a bit harder because your type assignment is a full graph, not a DAG like in C.