Skip to content

Maintainable code generation #180

@lcian

Description

@lcian

Currently, the code generation scripts are not well structured and maintainable.

This is okay, as what we really care is the generated code at the end of the day.
However, this also makes it increasingly hard over time to generate code for new entities/concepts we might want to support in the conventions, and make sure the generated code is correct.
We should move to a more maintainable way of generating code.

The preferable solution to address this problem in my opinion is to use a templating language, specifically Jinja.
We would have a standardized way of feeding the JSON model into the templates, and templates to generate code for each platform.
An advantage of using Jinja specifically is that OTEL itself uses Jinja for their opentelemetry-semantic-conventions for all their SDKs.
This means that we would likely be able to use their templates for attributes and simply extend them to support our other concepts, significantly reducing the work needed to support all platforms and converging on a standardized solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions