B
BGB
I wrote a vary basic ASN.1 decoder. It didn't seem that hard...
yeah, not very hard, and not very notable either...
ASN.1 BER is a moderately compact TLV format.
but, then again, so is Matroska MKV.
it can be beaten out by more specialized formats regarding compactness.
many other designs also need not use a schema, which can be an arbitrary
limitation for a file-format.
neither allows stream resynchronization AFAIK (basically, like what is
commonly done in things like MPEG streams).
a more compact format allowing for resynchronization and not requiring a
schema can be created by borrowing much of its design from
data-compression formats.
but, sadly, some people seem to think of data-compression techniques as
bordering on magic...
a sad thing here is that many protocol designers recently have taken to
a strategy of being like:
we will take a very inefficient representation (like textual XML), and
feed it through Deflate, and it will be "compact".
it works, sort of, but is far from optimal in many areas (if a person
knows what is going on internally), and why, for example, Deflate isn't
actually very good for streaming data (its design is much better suited
for what it was originally designed for: file compression).
but, people are lazy, and XML+Deflate is often an "easy" solution.
(and, presumably for them, EXI was created...).
but, I guess in the minds of many people, designing a protocol (or
file-format) based directly on an entropy-coded bit-stream likely seems
like pure evil.
then again, even in the design of my own protocol, there were a few
things I would probably do differently now (mostly small things, like
related to how the escape markers work, ...).
but, I did what was in my case (more or less) the path of least effort.
like, why did I choose a list-based high-level representation rather
than XML?...
mostly because lists are (in my case) considerably higher-performance,
and also easier to work with (composing and processing XML data is
considerably more of a pain than doing ad-hoc "Lisp in C" stuff).
I originally considered using XML, but the awkwardness and relative
inefficiency of using a DOM-like API for composing/processing messages
was discouraging, so I opted for using lists instead (even if, sadly,
they are some sort of "arcane" technology).
granted though, this system is not based on any sort of "data binding",
as in-general, I am not really that big into data-binding (data-binding
has its own sets of drawbacks).
so, basically, explicit code walks the scene-graph and generates the
messages, and explicit code on the other end processes the messages...
(the lists still exist in both single and multiplayer games, but the
actual compression and sockets are usually only used for multiplayer games).
or such...