Taking the pain out of serialization.
Project powered by:
The following text is from the s11n library manual. It gives some
background history on the s11n project, and describes some of the
reasons why this project is so interesting to me...
Gary has been trying to save a container of value-type structs, each
containing a couple POD types. As anyone who has attempted such a
thing at the stream level can tell you, even for relatively trivial
containers and data types (e.g., even non-trivial strings):
Saving data is relatively easy. Loading data,
especially via a generic interface, is mind-numbingly,
The technical challenges involved in loading even relatively trivial
data, especially trying to do so in a unified, generic manner,
are downright frigging scary. Some people get their doctorates
trying to solve this type of problem. Complete branches of computer science, and hoardes of computer
scientists, students, and acolytes alike, have researched these types
of problems for practically eons. Indeed, their efforts have
provided us a number of critical components to aid us on our
way in finding the Holy Grail of serialization in C++...
In the 1980's IOStreams, the predecessor of the current STL iostreams architecture,
brought us, the C/C++ development community, tremendous steps
forward, compared to the days of reading data using classical
brute-force techniques, such as those provided by standard C
libraries. That model has evolved further and further, and is now an
instrumental part of almost any C++ code. However, the practice of directly
manipulating data via streams is showing its age. Such an approach is,
more often than not, not suitable for use with the common higher-level
abstractions developers have come to work with over the past decade
(for example, what does it really mean, semantically
speaking, to send a UI widget to an output stream?).
In the mid-1990's HTML become a world-wide-wonder, and XML, a more
general variant from same family of meta-languages HTML evolved from,
SGML, leapt into the limelite. Pratically overnight, XML evolved into
the generic platform for data exchange and, perhaps even more
significantly, data conversion. XML is here to stay, and i'm
a tremendous fan of XML, but XML's era has left an even more
important legacy than the elegance of XML itself:
More abstractly, and more fundamentally, the popularity and "well-understoodedness"
of XML has greatly hightened our collective understanding of
abstract data structures, e.g. DOMs [Document Object Models],
and our understanding of the general needs of data serialization frameworks.
These points should be neither overlooked nor underestimated!
What time is it now? 2004 already? It looks like we're ready for another
10-year cycle to begin...
We're in the 21st century now. In languages like Java(tm) and C#
serialization operations are basically built-in (though i do have
very deep fundamental differences with Java's whole serialization
model - i wouldn't wish it on my worst enemy!). Generic classloading,
as well, is EASY in those languages. Far, far away from Javaland,
the problem domain of loading and saving data has terrified C++ developers
for a full generation!
s11n aims, rather ambitiously, to put an end to that. The whole general
problem of serialization is a very interesting problem to me, on a
personal level. It fascinates me, and s11n's design is a direct result
of the energy i have put into trying to rid the C++ world of this problem
Well, okay, i didn't honestly do it to save the world['s data]:
i want to save my objects!
That's my dream...
Oh, my - what a coincidence, indeed...
That's s11n's dream, too...
s11n is actively exploring viable,
in-language C++ routes to find, then take, the
C++ community's next major evolutionary step in general-purpose
object serialization... all right at home in ISO-standard C++. This
project takes the learnings of XML, DOMs, streams, functors, class
templates (and specializations), Meyers, Alexandrescu, Strousup,
Sutter, Dewhurst, PHP, "Gamma, et al", comp.lang.c++, application
frameworks, Java, and... even lowly ol' me (yeah, i'm the poor bastard
who's been pursuing this problem for 3+ years ;), and attempts to
create a unified, generic framework for saving... well, damned near
anything. Actually, saving data is the easy part, so we've gone ahead and
thrown in loading support as an added bonus ;).
In short, s11n is attempting to apply the learning of an entire generation
of software developers and architects, building upon of the streets
they carved for us... through the silicon... armed only with their
bare text editors and the source code for their C compilers. These
guys have my utmost respect. Yeah, okay... even the ones who
chose to use (or implement!) vi. ;)
Though s11n is quite young, it has a years-long "conceptual history",
and it's capabilities far exceed any original plans i had for
it. Truth be told, i use it in all of my C++ code. i can finally...
finally, FINALLY SAVE MY OBJECTS!!!!
i hope you will now join me in screaming, in the loudest possible
It's about damned time!!!