On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote:
I like CTFE and the meta programming idea for languages like D.
However, I'm wondering why most (everyone?) is trying to do
meta-programming using the same language as the one getting
compiled. IMO the use-cases a pretty different and doing CTFE,
code-generation etc. needs some other approach. If you look at
all the strange template syntax, strange hacks etc. it's all
far from being obvious.
Why not have a CTL (compile-time-language) that has access to
some compiler internals, that follows a more functional
concept? We are evaluating sequences of things to generate
code, include / exclude code etc.
From my experience with the different approaches, functional
thinking is much better suited and simpler to use for CTFE
goals.
IMO that would really be a big step ahead. Because you know a
hammer, not everything is a nail...
I'm not sure what is preventing you from doing that already.
There is compile time reflection (has access to some compiler
internals) and D support functional style.
Unless you have some specific in mind, I don't think there is
anything we can do to help here. t seems you already have the
pieces you want.