What's the accurate definition of a compiler?
As the comment points out, there's not a formal definition for &quot;compiler&quot;, instead it's understood to be that program which translates source code into the target language. Both definitions given are adequate. The definition in Wikipedia is a good one:

In computing, a compiler is a computer program that translates
computer code written in one programming language (the source
language) into another language (the target language). The name
&quot;compiler&quot; is primarily used for programs that translate source code
from a high-level programming language to a lower level language
(e.g., assembly language, object code, or machine code) to create an
executable program.