One of the original goals in Odin was metaprogramming. However, as development progressed, it has come clear that this is such a broad term which could mean anything.
The kinds of metaprogramming originally conceived are compile time execution, AST modification, and "semantic macros".
Here is the new idea: allow the user to "plug-in" their own metaprogramming functionality as a stage in the compiler. With the specific stages being:
- File loading (get text into memory)
- Tokenizing/Lexing
- Parsing
- Type checking
- SSA generation and optimization
- Code generation
At each stage, the use could do numerous different operations. Here are some examples, respectively:
- C-style preprocessor
- Token swapping/modifying
- AST modification/generation
- Documentation generation, type modification
- Custom optimizations for specific platforms
- Custom optimizations for specific platforms
This would leave the language as a base which could be extended by the user. This would mean numerous dialects would be produced but the base language "should" work in all of them.