One thing I don't fully understand in Swift is why protocols are the way they are. I know they are both similar to and different from Java interfaces. The similar part I understand, and I find Java interfaces relatively easy to understand. It's the differences that have me scratching my head. For example, a protocol can't always be used like a type because it "doesn't conform to itself".
I've seen questions and answers about this topic before, but the answers didn't have example code and used terms that I don't understand well (like "existential types" or "value abstracted types"). So, can someone show or link to example code that demonstrates the value of this difference? In other words: some things you can do with Swift protocols that you can't do with Java interfaces.