2021-08-27
Example:
Example:
Example:
Programming languages differ in what primiteive types they offer. C -does not offer UTF-8 strings and byte arrays are used instead. C also does not offer arbitrary big integers like Clojure does. Dabric value types should provide all the needed information to interpret a given value as a primitive in any programming language. The most primitive fallback type is a byte array. Thus it is enough to know the size of the value in bytes.
If value types are documented as entities we first need value types that are used to describe them.
The most primitive information about a value is how many bytes it takes. The byte count can be fixed in the type description, or each value may have a length prefix.
Variable length quantity (VLQ) could be used for the byte count both in type descriptions and in value length prefixes.
To denote the semantics of a value we need globally unique identifiers. Dabric has entity id:s for that. An entity id is a sequence of values starting with a stream id. Stream id could be fixed to be a UUID i.e. a 128 bit random byte array. If the values in an entity id following the stream id would be restricted to be VLQ:s and the length of the entity id would be expressed as VLQ, we would only need UUID:s and VLQ:s to express types. Also UUID could be expressed as VLQ.
For the value length in a type definition zero could denote variable length. Thus a type definition would be:
This site is generated with zetgen