I used to think that metaprogramming involved modifying the program, and (as do some answers to What is reflection and why is it useful? ) that reflection merely consisted of introspection of a program. However, the reflection tag wiki says
Reflection is the process by which a program can observe and modify its own structure and behavior at runtime.
Reflection is the process by which a program can perform introspection. This introspection usually involves the ability to observe and modify its own structure and behavior at runtime. From theoretical perspective reflection relates to the fact that program instructions are stored as data. The distinction between program code and data is a matter of how the information is treated. Hence programs can treat their own code as data and observe or modify them.
[emphasis added]
And the description for metaprogramming is
Metaprogramming is writing programs that write or manipulate other programs as their data.
Metaprogramming is useful because it can save programmers valuable time. Some languages have support to metaprogram themselves and this allows to create code with great expressive power.
(I assume that "write" doesn't mean writing source code to a file, because that'd be code generation.)
Would this make metaprogramming merely a subset of reflection?
Or are the terms distinct because some programming languages are metaprogrammed by another language, in which case metaprogramming occurs but not reflection? (There was a single uncited sentence claiming this in the metaprogramming Wikipedia article)
Or do the terms "reflection" and "metaprogramming" get used differently depending on what programming language the person is using?