Now this is something that would be really cool to implement. @Vindaar and I talked about how term rewriting macros could be used to simplify a bit of the parsing but this is a totally new level of compile time calculations! :O I'm nearly afraid of the kind of power you would have then! xD Haven't used `getImpl` before but it seems like it could be quite powerful.
What I'm a little concerned about though is that it will be even more abstract developing it. This run-time approach is getting quite abstract already. But perhaps I'm not really seeing what you see here. Do you think you could give me a super quick explanation of how you think the expression `2*sin(x+x+y)` could be parsed in the AST instead? Or is it "parsed" at all? Things like simplifications perhaps doesn't exist until we want to print out something pretty to the user? I would very much want to hear more of your thoughts on this :D I've started to wrap SymEngine just today so I guess we could have the best of both worlds. A run-time library and a compile-time library.