marekjm / viuavm

Parallel virtual machine designed to reliably run massively concurrent programs
https://viuavm.org/
GNU General Public License v3.0
71 stars 11 forks source link

Refactor operand encoding and decoding #152

Closed marekjm closed 7 years ago

marekjm commented 8 years ago

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).

marekjm commented 8 years ago

More information about CBOR: http://cbor.io/ and https://tools.ietf.org/html/rfc7049

marekjm commented 7 years ago

Partially implemented. Operand type is encoded in bytecode, and it is used during decoding stage.