Which programming languages does GCC support?

Updated

GCC (the GNU Compiler Collection) ships front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68, plus libraries for these languages such as libstdc++. That list comes from the project's own description of itself on gcc.gnu.org, so it reflects what the collection officially includes rather than what a single installed build might have enabled. If your project is written in one of those languages, GCC is a candidate toolchain; whether it is the right one depends on your target platform and how your distribution packages the compilers.

The full language list

According to the GCC project page, the collection includes front ends for:

  • C
  • C++
  • Objective-C
  • Objective-C++
  • Fortran
  • Ada
  • Go
  • D
  • Modula-2
  • COBOL
  • Rust
  • Algol 68

Alongside the front ends, GCC provides libraries for these languages — the page names libstdc++ as an example, which is the C++ standard library implementation that ships with GCC.

What "front end" means here

A front end is the part of the compiler that parses a particular language and turns it into GCC's internal representation. The back end then generates code for your target. This is why one compiler collection can cover so many languages: adding a language means adding a front end, not rebuilding the whole toolchain.

A practical consequence: the language list describes the collection as a whole, not necessarily your local gcc binary. A default build on many systems enables C and C++ and little else. Fortran, Ada, Go, D, and the rest are often packaged as separate commands (gfortran, gnat, gdc, and so on) or separate distribution packages.

One caveat: Algol 68 is experimental

The project's news notes that an experimental Algol 68 front end was added to GCC. "Experimental" is the operative word — treat Algol 68 support as a work in progress rather than a stable, production-ready target, and check the current release notes before relying on it.

How to check what your build actually supports

The list above tells you what GCC can support; your installation tells you what it does support. To find out:

  1. Run gcc -v and read the "Configured with" line — it shows which languages were enabled when the compiler was built.
  2. Try invoking the language-specific driver directly, for example gfortran --version or gdc --version. If the command exists, that front end is installed.
  3. On a distribution, check your package manager for separate language packages (for example, a Fortran or Ada package) if the driver is missing.

The expected result is a version string for each language you have; a "command not found" means that front end is not installed, even though GCC as a project supports the language.

Choosing GCC for your language

  • C, C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, Objective-C/C++: GCC lists a front end for each, so it is worth evaluating against your platform and existing build setup.
  • Algol 68: available only as an experimental front end — verify current status before committing.
  • A language not on the list: GCC is not the tool for it; look elsewhere.

For release status and which versions are currently maintained, the project's "Supported Releases" section on gcc.gnu.org is the authoritative place to check before you pick a version to build against.