<div dir="ltr">Do you have a JSON driver for Orange yet? Would be interesting to benchmark Orange against a purpose designed JSON serialization library.<div>If your design is mostly compile time the experiment would be very interesting (I think).</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 12:03 AM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2014-02-16 21:45, "Nordlöw" wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I believe it's worth the try to get Python-style serialization<br>
simplicity to D by default. We use Python cpickle at work and its<br>
fantastically simple and fast. It handles just about everthing you need<br>
by default as long as you have imported the modules that contain the<br>
types involved in the serialization.<br>
<br>
It would attract more people from dynamical languages like Python if D<br>
got default-powers in std.serialization that does everything that<br>
msgpack does plus followings references.<br>
<br>
This would make it possible to serialize arbitrary graph-likes<br>
structures with potential reference cycles. Resolving these cycles can<br>
be solved by using a map that contain a list of references/classs that<br>
already have serialized.<br>
</blockquote>
<br></div>
I already have all this in Orange [1], which I'm in progress of adapting to a package for Phobos.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm however not sure how serialization of base and superclasses should<br>
be implemented in the most convenient way. Maybe somehow has a good<br>
suggestion for this.<br>
</blockquote>
<br></div>
This requires registering the subclass in some way. In my implementation one needs to call:<br>
<br>
Serializer.register!(Sub);<br>
<br>
For full example see [2].<br>
<br>
[1] <a href="https://github.com/jacob-carlborg/orange" target="_blank">https://github.com/jacob-<u></u>carlborg/orange</a><br>
[2] <a href="https://github.com/jacob-carlborg/orange/wiki/Base-Class" target="_blank">https://github.com/jacob-<u></u>carlborg/orange/wiki/Base-<u></u>Class</a><span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
/Jacob Carlborg<br>
</font></span></blockquote></div><br></div>