C, C++, and Java are high-level programming languages. These use English-like syntax which is easy to understand for humans. But computers understand machine code, you know that 0s and 1s code language.
The compiler does that translation.
The Compilers are programs that translate source code in machine-readable format. For example, c has GCC and clang compiler.
Linux comes with GCC, the GNU Compiler Collection. These include front ends for C, C++, Objective-C, Fortran, Ada, Go, and D. The Linux kernel is also built using GNU compilers.
There are not the only compilers available in Linux. It has a good number of compilers, each catering to unique needs and programming languages. In this article, we will try to understand the compiler landscape in Linux.
Compiler on Linux
Below is the list of compilers available for some programming languages in Linux.
- GCC (GNU Compiler Collection)
- GCC for Ada (GNAT)
- Intel C++ Compiler
- IBM XL C/C++ Compiler
- Sun/Oracle Solaris Studio
- Rust Compiler (rustc)
- Go Compiler (gc)
- Java Compiler (javac)
When you say Linux, there are many flavors like Debian, Red Hat, etc. The compiler available on this system may differ as it is provided and supported by different companies and open-source communities.
Let’s see one by one
Debian / Ubuntu-based Linux
Debian is a free and open-source operating system (OS) and Linux distribution. It is known for its commitment to free software principles and is developed by a diverse community of volunteers worldwide. Debian aims to provide a stable, reliable, and versatile operating system that can be used on a wide range of devices, from personal computers to servers. There are many other Distro based on it like Ubuntu, Linux Mint, Deepin, etc
All of these use DPKG and are apt for package management tools.
To find the compilers installed on Debian-based Linux Distro use dpkg command with list option as shown below.
dpkg --list | grep compiler
These are already installed. If you want to find which compiler is available to install run the apt-cache command search for compiler.
apt-cache search Compiler
The list is very huge, putting some below.
In conclusion, the Linux ecosystem boasts a rich array of compilers, with GCC (GNU Compiler Collection) leading the way as a versatile and powerful tool for various programming languages. From Clang’s efficiency to language-specific compilers like GNAT for Ada and Rust’s Rust, Linux provides a diverse toolkit for developers.
Whether you’re crafting software in C, C++, Java, or exploring niche languages, the availability of compilers ensures a tailored development experience.