shameless plug: I have done a part 1 and part 2 presentations on this very topic
and Your Program as a Transpiler: Improving Application Performance by Applying Compiler Design https://www.youtube.com/watch?v=TWfigR9wGsA
Your Program as a Transpiler: Applying Compiler Design to Everyday Programming https://www.youtube.com/watch?v=BUrY6On1SxM
the second in particular is about reasoning in terms of compiler phases when you have to process something that apparently may not immediately look like a programming language.