Skip to main content

Generations of programming languages

Short answer

Programming languages are grouped into five generations: 1GL (machine language, binary), 2GL (assembly, mnemonics), 3GL (high-level, portable like C), 4GL (non-procedural like SQL), and 5GL (AI languages like Prolog). Each generation is more human-oriented, but higher generations are usually slower and give less hardware control.

Explain the generations of programming languages.

Programming languages are grouped into five generations, from machine-oriented to human-oriented.

GenerationNameFeaturesExample
1GLMachine languageBinary 0s and 1s, directly executed by the CPU, machine dependent, very hard to write10110000 01100001
2GLAssembly languageMnemonics (MOV, ADD) translated by an assembler, machine dependent8085/8086 assembly
3GLHigh-level languageEnglish-like statements, portable, needs compiler or interpreterC, C++, Java, FORTRAN, Pascal
4GLVery high-level / non-proceduralYou state what is wanted, not how; used for databases and reportsSQL, report generators
5GLArtificial-intelligence languagesProblems solved by constraints and logic instead of algorithmsProlog, Mercury, OPS5
  • Each generation is easier to read and write than the previous one.
  • Higher generations are more portable but usually slower and give less control over hardware.
  • Programs written in 2GL and above must be translated to machine code before the computer can run them.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Programming chapter 1 questions →