Comment

Comment by stefncb

Yeah I think our arguments overlap in some ways.

> That's all. Because our current languages are this way doesn't mean that the two concepts cannot be reconciliated or that one is just better than the other.

I don't think I agree with this though, I believe they're fundamentally different. The whole point of structural constraints is that they don't need the type to be aware of them. The point of nominal constraints though is that they require the type to explicitly acknowledge them.

In an ideal situation, everyone names and types things the same ('logical') way, so structural constraints 'just work'. A type implements has_organ, and an interface requires has_organ, and the type is automatically compatible with the interface.

A nominal system is the opposite though; the type explicitly understands what a specific interface implies and formally states it.

I just can't see how there's a subset-superset relationship, or how they can somehow be reconciled.

parent stefncb 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton