Skip to main content

POLO Serialization

POLO Encoding and Object Serialization Scheme is a custom binary encoding for all data used in MOI. POLO stands for Prefix Ordered Lookup Offsets. The key features of POLO are deterministic serialization (even of inherently non-deterministic data structures like maps), minimal wire sizes and serialization safety. POLO follows a very strict specification that is optimized for partial decoding and differential messaging.

While POLO is internal to MOI working and not explicitly needed for Coco development, Coco provides functions for serialization (polorize) and deserialization (depolorize) as well as Cocolab provides commands to encode or decode POLO. POLO is also one of the supported formats for manifests (besides human-readable YAML and JSON).

Read more about polo encoding here: GitHub - sarvalabs/go-polo

Polorize (serialize)

The polorize() operator is used to serialize object or primitive to a bytes value. This operator performs polo serialization on the object passed to it.

Depolorize (deserialize)

The depolorize() call performs deserialization on the polo encoded object returning the object type as provided to the operator call.

s = depolorize(String, b)

In this s is set with a depolorized String value obtained from the bytes 'b'.