Programming Language 01 - 02
Programming Language 01 - 02
Most of the popular languages of the past 50 years have been designed around the prevalent
computer architecture, called the von Neumann architecture, after one of its originators, John von
Neumann (pronounced “von Noyman”). These languages are called imperative languages.
Language Categories
• Imperative Language
• Functional Language
• Logic language
• Object-Oriented Language
Imperative Language
• Based on commands that update variables in storage
• Provides statements such as assignment statements, which explicitly change the state of the memory
of the computer
01 Handout 1 *Property of STI
Page 2 of 5
IT2009
Functional Language
• Expresses computations as the evaluation of mathematical functions
• Treats values as single entities
• Values are never modified.
• Their computations are performed largely by applying functions to values.
• Examples: Lisp, Haskell, ML, Miranda, APL
Logic Language
• Expresses computations in exclusively in terms of mathematical logic
• Focuses on predicate logic, on which the basic concept is a relation
• Useful for expressing problems where it is not obvious what the functions should be
• Example: Prolog
Object-Oriented Language
• The fundamental of OOP was characterized by Alan Kay as follows:
o Everything is modeled as an object.
o Computation is performed by message passing.
o Objects communicate with one another via message passing.
o Every object is an instance of a class where the class represents a group of similar objects.
o Inheritance defines the relationships between classes.
Language Categories
Source: Sebesta, 2012
Implementation Methods
Compilation
Source: Sebesta, 2012
• Pure Interpretation – programs are interpreted by another program called interpreter, without
translation
Pure Interpretation
Source: Sebesta, 2012
Programming Environment
• A collection of tools used in software development
• May consist of a file system, a text editor, a linker, and a compiler
• May also include a large collection of integrated tools
• Examples: UNIX, JBuilder, Microsoft Visual Studio .NET, NetBeans
References:
Sebesta, Robert W. (2012). Concepts of Programming Languages. 10th ed. USA: Pearson Education, Inc.
Ben-Ari, Mordechai (2006). Understanding Programming Languages. Chichester: John Wiley & Sons, Inc.
Tucker, Allan B. and Noonan, Robert E. (2002). Programming Languages: Principles and Paradigms. 2nd ed.
New York: Mc-Graw Hill
01 Handout 1 *Property of STI
Page 6 of 5
IT2009
Plankalkül
• Means program calculus
• Developed by Konrad Zuse
• Includes mathematical expressions showing the relationships between program variables
Pseudocodes
• Have their own interpretative system for execution
• Were implemented through compiling routines
• Notable pseudocodes: Short Code (see figure), Speedcoding, The UNIVAC “Compiling” System
COBOL
• Stands for Common Business Oriented Language
• Developed by CODASYL Committee (Conference on Data System Languages) in 1960
• Designed for developing business, typically file-oriented applications
• Not designed for writing systems programs
• Characteristics:
o Self-documenting
o Non-proprietary
o Maintainable
LISP
• Stands for List Processor
• Developed by John McCarthy in the 1950s
• First functional programming language that was intended to provide language features for list
processing
• Used in applications for artificial intelligence
• 2 Dialects of LISP: Scheme and Common LISP
• Significant Features:
o 2 Types of Data Structures:
Atoms – similar to identifiers, but can also be numeric constants
Lists – can be lists of atoms, lists, or any combination of the two
o Functional Programming Style: All computations are performed by applying functions to
arguments.
o Uniform Representation of Data and Code
Example: the list (A B C D)
o Reliance on Recursion
o Garbage Collection
Scheme
• Emerged in the mid-1970s
• Invented by Guy Lewis Steele Jr. and Gerald Jay Sussman
• Characterized by its small size, its treatment of functions as first-class entities, and its exclusive use of
static scoping
• Static Scoping (Lexical Scoping) – a convention used with many programming languages that set the
scope (range of functionality) of a variable so that it may only be referenced from within the block of
code in which it is defined
Common LISP
• Developed in the early 1980s
• Designed by combining the features of several dialects of LISP
• Allows both static scoping and dynamic scoping
• Dynamic scoping – creates variables that can be called from outside the block of code in which they
are defined
Prolog
• Derived from Programming Logic
• Designed by Alain Colmerauer, Phillippe Roussel, and Robert Kowalski in the early 1970s
• Prolog programs consist of collections of statements.
• The primary components are:
o A method for specifying predicate calculus propositions
o An implementation of a restricted form of resolution
ALGOL-Based Languages
• ALGOL
• BASIC
• PL/I
• Pascal
• C
• Ada
ALGOL
• Derived from Algorithmic Language
• Originally developed in the mid-1950s
• Designed specifically for programming scientific computations
• 3 Major Specifications: ALGOL 58, ALGOL 60, and ALGOL 68
• Characteristics: Block Structure, Parameter Passing, Structured Control Statements, Recursion,
Dynamic Arrays, Reserved Words, User-defined Data Types
BASIC
• Stands for Beginner’s All Purpose Symbolic Instruction Code
• Originally designed as a teaching language by John Kemeny and Thomas Kurtz in the early 1960s
• Described as easy to learn, especially for the non-science oriented individuals
• Can be implemented on computers with small memory capacity
• First widely used language that was used through terminals connected to a remote computer
PL/I
• Derived from Programming Language I
• Introduced by IBM in the 1960s
• Represents the first large-scale attempt to design a language that could be used for various application
areas
• Included what were then considered the best parts of ALGOL 60 (recursion and block structure),
Fortran IV (separate compilation with communication through global data, and COBOL 60 (data
structures, I/O, report-generating facilities)
• The first programming language to have the following facilities:
o Programs were allowed to create concurrently executing subprograms.
o It was possible to detect and handle 23 different types of exceptions or runtime errors.
o Subprograms were allowed to be used recursively, but the capability could be disabled,
allowing more efficient linkage for non-recursive subprograms.
o Pointers were included as data type.
o Cross-sections of arrays could be referenced. For example, the third row of a matrix could be
referenced as if it were a single-dimensioned array.
Pascal
• Designed in 1970 by Niklaus Wirth
• Named after Blaise Pascal
• Has been most useful as a teaching tool
• Used as a beginner’s programming language
• By the mid-1970s, it was the most widely used language for instruction.
C
• Originally developed by Dennis Ritchie in 1972
• Designed for systems programming
• Implemented in the UNIX operating system
• Has adequate control statements and data-structuring facilities to allow its use in many application
areas
• Has a rich set of operators that provide a high degree of expressiveness
Ada
• Developed for the US Department of Defense in the 1970s
• Derived from Augusta Ada Byron
• Improves code safety and maintainability by using the compiler to find errors in favor of runtime errors
• 4 Major Contributions:
o Packages in the Ada language provide the means for encapsulating data objects, specifications
for data types, and procedures.
o It includes extensive facilities for exception handling.
o Program units can be generic in Ada.
o It provides for concurrent execution of special program units, named tasks, using rendezvous
mechanism.
Object-Oriented Languages
• Smalltalk
• C++
o Objective-C
o Delphi
o Go
• Visual Basic
• Java
• C#
Smalltalk
• Designed by Alan Kay and his team in the early 1970s
• The first programming language that fully supported object-oriented programming
• Its syntax makes use of messages, rather than arithmetic and logical expressions and conventional
control statements.
C++
• Designed by Bjarne Stroustrup in the 1980s as an evolution of the C programming language
• Has both functions and methods which enable it to support both procedural and object-oriented
programming
• Operators and methods can be overloaded.
• Supports multiple inheritance
• Includes exception handling (hardware-detectable exceptions cannot be handled)
• Languages related to C++:
o Objective-C
Designed by Brad Cox and Tom Love in the early 1980s
The only one to use the Smalltalk syntax among the programming languages that were
created by adding support for object-oriented programming to an imperative
language
o Delphi
First appeared in 1995
Designed by Anders Hejlsberg (Turbo Pascal developer)
Created by adding object-oriented support to Pascal
Less complex than C++ since it does not allow user-defined operator overloading,
generic subprograms, and parameterized classes
o Go
Designed by Rob Pike, Ken Thompson, and Robert Griesemer at Google in 2007
Created to address the slowness of compilation of large C++ programs at Google
Borrowed some of its syntax and constructs from C
Some of the new features are:
• Data declarations are syntactically reversed from the other C-based
languages.
• Variables precede the type name.
• Variable declarations can be given a type by inference if the variable is given
an initial value.
• Functions can return multiple values.
Visual Basic
• Designed by Bjarne Stroustrup in the 1980s as an evolution of the C programming language
• Event-driven programming language and Integrated Development Environment (IDE) from Microsoft
• Engineered for productively building type-safe and object-oriented applications
• Enables developers to target Windows, Web, and mobile devices
• The drag-and-drop design for creating the UI is derived from a prototype form generator developed
by Alan Cooper and his company called Tripod.
Java
• Initially developed in the mid of 1990s to address the need for a programming language for consumer
electronic devices
• Became prevalent in the online world with the emergence of the World Wide Web
• Increased the level of interactions between the user and the application
• Can bring interest to Web pages through applications that can give the user immediate feedback and
accept user input continuously through mouse or keyboard entries
• Some features of Java are:
o It is a platform-independent language.
o It enhances interaction of clients (browsers) on the World Wide Web.
o It moves processing to the client and off the server.
o It is used to develop scalable Internet applications.
o Its specification is publicly available.
o It enables new forms of software distribution and upgrades.
C#
• Announced by Microsoft in 2000 and released in January 2002
• Based on C++ and Java but includes some ideas from Delphi and Visual Basic
• Design team is headed by Anders Hejlsberg (designed Turbo Pascal and Delphi).
• Its purpose is to provide a language for component-based software development, specifically for such
development in the .NET Framework.
References:
Sebesta, Robert W. (2012). Concepts of Programming Languages. 10th ed. USA: Pearson Education, Inc.
Ben-Ari, Mordechai (2006). Understanding Programming Languages. Chichester: John Wiley & Sons, Inc.
Tucker, Allan B. and Noonan, Robert E. (2002). Programming Languages: Principles and Paradigms. 2nd ed.
New York: Mc-Graw Hill