by hellofunk · 7y ago · 0 comments
YAS_OBJECT_NVP("myobject"
,("a", aa)
,("b", bb)
)
instead of: OBJECT_SPEC( foo )
__f( aaa ),
__f( bbb )
END_OF_SPEC
YAS also aims to do it with as little fuss as possible, similar goals, yet YAS binary archives are endian independent, and there are other advantages.I haven't seen it before, but there are bound to be similar solutions to the same problem. The library I posted is used internally for a number of our projects and it has evolved in a course of several years. It is not _trying_ to solve a problem, it _is_ solving a very specific need that our code had since the beginning. So if you are implying that this is a pointless duplication of some other existing solution, then you are off. There's more than one way to skin a cat.
Re: endianess - to each (project) their own. We don't need normalized byte ordering, so with all other things being equal yas-like library will be marginally slower. Other advantages - I don't see any that would benefit our case, but I'm sure there are some that may come handy in other contexts.