Understanding Programming Languages and Translators

A programming language is designed to handle different types of data, such as numbers, characters, and strings, to produce useful output known as information. A program is a sequence of statements that execute a specific task in a sequential manner. These statements are formed using keywords and symbols according to the language's syntax rules or grammar. It is crucial for every program to adhere to the syntax rules supported by the language.

History of C Language

Year Name of the Language Developed By/At
1960 ALGOL Bells Labs AT∓T - USA
1963 CPL University of Cambridge
1965 BCPL University of Cambridge
1967 B Ken Thompson
1970-72 C Dennis Ritchie

Packages (Readymade Software)

Packages are pre-built software tools that simplify various tasks. Here are some common categories and examples:

1. Word Processors

Examples: WordStar, MS-Word

2. Spreadsheets

Examples: Lotus 1-2-3, MS Excel

3. DBMS (Database Management System)

Examples: DBase, Foxbase, Foxpro

4. RDBMS (Relational Database Management System)

Examples: MS Access, Oracle

Types of Languages

Programming languages are categorized based on their level of abstraction and their relation to machine code. Here are the main types:

1. Low-Level Languages

Data is expressed in binary digits (0 or 1). These languages are machine-oriented and improve machine efficiency.

Examples: Machine Language, Assembly Language

Binary Code Example:
10101011 11001100

2. High-Level Languages

Data is expressed in a more human-readable form. These languages improve programming efficiency and are more oriented towards people.

Examples: BASIC, COBOL, Pascal, FORTRAN

FORTRAN Code Example:
PROGRAM HELLO
  PRINT *, 'HELLO, WORLD!'
END PROGRAM HELLO

3. Middle-Level Languages

These languages combine features of both high-level and low-level languages. They improve both programming and machine efficiency.

Examples: C, C++, Java

C Program Example:
#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}

C Language Characteristics

The C language has several defining characteristics:

  • C is a Procedure Oriented Programming Language (POP).
  • C is a Structured Language.
  • C is case-sensitive.
  • C is portable.

C++ Language

C++ is an Object-Oriented Programming Language (OOP) that builds on C with additional features for object-oriented programming.

Translators

Translators are tools that convert code written in high-level languages into machine-understandable code. There are two main types of translators:

1. Compiler

A compiler translates the entire program into machine code at once. It also debugs all errors at once, resulting in a shorter execution time compared to interpreters.

Examples: C, C++, Java

2. Interpreter

An interpreter translates the program line by line into machine code. It debugs errors one by one, which generally results in longer execution times compared to compilers.

Examples: VB (Visual Basic), Python

How a C Program Converts into Binary Language

A C program is converted into binary language using a compiler. The compiler takes each character of the program, converts it into its ASCII value, and then into binary code.

Example:
main() { // Code Block } ----> Compiler ---> 1010011001

ASCII (American Standard Code for Information Interchange)

ASCII assigns numeric values to characters. Here are some examples:

'@' = 64
'\0' = 0
'\n' = 10
'\t' = 9
' ' = 32
'#' = 35
'$' = 36
'0' = 48
'1' = 49
'A' = 65
'a' = 97

    Thank you for reading! Your thoughts and suggestions are always welcome—let’s connect in the comments below!