https://kotlinlang.org logo
#feed
Title
# feed
e

enleur

11/02/2021, 2:34 PM
m

mcpiroman

11/02/2021, 2:50 PM
While it's nice Google provides an official implementation for Kotlin, I recommend https://github.com/open-toast/protokt. It's nicer to use as it is kotlin-only (instead of kotlin-java mix), including nice handling of `optional`fields, and has a potential of being multiplatform.
K 2
💯 1
🙏 1
s

suresh

11/02/2021, 5:31 PM
@mcpiroman since 1.2 onwards kotlinx-serialization has support for generating the schema (
.proto
) and it’s already multiplatform ready, are there any advantage in using protokt?
m

mcpiroman

11/02/2021, 5:51 PM
Mainly proto3. I don't quite know how kotlinx-serialization works (have not used it) but, at least for now, I would also expect faster compilation or slightly better usage of the wire (being on lower level). There were also problems with combining kotlinx-serialization and Compose in the same module but I don't think this is much of a breaker.
🙏 1
e

ephemient

11/02/2021, 11:39 PM
the official protobuf generator produces a Kotlin DSL which kotlinx.serialization doesn't (although you could write your own). protokt does, though I haven't compared them
note that only kotlinx.serialization works on non-JVM platforms; protobuf and protokt both use Java code and/or JVM libraries
also there seem to be some issues in the current Kotlin compiler, unfortunately https://youtrack.jetbrains.com/issue/KT-47270
👍 1
j

jimn

11/03/2021, 1:44 PM
java protocol buffers: when you absolutely positively require heap buffers for your network IO.
6 Views