kotlinx-serialization-protobuf is a multiplatform library which means you can build something using it that supports jvm, android, ios, macos, js, etc
If you consider macos/ios as platform, the programming language for this platform is swift/objective-c, but since we’re using KMP, we managed to write code that works for this platform using kotlin
Protobuf is a language agnostic schema language. You define your contract in proto file, and wrappers to encode/decode messages for this contract are auto generated for each language. IE, you can encode a message using kotlin code and someone on the other hand, say using swift can decode same message from raw bytes
Now, consider we built a kotlin library using kotlinx-serialization-protobuf for some proto definitions, you can generate a jar / aar / Podfile(swift) to use our library on multiple platforms.
On the similar note, we could have generated a swift library using
swift-protobuf as well.
My question is, why would we use kmp library targeting swift over an actual swift library when it comes to protobuf serialization?