The time when a program is executed, i.e. compile time or runtime, has nothing to do with whether that program is pure or impure.
- You can execute pure programs at compile time.
- You can execute pure programs at runtime.
- You can execute impure programs at compile time.
- You can execute impure programs at runtime.
For example, consider the following program.