https://en.wikipedia.org/wiki/Compiler

compiler is a computer program that transforms computer code written in one programming language (the source language) into another programming language (the target language).

A compiler is likely to perform many or all of the following operations: preprocessinglexical analysisparsingsemantic analysis (syntax-directed translation), conversion of input programs to an intermediate representationcode optimization and code generation.

Compiler vs. Interpreter

Compiler takes entire program and converts it into object code(binary code) which is typically stored in a file. Binary code, then, could be directly executed by the machine after linking. Example: C, C++

Interpreter directly executes instructions written in a programming or scripting language without previously converting them to an object(or machine) code. Example: Perl, Python, Matlab