Open inkytonik opened 3 years ago
There are some problems here:
x: A
and y: A
with A
a type variable, then without full-scale monomorphisation, the compiler must resort to the generic primitive in translating x == y
.Is it still worthwhile implementing generic equality without addressing these?
Perhaps we could instead implement a way of identifying the entity type (i.e. integer, string, record, variant, or vector) at runtime instead of having to try each individually?
Yeah, you are probably right that it's not worth it. Thanks for taking a look.
BTW, we can come back to a runtime-based approach later, but the issue is not a pressing one.
Currently it checks to see if the values are ints, then strs, then records, etc. So there is a linear search there.
Perhaps make the compiler translate the generic operation into type-specific primitives?