Cerealed v0.2.0 - a(nother) D serialisation library

Vicente via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Sep 8 12:09:29 PDT 2014


Hello Atila,
I've seen that cerealed has made much progress, it's now at v0.5.0
This post is for a feature request, I would like to use it with a 
struct like this:

import cerealed;

struct nested_associative_array { nested_associative_array[int] 
x; }

struct some_struct {
	string[] x;
	int[][] y;
	nested_associative_array[] z;
};

void main(char[][] args) {
	some_struct original, restored;

	auto enc = Cerealiser();
	enc ~= original;
	auto dec = Decerealiser(enc.bytes);
	restored = dec.value!(some_struct);

	assert(original==restored);
}

The serialization process compiles fine, but the restoring part 
fails to compile.
I've tried to figure out how to do it, but I am still a beginner 
on D.
How difficult do you think it is?
The alternative, orange, works fine, but the struct I'm trying to 
export to disk is a few hundreds of MB in size and orange takes 
hours to complete and may also run out of memory. Your 
implementation, instead, is really fast and efficient!


More information about the Digitalmars-d-announce mailing list