Skip to content

wishlist: use a template language for code generation #113

@jameysharp

Description

@jameysharp

I find files like src/lx/print/c.c difficult to read and maintain due to complicated sequences of fprintf calls which obscure the structure of the code that's being generated. I speculate that using a simple templating language would make the code generation process easier to understand. Perhaps the templates would even be a useful public interface to lx, so users could write their own templates without having to recompile lx.

Although I haven't used it, there is a C implementation of the Mustache templating language that looks to me like it might work perfectly here. For Mustache syntax see https://mustache.github.io/ and for the C implementation check out https://gitlab.com/jobol/mustach.

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