What is C++ written in?
What C++ is used for
C++ is used where you need both high performance and large-scale structure: game engines, browsers, databases, trading systems, and high-end desktop software. It adds object orientation, templates, and the standard library on top of C's speed.
Notable software: Unreal Engine, Google Chrome, Adobe Photoshop, MySQL, and most AAA video games.
About C++
C++ is a general-purpose programming language. It is a statically typed language that compiles ahead of time to native machine code. It supports object-oriented, imperative, and generic programming.
C++ first appeared in 1983 and was designed by Bjarne Stroustrup. Today C++ is one of the most widely used programming languages in the world.
C++ in the language family tree
C++ drew on ideas from Simula, C, Objective-C, and ALGOL and went on to influence Java, D, Rust, C#, and Solidity.
Sources: Wikipedia · Wikidata · Official site
Quick Facts
- Short answer
- Compiled by g++, Clang, and MSVC (all C++)
- Created by
- Bjarne Stroustrup, 1985
- Backend
- LLVM (Clang) or GCC
- Self-hosting
- Yes, C++ compilers are written in C++
C++ compilers and the LLVM backend
C++ has no single reference compiler. The three dominant toolchains, GCC's g++, Clang, and Microsoft's MSVC, each parse C++ and emit native code. Clang is a C++ front end for LLVM, and LLVM's optimizer and code generator are also written in C++. That same LLVM backend is used by Rust, Swift, and Julia.
Because every major C++ compiler is itself a C++ program, building a compiler requires an existing C++ toolchain, the classic self-hosting arrangement.
C++ toolchains compared
| Toolchain | Written in | Backend |
|---|---|---|
| GCC (g++) | C and C++ | GCC backend |
| Clang | C++ | LLVM |
| MSVC | C++ | Microsoft backend |
Frequently Asked Questions
Evidence Sources
- https://en.wikipedia.org/wiki/C%2B%2B
- https://gcc.gnu.org/
- https://github.com/llvm/llvm-project
- https://lwn.net/Articles/542457/
- https://github.com/v8/v8
- https://spidermonkey.dev/
- https://webkit.org/
- https://github.com/openjdk/jdk
- https://github.com/dotnet/runtime
- https://github.com/thepowersgang/mrustc
- https://en.wikipedia.org/wiki/Java_(programming_language)
- https://dlang.org/overview.html
- https://doc.rust-lang.org/reference/influences.html
- https://github.com/swiftlang/swift
- https://github.com/carbon-language/carbon-lang
- https://github.com/dart-lang/sdk
- https://docs.modular.com/mojo/
- https://ziglang.org/news/goodbye-cpp/
- https://en.wikipedia.org/wiki/C_Sharp_(programming_language)
- https://en.wikipedia.org/wiki/Julia_(programming_language)
- https://en.wikipedia.org/wiki/Clang
- https://en.wikipedia.org/wiki/Self_(programming_language)
- https://en.wikipedia.org/wiki/HHVM
- https://en.wikipedia.org/wiki/Solidity
- https://en.wikipedia.org/wiki/Lean_(proof_assistant)
- https://en.wikipedia.org/wiki/Tamarin_(software)
- https://en.wikipedia.org/wiki/Chapel_(programming_language)
- https://en.wikipedia.org/wiki/Pony_(programming_language)
- https://en.wikipedia.org/wiki/Odin_(programming_language)
- https://en.wikipedia.org/wiki/Factor_(programming_language)
- https://en.wikipedia.org/wiki/Nix_(package_manager)
- C++ on Wikidata (Q2407)