Cecilia toolchain: support for C/CORBA-like structs and unions in the IDL...
I'm currently trying to port a "real-world" non-trivial project (libmpeg2 MPEG-2 decoder) to a component-based form. The original libmpeg2 code uses a number of structures in structures. These cannot be rendered by records in records, as the inner IDL record is translated to a pointer to a structure. This requires rather invasive changes to the original code:
- turning record selector direct (.) into record selector indirect (->);
- making memory management more complicated. This is probably another hinderance to adoption of the Cecilia technology by programmers...
Alessio and I discussed the issue yesterday. It came out that it may be possible to mark structs within records with a special qualifier like "struct". However, Alessio said that the semantics of "record" was independent from the way it was implemented in C, and that adding qualifiers would break that semantics. Another qualifier like "union" may solve unions within records. However, this alone won't solve the (admittedly infrequent) situations where unions or structs are part of function prototypes.
What about adding new constructs: struct struct_name { type1 name1; type2 name2; ... } (likewise for "union") at the same synactical level as "interface" and "record" (so that structs and unions can be easily used in function prototypes). (I'm not sure about the semantics of records within struct/union, though: should they be allowed and behave like records in records, or shouldn't they be allowed ?).