It is, in lots of languages. It is usually called "compile time macros" or "macros".
In lots of languages the macros run in the language itself, for example in Lisp, Scala or Nim.
In C++, compile time macros are run in two separate languages: 1 the "pre-processor" and 2 "C++ templates"