README.pod

This repository is the home of the Sereal data serialization format.
This format was started because the authors had technical reasons for producing a better Storable.

Before we embarked on this project we had a look at various prior art.
This included a review of Google Protocol Buffers and of the MessagePack protocol.
Neither suited our needs so we designed this,
liberally borrowing ideas from the other projects.

Given that perl uses a reference counting garbage collection scheme,
Perl has the concept of a special type of reference called a "weakref" which is used to create cyclic reference structures which do not leak memory.
Unlike most of the existing solutions,
we need to handle these structures correctly,
thus avoiding a perfectly valid data structure to be converted to one that will cause a memory leak on a remote system.
For cross-language compatibility,
weak references can very easily be ignored by other decoder implementations.

Promoting a plain data structure reference to an object,
as is customary in dynamic languages,
can be dangerous in some circumstances.
We needed to be able to serialize objects safely and reliably,
and we wanted a sane control mechanism for doing so.

We want to be able to represent common structures as small as is reasonable.
Although not to the extreme that this makes the protocol error prone and ludicrously difficult to implement.
The steps taken include removing redundancy from the serialized structure (such as hash keys or classnames) automatically.
The protocol supports this kind of redundancy removal,
but an encoder implementation can choose to which extent it makes use of the technique.

We want the format to be usable by other languages,
especially dynamic languages.
We hope to have a Java port soon,
right Eric?
In aim of making this easier we have structured our repo so that implementations from other languages can be easily added,
and we would welcome any contributions along these lines.