A compiler is a computer program that converts computer code written in one programming language (such as C++) into another language (such as machine code). It takes the source code and checks it for errors, then converts it into an executable program.