inkytonik / cooma

The Cooma project is investigating secure programming language design based on fine-grained object capabilities.
Mozilla Public License 2.0
3 stars 2 forks source link

Make generic equality more efficient #14

Open inkytonik opened 3 years ago

inkytonik commented 3 years ago

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?

nhweston commented 2 years ago

There are some problems here:

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?

inkytonik commented 2 years ago

Yeah, you are probably right that it's not worth it. Thanks for taking a look.

inkytonik commented 2 years ago

BTW, we can come back to a runtime-based approach later, but the issue is not a pressing one.