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 this blog post:

https://www.reddit.com/r/programming/comments/3flnlt/cerealed_a_d_library_for_declarative_binary/

(also on HN but you know how that goes)

The summary is you can now write this:

    struct UdpPacket {
        static struct Header {
            ushort srcPort;
            ushort dstPort;
            ushort length;
            ushort checksum;
        }

        enum headerSize = unalignedSizeof!Header;
        alias header this;

        Header header;
        @LengthInBytes("length - headerSize") ubyte[] data;
    }

Code? Who needs code when the compiler can write it for you?

Atila

Reply via email to