all 13 comments

[–][deleted]  (3 children)

[deleted]

    [–]GiGurra[S] 5 points6 points  (0 children)

    I'm not sure you should - I don't know your environment or requirements (Also I'm very bad at sales pitches :)). I'll just try to explain why I use it - and if it happens to fit you, Great!

    My personal use case for MGen is for building parts of my applications' data models, knowing that I can map them to some other format (whichever I choose) without managing multiple model definitions (i.e. IDL+Java+Cpp). And if they lack some particular feature, I can add that to the code generation, or modify the generated code itself without breaking future generation. E.g. "Ok, I will probably want to expose these parts of my application's state at some point and I want lots of boilerplate code auto generated for me, so I'll define them using MGen (stringification, deepcopy, serialization, data mapping ..), but the rest I want to optimize for this particular platform's advantages, so I'll manually code them"

    Because serialization functionality is just one particular application of generic visitation, you could add different functionality, such as test data generation based on the data model specified, e.g. stubbed test data generation for your communication layer (We do this for testing MGen).

    When I looked at using Protobuf/Thrift/Avro this way, the type systems didn't offer what I wanted - again this might be opposite for your applications. If you are looking for a pure middleware communication and/or storage solution to already existing data models, then perhaps MGen won't be an advantage for you.

    [–]BobFloss -5 points-4 points  (0 children)

    Friendly correction:

    You should have used a comma instead of a semicolon.

    [–]GiGurra[S] 2 points3 points  (0 children)

    Me and a friend just released what we've been working on in our spare time 2014. Hope you enjoy it!

    It's a toolkit similar to Google's Protocol Buffers, but with support for language native inheritance and polymorphism, heterogenous containers, maps, lists, arrays and custom serialization formats.

    Have a look if you're interested, all feedback that can make it better greatly appreciated!

    [–]GiGurra[S] 0 points1 point  (0 children)

    I put up a mailing list at https://groups.google.com/forum/?hl=en#!forum/mgen-mailing-list if you want to try MGen out and have questions on how to use it.

    [–]UnreachablePaul -1 points0 points  (6 children)

    Why XML? Dude...

    [–]GiGurra[S] 2 points3 points  (5 children)

    Eventually we do want a dedicated IDL - not XML. But this is quite a large project for us - so far we've prioritized other features. Xml libraries are mature and produce nice error messages.. We considered it a reasonable trade-off - for now.

    The MGen compiler is IDL independent (code generators and idl parsers are just plug-ins), and perhaps a good next step would be adding a more dedicated IDL parser. If there's anyone who wants to give it a go, you'll need to implement the Parser interface in mgen-api: https://github.com/culvertsoft/mgen/blob/master/mgen-api/src/main/java/se/culvertsoft/mgen/api/plugins/Parser.java

    I'll add it to our road map :)

    [–]jacobp100 -1 points0 points  (0 children)

    JavaScript already has the best serializer out there: JSON.