Developer concepts

What is a compiler?

A program that translates source code into machine code ahead of time.

You write code in words a human can read. Your computer's processor only understands machine code. Something has to translate.

What it is

A compiler is a program that translates source code into machine code ahead of time, into a file the computer can run.

How it works

It reads your code, checks it for errors, optimizes it, and writes out a program. C, Rust and Go work this way. An interpreter works differently: it runs your code as it reads it, step by step. Python and JavaScript started out that way, though modern engines also compile on the fly.

Why it matters

Compiled programs tend to start fast and run fast, and the compiler catches many mistakes before the program ever runs.

More from The Benmore Brief on YouTube

Put AI to work in your business.

Benmore's forward deployed engineers build and connect the software, from discovery to deployment.

Talk to us