Computer Programming Language and Toolchain Process

You are currently viewing Computer Programming Language and Toolchain Process

Computer Programming Language and Toolchain Process

In this blog, we are going to discuss the concept of computer programming languages and the internal workings of applications.

Note:

As programmers, our task is to communicate with the computer.

  • Inside the computer, the microprocessor is responsible for performing tasks.
  • The microprocessor only understands binary language (1, 0).
  • As programmers, it is not practical to write programs in binary language.
  • To solve this problem, programmers learn different programming languages like C, C++, and Java.
  • Programs written in any programming language get converted into binary language.

There are three types of programming languages:

  1. Procedural Programming Language (C Programming)
  2. Object-Oriented Programming Language (C++ Programming)
  3. Virtual Machine-Based Programming Language (Java, Python Programming)

  • Programmers select a programming language based on the specific needs of their project.
  • They write the program using the chosen language.
  • The written program is forwarded to a toolchain.
  • The toolchain converts the program from a human-readable format into a machine-readable format (binary).
  • Each programming language has a different toolchain.

Toolchain of C Programming

The toolchain is a set of software tools used to convert a human-readable program into a machine-readable program.

Step 1

  • The programmer uses an editor to write the program.
  • After writing, the file is saved on the hard disk with the name demo.c.
  • The contents of demo.c are human-readable and human-understandable.

Step 2

  • The preprocessor accepts the .c file as input and generates an expanded version of the .c file.
  • The file created by the preprocessor is demo.i.
  • .i stands for intermediate code.
  • The contents of the demo.i file are human-readable and human-understandable.

Step 3

  • The output of the preprocessor is provided as input to the compiler.
  • The compiler is software that converts the program from one language to another.
  • In our case, the compiler converts the program from a human-readable format into a machine-dependent format, which is assembly language.
  • The file created by the compiler has the extension .asm or .s.
  • The newly created file by the compiler is demo.asm.

Step 4

  • The output of the compiler is passed as input to the assembler.
  • The assembler is software used to convert the program from a machine-dependent format into a machine-understandable format.
  • The output of the assembler is a file with the extension .obj.
  • In our example, the newly created file is demo.obj.
  • Demo.obj contains the code in binary format but is not directly executable.

Step 5

  • The linker links the .obj file generated by the assembler with its dependent .obj files.
  • The linker generates the output with the extension .exe.
  • In our case, demo.exe is the output of the linker.

Step 6

  • The .exe file generated by the linker is stored on the hard disk.
  • To execute any application, it has to be loaded into RAM.
  • The loader is responsible for loading the .exe file from the hard disk into RAM.
  • After loading, the .exe file is considered a process and gets executed with the help of the operating system.

Leave a Reply