Free mock test
Programming Languages and Translators

Programming Languages and Translators

Software and Operating Systems · 2 min read

Generations of languages

GenerationLevelFacts
1GLMachine languageOnly 0s and 1s. The only language the CPU understands directly. Fastest, hardest.
2GLAssembly languageUses mnemonics (ADD, MOV). Needs an assembler.
3GLHigh-level languagesEnglish-like. C, C++, Java, Python, FORTRAN, COBOL, BASIC, Pascal. Needs a compiler or interpreter.
4GLVery high-levelSQL, report generators. You say what is needed, not how.
5GLAI-basedProlog, Mercury. Problem solving by constraints.

Language translators

TranslatorHow it works
AssemblerAssembly language → machine code.
CompilerTranslates the whole program at once into object code. Shows all errors together. Program then runs fast. Example: C, C++, Java (to bytecode).
InterpreterTranslates and runs one line at a time. Stops at the first error. Easier to debug, slower to run. Example: Python, BASIC.
LinkerJoins object files and libraries into one executable.
LoaderLoads the executable into memory to run.

Flow: Source code → (Compiler) → Object code → (Linker) → Executable file.

Types of errors

  • Syntax error: breaks the rules of the language (missing semicolon). Caught at compile time.
  • Logical error: program runs but gives a wrong answer. Hardest to find.
  • Runtime error: occurs while running (divide by zero).

Object-Oriented Programming (OOP)

Languages: C++, Java, Python. Four pillars: Encapsulation (data and methods bound in a class), Abstraction (hide detail, show the essentials), Inheritance (a class gets features of another), Polymorphism (one name, many forms). A class is a blueprint; an object is an instance of it.

Who made what

LanguageCreator
FORTRAN (1957)John Backus at IBM. First widely used high-level language.
COBOLBusiness language. Grace Hopper played a key role.
BASICKemeny and Kurtz
PascalNiklaus Wirth
C (1972)Dennis Ritchie at Bell Labs
C++Bjarne Stroustrup
Java (1995)James Gosling at Sun Microsystems
PythonGuido van Rossum

Keep practising

Notes are only half the work. Test yourself with questions and discuss doubts with other aspirants.

Prepared for exam revision from standard computer textbooks, Microsoft documentation and official sources. Features differ between Excel and Word versions (2016, 2019, 2021, 365) so check which version your exam follows. Found a mistake? Tell us.