MessagePack for D released
tama
repeatedly at gmail.com
Tue Apr 27 09:54:40 PDT 2010
On Tue, 27 Apr 2010 21:27:35 +0900, Lars T. Kyllingstad
<public at kyllingen.nospamnet> wrote:
> Phobos should definitely have a serialisation module, and this seems to
> me like a good candidate. I haven't tried the code myself, but it looks
> very clean and the examples are nice.
Thanks!
> I consider it a huge plus that it uses an existing format that already
> has APIs for a bunch of programming languages.
I agree. At first, I checked several serialization libraries.
As a result, I select MessagePack with all things considered.
Other libraries and Specs seem to be large and complex.
> Two questions:
>
> The packer can write to an arbitrary ubyte output range, but it seems
> the unpacker is limited to ubyte[] arrays. Would it be possible to
> unpack from an arbitrary input range?
No. Unpacker is possible to do so if D has integrated stream.
For your information, Other implementation(e.g. Java) uses InputStream.
> It doesn't seem to support the real type. It this a limitation of the
> MessagePack format or just an oversight? Even if the format doesn't
> directly support 80-bit floats, it should be possible to wrap them
> somehow.
Good point. MessagePack doesn't define real type(80-bit float) because
some languages don't have real. But MessagePack has free format space,
so some implementation can support language-specific format.
real has environment-dependent problem. This problem causes loss of
precision.
Unpacker can't be responsible for this problem. OK?
I will try to implement real support.
More information about the Digitalmars-d-announce
mailing list