Let the Baboon do the monkey job.
Stripped-down experimental DML with schema evolution support and garbage collection.
- Set-based structural inheritance with subtraction and intersections
- Automatic codecs derivation (JSON and tagless custom binary format)
- Automatic evolution derivation where possible, stubs where manual convertion is required
- Codegen targets: C#
- (*) This is a DML, not an IDL, it does not support service/interface definitions
- (*) Currently only C# cogen target is supported
- (*) Comments are not preserved in the cogen output
- No nominal inheritance
- Only structural inheritance is supported
- (*) No inheritance information is preserved in the transpiler output
- No templates
- Only Enums, DTOs and ADTs
- ADT members can only reference top-level type definitions
- (*) Only integer constants may be associated with enum members
- (*) No newtypes/type aliases
- (*) No inheritance-based lenses/projections/conversions
Points marked with (*) will/may be improved in future.
baboon \
--model-dir ./src/test/resources/baboon/ \
--model ./src/test/resources/baboon/pkg0/pkg01.baboon \
--model ./src/test/resources/baboon/pkg0/pkg02.baboon \
--output /path/to/directory
- All the types which are not transitively referenced by
root
types will be eliminated from the compiler output. - Usages in structural inheritance are not considered references, so structural parents which are not directly referenced as fields and not marked as
root
s will be eliminated
Be very careful about foreign types. It's your responsibility to make sure everything is set properly.
At the bare minimum you will have to do the following for each foreign type you use:
- Create a custom codec for your FT
- Override generated dummy codec instance with
BaboonCodecs#Register
- Override generated dummy codec instance using setter on
${Foreign_Type_Name}_UEBACodec#Instance
field - Override generated dummy codec instance using setter on
${Foreign_Type_Name}_JsonCodec#Instance
field
Make sure your foreign types are NOT primitive types or other generated types. It's a funny idea, but it will explode in runtime.
Foreign types may hold any position in generics but it's up to you to ensure correctness.