Introduction
#
Programming LanguageLanguage is a structured system of communication used by the humans. If two people want to have a conversation but they both should know the same language to understand each others statements. In the same way if we want to communicate or instruct the computer then computer should understand what we are saying(ex: English) at the same time we need to understand what computer is saying(Binary 0 & 1).
A language using which we can instruct the computer to perform some task (computation, algorithm etc.) is called a Programming language. It acts as a language in which we could easily express our thoughts to the machine. Like natural languages, programming language has a fixed set of rules (called grammar or semantics) according to which programs (source code) could be written in it.
This programs are then converted into a language which machine can understand (binary language) and this conversion will be done by the special software called compiler or interpreter. Every programming language has its own compiler or interpreter.
Once a program is compiled then it will generate the object file. Linker will link all the required files/modules to the generated object file to create a executable which computer can run.
Compiler/Assemblers/Interpreter are nothing but the translators which will translate the source code (High-level language) into machine code (Executable).
AST (Abstract Syntax Tree) is a graph/tree representation of source code primarily used by compilers to read code and generate the target binaries.
#
Types of Programming languages- Low Level Language: It is the only language which can be understood by the computer. ex: Binary Language
- Middle-level language: It is a computer language in which the instructions are created using symbols such as letters, digits and special characters. ex: Assembly Language
info
Assemblers are used to convert the middle-level language to low-level language
- High-level language: It is a computer language which can be understood by the users. The high-level language is very similar to human languages and has a set of grammar rules that are used to make instructions more easily. ex: C, C++, Python, Java etc.
info
Compilers or Interpreters are used to convert High-level Languages.
#
Number systemThe technique to represent and work with numbers is called number system
Decimal | Binary | Octal | HexaDecimal |
---|---|---|---|
0 | 0000 | 0 | 0 |
1 | 0001 | 1 | 1 |
2 | 0010 | 2 | 2 |
3 | 0011 | 3 | 3 |
4 | 0100 | 4 | 4 |
5 | 0101 | 5 | 5 |
6 | 0110 | 6 | 6 |
7 | 0111 | 7 | 7 |
8 | 1000 | 10 | 8 |
9 | 1001 | 11 | 9 |
10 | 1010 | 12 | A |
11 | 1011 | 13 | B |
12 | 1100 | 14 | C |
13 | 1101 | 15 | D |
14 | 1110 | 16 | E |
15 | 1111 | 17 | F |