While at the 42Seoul Gaepo cluster, I suddenly wondered: we call so many projects like Linux, Dart, and Flutter "open source," so is C also open source?
After looking into it, I found that C isn't software. So rather than being open source, it's a defined standard. Various compilers were developed to concretely implement and comply with this defined standard, which led to many open source C compilers. Examples: GCC, MSVC
C was just a "standard" for a language. It's not something anyone can own -- it's a language everyone can use. Anyone could develop compilers or interpreters using this standard. However, creating a language wouldn't have been easy for people unfamiliar with computers or for small teams.
What Is the C Language?#

C is written in .c file format following rules that programs must adhere to in order to execute. The written source code can only be understood by humans -- computers can't directly understand it. A process is needed to convert source code into machine language so that computers can understand it, and a tool called a compiler is essential in this process.
During the compilation process, the source code is checked for syntax errors and converted into a state that can be executed on a computer.
- The preprocessor performs code preprocessing
- The compiler converts the preprocessed file into machine language, generating object files
- The linker combines object files with necessary startup code and other components to produce the final executable
Why are there so many different C compilers?
Since C is used on various operating systems and hardware, compilers optimized for each environment were needed.
Different compilers were developed to meet various requirements, performance needs, and features. Open source compilers were freely modified and distributed by the community, leading to various versions tailored to specific features or environments.
Compilation Process#
The compilation process consists of several stages. You can examine each stage using the gcc command.
- Preprocessing:
gcc -E main.c -o main.i
The preprocessor interprets preprocessing directives like#includeand#define, processing external files and macros needed in the code to generate a preprocessed file - Compilation:
gcc -S main.i -o main.s
The preprocessed file is converted into assembly language. Assembly language is an intermediate form of code converted to run on specific hardware - Assembly:
gcc -c main.s -o main.o
Converts assembly code into machine language to generate object files (.o) - Linking:
gcc main.o -o main.exe
The linker combines object files with startup code and other components to create the executable. Startup code performs necessary preparation tasks before program execution and is responsible for calling themain()function.
Where focus goes, energy flows.
— Tony Robbins