Replies: 1 comment
-
You can put the colon on either side of the space, the parser doesn't care. But As to why the ordinal goes before the type... In my mind the name and ordinal are closely related -- the name is how humans refer to the field, and the ordinal is how the binary representation sees it. It would feel weird to be to put the ordinal way over on the other side of the type. Also, with generics, type names can be long. It would be especially weird if you had a multi-line type name and the ordinal didn't appear until after that. Ultimately though there's no technical reason for the ordering, it's a design choice and a matter of taste. I suppose we could even make the parser accept either order. |
Beta Was this translation helpful? Give feedback.
-
The schema language honestly looks a bit odd if you're used to other IDLs. Some decisions are jarring but rational, like putting the comments after the thing being described. Others are harder to understand. Most languages with types on the right write them like this:
a: String
but in cpnp it's written as
a @0 :String
For instance if you're used to Kotlin, you might expect the struct to be written like this:
given that the name is more important than the type which is in turn more important than the ordinal. Why is the schema language designed this way?
Beta Was this translation helpful? Give feedback.
All reactions