Same code in Nim:
import algorithm
const a = [ 3, 1, 2, 4, 0 ]
static: echo(sorted(a)) import algorithm
const a = [ 3, 1, 2, 4, 0 ]
static: echo(sorted(a))The article itself is a D implementation of something done in C++ to show how D does it, and how much simpler it is. The Nim example is right in line with this.
C++ (gcc and clang) and D’s compile-time evaluation is a bit more limited in scope, and still uses a tree-walk interpreter, although D might also migrate to a bytecode VM someday (https://dlang.org/blog/2017/04/10/the-new-ctfe-engine/)
Many (most?) Lisps have had full arbitrary CTE since ... I'm not sure, probably before C existed?
Writing a lisp compiler in lisp is a very different task from writing an interpreter. Especially if one expects to bootstrap.