Viua needs to encode and decode several operand types. Actual encoding is based on CBOR with some notable exceptions:
major types 4 (arrays) and 5 (maps) are not implemented as operands are simple types
major type 6 is not implemented as Viua has a defined set of operand types
major type 2 (byte string) is not implemented
major type 3 (UTF-8 text string) is implemented supporting only ASCII printable characters subset of UTF-8 (to be fixed later)
Unimplemented types cause the VM to emit a user-servicable exception signalling corrupted program text.
Register indexes are encoded as major type 0 (unsigned integers). Program symbols (type, function and block names, etc.) are encoded as major type 3 (text string).
Viua needs to encode and decode several operand types. Actual encoding is based on CBOR with some notable exceptions:
Unimplemented types cause the VM to emit a user-servicable exception signalling corrupted program text.
Register indexes are encoded as major type 0 (unsigned integers). Program symbols (type, function and block names, etc.) are encoded as major type 3 (text string).