Go ahead!

Memoization for Everything

yajl-d

| Comments

yajl-d is the D binding for YAJL.

YAJL provides the stream JSON parsing and some extra features, e.g. allow comments.

yajl-d also provides the JSON encoding and stream decoding. yajl-d is 2 - 3 times faster than std.json (try simple benchmark in example directory).

Following code is basic form:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import yajl.yajl;

// yajl-d can serialize / deserialize D object.
struct Hoge
{
    ulong id;
    string word;
    bool yes;
}

// {"id":100,"word":"hey!","yes":true}
Hoge hoge1 = Hoge(100, "hey!", true);
Hoge hoge2 = decode!Hoge(encode(hoge1));
assert(hoge1 == hoge2);

encode and decode are the wrapper of Encoder and Decoder. If you want to know more details of Encoder and Decoder. See README and the DDoc.

yajl-d has already listed in the official site. Thanks to Lloyd!

Comments