I was wondering if there will be native support for code generation. The idea here is, that one can make fantontemplate files, which will be expanded at compile time to fantom source code. This code will be compiled along with normal source code.
The generated files should have a header clearly telling that the file has been autogenerated. Further, there should be an encoding telling which template the file stems, such that deleting a templatefile will make it easy to delete its resulting source files.
The "T4" project for C# is along the lines I'm thinking. Further, it has the neat feature that opening a project with templates, VisualStudio automatically generates the templates to source files and includes them in the project as though they were part of the project from the start.
Hi @kbilsted, welcome to Fantom!
If you would like to generate code, there are already lots of options for turning that code into loaded classes:
Was there something else specifically you were looking for?
I am not sure its a core thing for how you generate the code and what templating engine you use (might take a look at Mustache), unless one obvious community project stands out as belonging in the core. In fact, my plan for later this year is to slice up the existing core into a much smaller distribution and move things like UI, flux, etc out into online repositories. Long and short - my goal is to start making "core" smaller, not bigger (but we need to figure out online repo design first).
Login or Signup to reply.