https://kotlinlang.org logo
#random
Title
m

mcpiroman

10/22/2021, 11:38 AM
[Protocol Buffers] Would you welcome a way to write .proto files with kotlin DSL scripts, say .proto.kts? My primary use case would be to reduce boilerplate of some common structures, otherwise I have to use some marco engine.
Hypothetical example:
Copy code
val Wheel by message {
   field("index", int32, 1)
   field("size", float, 2)
}

val Car by message {
   list("wheels", Wheel, 1)
}
e

elect

10/22/2021, 11:52 AM
if I may
Copy code
val Wheel by message {
   "index".int32 = 1
}
👌 1
m

mcpiroman

10/22/2021, 1:39 PM
@elect Well, this exact one probably wouldn't do because there is no way to use custom message type, also modifiers like
optional
would have to be supported, but yeah, some magic like that could probably be applied.
2 Views