Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Dicebot via Digitalmars-d-announce
On Monday, 3 August 2015 at 09:40:59 UTC, Atila Neves wrote: In this case, yes. In the real-life case I was simplifying, it wasn't a ubyte[] array, it was an array of structs with non-trivial serialisation that also depended on a previous deserialised variable. It was more like this: struct

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Jacob Carlborg via Digitalmars-d-announce
On 03/08/15 14:21, Per =?UTF-8?B?Tm9yZGzDtnci?= per.nord...@gmail.com wrote: Are there any plans to add different backends (for instance msgpack) to Cereal? Then we could have one package to rule them all! That would be Orange [1]. Hopefully I'll get it into Phobos at some point. [1]

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Walter Bright via Digitalmars-d-announce
On 8/3/2015 4:46 AM, Atila Neves wrote: On Monday, 3 August 2015 at 11:13:50 UTC, Walter Bright wrote: On 8/3/2015 2:21 AM, Atila Neves wrote: [...] Please put this as the first comment on the reddit post. Which one? The one you started the thread with. On a more meta note, when people

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Dicebot via Digitalmars-d-announce
On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote: The summary is you can now write this: struct UdpPacket { static struct Header { ushort srcPort; ushort dstPort; ushort length; ushort checksum; } enum

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Atila Neves via Digitalmars-d-announce
On Monday, 3 August 2015 at 09:27:03 UTC, Dicebot wrote: On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote: The summary is you can now write this: struct UdpPacket { static struct Header { ushort srcPort; ushort dstPort; ushort length;

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread TC via Digitalmars-d-announce
On Monday, 3 August 2015 at 12:21:05 UTC, Per Nordlöw wrote: On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote: Yes. `cerealise` and `decerealise`. The former is slightly weird for performance reasons. It takes a lambda that tells it what to do with the resulting bytes. Close with

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Atila Neves via Digitalmars-d-announce
On Monday, 3 August 2015 at 11:43:15 UTC, Per Nordlöw wrote: On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote: http://code.dlang.org/packages/cerealed What's new? * Performance improvements * New UDAs for networking packets for even less required boilerplate The first new thing

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Atila Neves via Digitalmars-d-announce
On Monday, 3 August 2015 at 10:37:05 UTC, Dmitry Olshansky wrote: On 03-Aug-2015 12:27, Dicebot wrote: On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote: [...] This deserialization will be identical to casting like this, right? (Not trying to diminish your work, just making sure I

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Atila Neves via Digitalmars-d-announce
On Monday, 3 August 2015 at 11:13:50 UTC, Walter Bright wrote: On 8/3/2015 2:21 AM, Atila Neves wrote: [...] Please put this as the first comment on the reddit post. Which one? Atila

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread via Digitalmars-d-announce
On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote: Yes. `cerealise` and `decerealise`. The former is slightly weird for performance reasons. It takes a lambda that tells it what to do with the resulting bytes. Close with LDC and DMD, faster with GDC:

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread via Digitalmars-d-announce
On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote: http://code.dlang.org/packages/cerealed What's new? * Performance improvements * New UDAs for networking packets for even less required boilerplate The first new thing is self-explanatory. The second one is explained briefly in

Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread Atila Neves via Digitalmars-d-announce
On Monday, 3 August 2015 at 12:21:05 UTC, Per Nordlöw wrote: On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote: Yes. `cerealise` and `decerealise`. The former is slightly weird for performance reasons. It takes a lambda that tells it what to do with the resulting bytes. Close with