`deriving hash` for C++
Would be handy to be able to provide std::hash specializations for records, to allow them to be used as unordered_map keys etc.
That would require to provide something like hash_combine or std::hashstd::tuple<...> for each embedded element. Its doable, but those methods are not yet part of any C++ standard. So it would need to be bundled into support-lib. Plus depending on your project requirements, the hashing part might not always need to hash all elements. The record should be identified just be lets say 2 out of 5 elements. In that case you would need to instruct djinni to do it like this, which seems to be kind of really tricky thing (not sure if Java/Objc/Python languages allows similar staff)
We already do manual hash-combining for Java/ObjC code so that shouldn't be a blocker. Those languages also currently assume the hash should be based on all elements of a record, so C++ could do the same. I agree that it would be more flexible to let that be configurable, but that can be seen as a separate feature.
I think all that would be needed for this is some helpers for hashing various basic Djinni types, as well as requiring that any nested records themselves also have a derived hash function. External types would need to specify a hash function too. For interfaces you could fall back to identity/pointer hashing, which is the default we get in other languages too. As an extension you could allow interfaces to declare a custom method to call for the hash code.