Types
Bebop has builtin support for the following data types:
Name | Description |
---|---|
bool | A Boolean value, true or false. |
byte | An unsigned 8-bit integer. uint8 is an alias. |
uint16 | An unsigned 16-bit integer. |
int16 | A signed 16-bit integer. |
uint32 | An unsigned 32-bit integer. |
int32 | A signed 32-bit integer. |
uint64 | An unsigned 64-bit integer. |
int64 | A signed 64-bit integer. |
float32 | A 32-bit IEEE single-precision floating point number. |
float64 | A 64-bit IEEE double-precision floating point number. |
string | A length-prefixed UTF-8-encoded string. |
guid | A GUID. |
date | A UTC date / timestamp. |
T[] | A length-prefixed array of T values. array[T] is an alias. |
map[T1, T2] | A map, as a length-prefixed array of (T1 , T2 ) association pairs. |
You may also use user-defined types (enum
s and other records) as field types.
A string is stored as a length-prefixed array of bytes. All length-prefixes are 32-bit unsigned integers, which means the maximum number of bytes in a string, or entries in an array or map, is about 4 billion (2^32).
A guid
is stored as 16 bytes, in Guid.ToByteArray order.
A date
is stored as a 64-bit integer amount of “ticks” since 00:00:00 UTC on January 1 of year 1 A.D. in the Gregorian calendar, where a “tick” is 100 nanoseconds.