Lect 1
Lect 1
University of Zimbabwe
Facilitator: G. Mhlanga
+263713319506
14/09/2023
Programming Languages
What is a computer program?
A set of instructions on how to execute a task
Task executed by computer
Programming language is a way to instruct a computer
Year Activity
1883 First programming language developed by Ada Lovelace and Charles Babbage working together on the
Analytical Engine
1958 Algol was created as an algorithmic language. Later used as a precursor to languages like Java and C
1959 COBOL created by Dr. Grace Murray Hopper
1959 Lisp created by John McCarthy for use in artificial intelligence and research
1964 BASIC created by John G Kemmeny and Thomas Kurtz for students without a technical background
1970 Niklaus Wirth developed Pascal
1972 SQL developed for IBM by Donald Chamberlin and Raymond Boyce
1978 MATLAB developed by Cleve Moler for writing math programs
1983 Brad Cox and Tom Love created Objective-C
1983 Bjarne Stroustrup created C++
1987 Perl was develop by Larry Wall as a scripting language
History of prog languages (cont’d)
1990 Haskell was developed as a functional programming language
1991 Python developed by Guido Van Rossum
1991 Visual Basic developed by Microsoft which introduced the drag-and-drop
concept
1993 Ross Ihaka and Robert Gentleman developed R for statisticians
1995 Java developed by Sun Microsystems, originally intended to run on hand-held
devices
1995 Rasmus Lerdorf developed PHP for web development
1995 Yukihiro Matsumoto developed Ruby as an all-purpose programming language
1995 Brendan Eich developed JavaScript to enhance web browser interactions
2000 C# developed by Microsoft, combining features from C# and Java
2003 Martin Odersky created Scala
2003 James Strachan and Bob McWhirter developed Groovy as an offshoot of Java
2009 Google developed Go
2014 Apple developed Swift
Categories of programming languages
1. Low-level languages
Provides no abstraction from the hardware.
Represented by 0s and 1s.
Languages under this category are machine language and assembly
language
Low-level High-level
Represented in 0s and 1s, understood User-friendly, written in simple English
by machine (machine-friendly) words
Code Generation
Target Program
Phases of the compiler
Lexical Analysis
phase is the first phase of compilation process.
takes source code as input.
reads the source program one character at a time and
converts it into meaningful lexemes.
Lexical analyzer represents these lexemes in the form of
tokens.
Phases of the compiler (cont’d)
Syntax Analysis
second phase of compilation process.
takes tokens as input and generates a parse tree as
output.
the parser checks that the expression made by the tokens
is syntactically correct or not.
Phases of the compiler (cont’d)
Semantic Analysis
the third phase of compilation process.
checks whether the parse tree follows the rules of
language.
Semantic analyzer keeps track of identifiers, their types
and expressions.
output of semantic analysis phase is the annotated tree
syntax.
Phases of the compiler (cont’d)
Code Optimization
Code optimization is an optional phase.
used to improve the intermediate code so that the output
of the program could run faster and take less space.
It removes the unnecessary lines of the code and arranges
the sequence of statements in order to speed up the
program execution.
Phases of the compiler (cont’d)
Code Generation
the final stage of the compilation process.
takes the optimized intermediate code as input and maps
it to the target machine language.
Code generator translates the intermediate code into the
machine code of the specified computer.
Textbook and Resources:
Programming Language Pragmatics, third edition, Michael L. Scott, 2015.
Morgan Kaufmann Publishers, ISBN 978-0-12-374514-9. The book is available
as an online resource from the library.