gcc.gnu.org

GCC Front Ends - GNU Project

  • ️Wed Apr 02 2025

Currently the main GCC distribution contains front ends for C, C++, Objective C, Objective C++, Fortran, Ada, Go, D, Modula-2, Rust, and Cobol.

There are several more front ends for different languages that have been written for GCC but not yet integrated into the main distribution of the GNU Compiler Collection. Some of these may be integrated in future; others may not, for various reasons.

Example front ends for toy languages and guidance on writing front ends are listed along with other links and readings. The source files tree.h and tree.def are the key ones to be familiar with.

Some of these front ends are very much works in progress; others are very mature.

  • GNU Pascal Compiler (GPC).
  • Mercury, a declarative logic/functional language. The University of Melbourne Mercury compiler is written in Mercury; originally it compiled via C but now it also has a back end that generates assembler directly, using the GCC back end.
  • Modula-3: SRC M3 is based on an old version of GCC and PM3 and CAM3 derive from SRC M3. This compiler is written in Modula-3; for copyright and licensing reasons neither the small amount of C code that links to GCC and provides the interface to the back end, nor the front end proper, is likely to be integrated in GCC, nor is the front-end likely to change to a more normal interface of linking directly to the back end.
  • GHDL is a GCC front end for the VHDL (IEEE 1076) hardware design language. GHDL and its runtime library are written in Ada using GNAT and are distributed under the GPL.
  • PL/1 for GCC is a GCC front end for the PL/I language.
  • GCC Unified Parallel C (GCC UPC) is a compilation and execution environment for Unified Parallel C.
  • gcc-a68 is a GCC front-end for the Algol 68 language.