What is a Programming Language?
  • A Programming Language is a formal language used to write instructions that a computer can understand and execute.
  • Programming Language A formal language through which instructions are given to a computer.
Low Level LanguageClose to machine hardware
High Level LanguageClose to human thinking/language
Programming languages: levels
Programming languages: levels
Classification Snapshot

Low Level Language (LLL)

Machine Language (1GL) + Assembly Language (2GL)
Machine/architecture-dependent and close to hardware; difficult to learn. Performance depends on the generated instructions and algorithm.

High Level Language (HLL)

Usually easier to write/debug and more portable. A suitable compiler/interpreter is required; high-level code is not necessarily slower than hand-written assembly.
⚡ CORE MEMORY
1GL = Machine • 2GL = Assembly • 3GL = High Level • 4GL = Very High Level • 5GL = AI / Logic Based
Low Level Language (LLL)
  • Very close to machine hardware and difficult for humans.
  • Can provide direct control over machine instructions; speed depends on the implementation.
  • Machine dependent.
  • Difficult to learn.
Machine Language (1GL)Assembly Language (2GL)
High Level Language (HLL)
  • Languages close to human thinking & language.
  • More portable when a suitable compiler/interpreter and platform libraries are available.
  • Easy coding & debugging.
  • Portable.
  • Optimizing compilers can generate fast machine code; language level alone does not determine performance.
Machine Language vs Assembly Language
BasisMachine Language (1GL)Assembly Language (2GL)
LanguageBinary (0,1)Mnemonics
TranslatorNot requiredAssembler
Ease of useVery difficultComparatively easier
SpeedDirect native instructions; speed depends on implementationPerformance depends on implementation
PortabilityNot portableNot portable
⚠ EXAM TRAP
Assembler translates Assembly Language; the source explicitly says Machine Language needs no translator.
First Generation Language (1GL) — Machine Language

Concept

Binary 0 & 1 only
Direct CPU execution

Advantages

Fastest
No translator required

Disadvantages

Impossible/difficult for humans
Error-prone
Source Example
101010101100
Second Generation Language (2GL) — Assembly Language

Concept

Symbolic instructions such as ADD, SUB
Needs Assembler

Advantages

Easier than 1GL
Potential for hardware-level optimization; not always faster than compiled HLL

Disadvantages

Machine dependent
Still complex
How programs are translated
How programs are translated
Third Generation Language (3GL)
  • English-like syntax.
  • Structured programming.
  • Key features: loops, functions, conditions.
  • Compiler / Interpreter required.
3GL Examples & Real-Life Use

Examples in source

CC++JavaPythonCOBOLFORTRAN

Real-Life Use

Software development
Web, desktop and system programs
Extended 3GL list on source summary page
BASIC • Pascal • Ada • Ruby • Swift are also listed with 3GL examples in the PDF summary.
⚠ EXAM TRAP
Source one-line summary: 3GL = Human-friendly programming languages.
Fourth Generation Language (4GL)

Concept

Non-procedural
Focus on WHAT, not HOW

Advantages

Less code
High productivity

Usage

Database queries
Data analysis
SQLMATLABSASR
Fifth Generation Language (5GL)

Concept

Logic, facts, constraints
Used in Artificial Intelligence

Features

Problem-solving approach
Minimal coding

Usage

Expert systems
Robotics
AI research
PROLOGConstraint-based languages
Language generations: common exam model
Language generations: common exam model
Extended source examples
4GL summary additionally lists PL/SQL, FoxPro, Oracle Forms. 5GL summary additionally lists Mercury, OPS5.
1GL → 5GL Master Comparison
GenerationLanguage LevelExamples from sourceKey Description
1GLMachine LanguageBinary Code (0 & 1)Directly understood by CPU.
2GLAssembly Languagex86, ARM AssemblyUses mnemonics such as ADD, MOV.
3GLHigh Level LanguageC, C++, Java, Python, COBOL, FORTRAN, BASIC, Pascal, Ada, Ruby, SwiftEnglish-like, structured, portable.
4GLVery high-level/domain-oriented language (classification varies)SQL, PL/SQL, MATLAB, SAS, R (classification varies), FoxPro, Oracle FormsNon-procedural, less coding, WHAT-oriented.
5GLAI / Logic Based LanguageProlog, Mercury, OPS5 (logic/constraint-based examples); Lisp is a high-level language historically used in AIUsed in AI & expert systems.
Programming paradigms and examples
Programming paradigms and examples
⚡ GENERATION SUMMARY
1GL: Binary • 2GL: Mnemonics • 3GL: Human-friendly • 4GL: Database/report-oriented • 5GL: AI-based
Ultra-Fast Revision

1GL

Machine
0 & 1
No translator

2GL

Assembly
Mnemonics
Assembler

3GL

High Level
Human-friendly
C/Java/Python

4GL

Very High Level
WHAT not HOW
SQL/R

5GL

AI / Logic
Expert systems
Prolog / logic programming
Exam Traps
  • Machine Language = 1GL, not Assembly.
  • Assembly Language = 2GL and needs an Assembler.
  • 3GL source examples: C, C++, Java, Python, COBOL, FORTRAN.
  • 4GL is described as non-procedural and WHAT, not HOW.
  • 5GL commonly refers to logic/constraint-based languages such as Prolog. Use in AI alone does not make a language 5GL; Lisp is a general high-level language.
  • Low-level languages are source-described as machine dependent and not portable.
Chapter Boundary
Chapter 10 covers PDF pages 83–86. PDF page 87 starts the next chapter, Internet.