Skip to content
Know.itKnow.it
Create an animated lesson
On request

This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.

What is a compiler?

TechnologyLesson on requestFree to read

Quick answer

A compiler is a program that translates code written by humans into machine code a computer can run directly. It takes a whole program written in a language like C or Java and converts it into fast, executable instructions. It translates human-written code into machine code.

Key things to understand

  1. It translates human-written code into machine code.
  2. It processes the whole program before running.
  3. Compiled programs tend to run fast.
  4. It contrasts with interpreters, which run code line by line.

People also ask

What does a compiler do?
It translates source code written by programmers into machine code the computer can execute directly.
What's the difference between a compiler and an interpreter?
A compiler translates the whole program ahead of time; an interpreter runs it line by line as it goes.
Why are compiled programs fast?
They're already translated into low-level machine instructions, so the computer runs them directly.