blog podcast

Scalar

I started reading through the documentation for Proto buffer, a language for defining messages that can be sent efficiently over the network between different languages. Think of JSON, but even more efficient.

In the documentation I came across the term “scalar” and the fact that a String was an example of a scalar. Now, I know scalar primarily from mathematics where it’s used to signify quantities that have only one dimension (unlike vectors or matrices).

So I was wondering, is a String one dimensional? Yes. I mean a string can be used together with an encoding to generate a byte array, but one can argue that this encoding is not really part of the string, only the deserialization process. In Protobuf anyway the encoding will be UTF-8 or the format 7-bit ASCII.