Let's write a compiler, part 4: Testing
briancallahan.net
briancallahan.net
But it is very clean and nice. I like the pattern.
Yes, translating between closely related languages is often like this: the mapping between their constructs is 1-to-1 and almost trivial. But try translating e.g. λ-calculus into C in one go, without separate lambda-lifting/closure-converting steps: it's absolutely doable but quite messy.
Yes it's a kind of transpiler, or template compiler, a typically 1-1 mapping.