What are programming languages written in?
Programming languages are implemented using other programming languages. The implementation language (used to build the compiler or runtime) is separate from the language specification itself. C and C++ are the most common implementation languages for performance-critical runtimes.
Language vs. implementation
When we say "Python is written in C," we mean CPython — the reference implementation — is written in C. The Python language specification doesn't mandate any implementation language. You could write a Python interpreter in JavaScript, and some people have.
The key terms:
- Language specification — defines the syntax and semantics (e.g., the Python Reference Manual)
- Compiler — translates source code to machine code or bytecode (e.g., javac, rustc, tsc)
- Interpreter / runtime — executes code (e.g., CPython, V8, HotSpot JVM)
- VM (virtual machine) — an abstract machine that runs bytecode (JVM, CLR, BEAM)
What popular languages are written in
| Language | Primary implementation | Notes |
|---|---|---|
| Python | C (CPython) | Reference implementation (CPython) is written in C |
| JavaScript | C++ (V8, SpiderMonkey) | Major engines (V8, SpiderMonkey, JavaScriptCore) are written in C++ |
| Rust | Rust (self-hosting) | rustc is self-hosted; originally written in OCaml |
| Go | Go (self-hosting) | Self-hosting since Go 1.5; previously written in C |
| Java | C/C++ (HotSpot JVM) | HotSpot JVM is in C/C++; javac compiler is in Java |
| TypeScript | TypeScript (self-hosting) | tsc is self-hosted in TypeScript |
| Ruby | C (MRI/CRuby) | Reference implementation (MRI) is written in C |
| Haskell | Haskell (GHC) | GHC compiler is written in Haskell |
Why C and C++ are so common
Most production programming language runtimes are implemented in C or C++ because:
- Direct memory control for garbage collectors and allocators
- Predictable performance without a runtime of their own
- Mature tooling and portability across architectures
- Historical: C was the dominant systems language when most early runtimes were written
Self-hosting languages
Some languages' compilers are written in the language itself — called self-hosting. This requires bootstrapping: an initial compiler written in another language, which is then used to compile the self-hosted version. Self-hosting languages: Rust, Go, TypeScript, Haskell, Java (javac).
See: What is compiler bootstrapping? and What is a self-hosting compiler?
Frequently Asked Questions
What does "what is a programming language written in" mean?
It means what programming language was used to implement the compiler, interpreter, or runtime of another language. The implementation language is different from the language specification.
Can a language be written in itself?
Yes — this is called a self-hosting compiler. Rust, Go, TypeScript, Haskell, and Java's javac are all self-hosting. The first version must be written in another language, then it bootstraps itself.
Why does it matter what a language is written in?
The implementation language affects performance characteristics, portability, interoperability with native libraries, and how the language bootstraps itself. C and C++ are common choices for performance-critical runtimes.
How many languages in the dataset have compiler or runtime implementation data?
The dataset includes 134 compiler and runtime relationships across 97 languages.