POLO Serialization
POLO (Prefix Ordered Lookup Offsets) is MOI's binary encoding scheme with deterministic serialization, minimal wire size, and serialization safety.
Functions
| Function | Description |
|---|---|
polorize(value) | Serialize any value → Bytes |
depolorize(Type, bytes) | Deserialize bytes → specified type |
Example
coco SerializationExample
endpoint pure Serialize(name String) -> (data Bytes):
data = polorize(name)
endpoint pure Deserialize(data Bytes) -> (name String):
name = depolorize(String, data)
Usage Notes
- POLO produces deterministic output, even for maps
- Optimized for partial decoding and differential messaging
- Used internally by MOI for all data encoding
tip
For most Coco development, you won't need to use POLO directly — it's handled automatically by the runtime.
Reference: go-polo on GitHub