ZCE - A Self-Describing, Stream-Extensible Bytecode Format
Description
We present Zero-Count Encoding (ZCE), a binary instruction encoding format derived from three rules: count leading zero bits to determine instruction type, count following one bits to determine parse-tree depth, and let everything after be self-described by what came before. These three rules, applied consistently, produce a bytecode format in which a fixed decoder learns its own instruction set from the stream at runtime, with no external schema, no version negotiation, and no decoder update. The base grammar of thirteen primitives includes unconditional and conditional branching, integer arithmetic, and floating-point arithmetic. This base is computationally complete: it is sufficient to express any computable function. A first-class stream token called DEFINE_OP allows any stream to define new operation mappings over this complete substrate, inline, before using them. Because the substrate is computationally complete and DEFINE_OP operates over it, a stream can express any computation a program author requires without any decoder update. Grammar and data are architecturally independent: the compute structure and the data values it operates on can be versioned, transmitted, and updated separately. Control flow tokens are permanently immutable and cannot be redefined by any stream. We specify the encoding and decoding algorithms precisely, prove the self-delimiting property of tokens and values, prove the computational completeness of the base grammar, state all formal properties, identify and correct a stream-alignment error in the original implementation, and characterize the precise scope of the forward compatibility guarantee. We do not claim ZCE is superior to existing formats for general use. We claim it is a coherent, formally characterizable design occupying a specific and previously uncharacterized point in the design space of self-describing extensible bytecode.
Files
ZCE_Zero-Count_Encoding.pdf
Files
(465.9 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:73794133e857c1a6f30179ed34fbac80
|
465.9 kB | Preview Download |