Add
questions, from this LM, to the FPE?
MAJOR
UPDATE: 12/8/99; LAST
UPDATE: 12/9/06
Currently under
REconstruction
This
is the most current version of Learning Module IX; however, the
FIB/SAQ/TPQ
tools have yet to be included.
Also
the study guide needs to be written (for the independent learner) and
some
of the content sections, links, and assessment tools need to be
fine-tuned.
(Nothing is wrong, just imperfect!)
Note
that the blinking text designates things that I need to work on; the
material
is not wrong, but can be improved.
(Don't
worry, I don't like blinking text, either, so there will not be any in
the finished product!)

LEARNING
MODULE
X:
SURVEY OF
PROGRAMMING
LANGUAGES
Computer languages are software (translators) that allow a user to
communicate
instructions to a computer system; in particular, computer
languages
allow the user to write application programs. Numerous
languages
have been developed to facilitate the translation of human algorithms
into
machine language programs that a computer can execute.
Independent
learners should read the objectives and sequence of presentations,
summary,
then the
Study
Guide for this learning module.
The
Objectives of this learning module are:
- introduce the basic
concepts
of computer programming languages,
- to distinguish the
characteristics
of, and illustrate the differences between, low level, high level, and
very high level programming languages,
- to distinguish
structured programming
languages and object oriented programming languages, and
- to survey the most
important
programming languages based on popularity and currency.
TPQ
1: Rewrite the preceding objectives in terms of personal
accomplishments
to be attained after finishing the study of this learning module.
The
sequence of presentations in this learning module is as follows.
You can click on any link to jump directly to that section.
- PROGRAMMING
LANGUAGE LEVELS
- COMPARISON
OF THE LANGUAGE LEVELS
- STRUCTURED
PROGRAMMING LANGUAGES
- OBJECT-ORIENTED
PROGRAMMING LANGUAGES
- SURVEY
OF POPULAR HIGH-LEVEL LANGUAGES
- SURVEY
OF SOME NEWER LANGUAGES
- SUMMARY
1.
PROGRAMMING LANGUAGE LEVELS:
Programming languages have two primary components (1) a set of built-in
language
primitives (words that represent data types, control structures,
modularization
constructs, etc. and symbols that represent math or logical operations)
that may be combined into programs and (2) a translator
(assemblers,
compilers, or interpreters) that transforms source code (written
in the programming language) into object code (machine language
equivalent). There are three (at least) categories of programming
languages:
1.1 Low Level Languages are
"computer
oriented":
- Low Level
Languages = computer
oriented languages, i.e. they directly manipulate hardware.
Each language is unique to the CPU on which it is implemented
and
is, therefore, not portable (i.e. not usable on a computer
with
a different CPU).
- There are two
categories of
low level languages:
- Machine
Language
(ML)=
binary, octal, hex, etc. code; non-binary code is translated into binary
code that is directly executable by the computer. Each instruction
corresponds to a machine operation, part of the instruction set
characteristic
of the CPU. Now machine language is virtually never used by
humans.
See the right hand column of
the table in section 2.
- Assembly
Language (AL)
= mnemonic (abbreviated English words) instructions with a one-to-one
correspondence with machine language instructions; translated into
ML by an assembler. Assembly language, being machine oriented,is faster
and more efficient in the use of hardware than HLL or
VHLL.
See the middle
column of the table in section 2.
1.2 High-level
Languages (HLL) are
"developer oriented", i.e. tools of
software developers:
- The words and
grammar
of HLL
are English-like. A HLL language is governed by a strict syntax
(set of grammatical rules); if this is standardized, the language is
portable (can be used on different computer systems).
- HLL reflect the
logic
and procedures
used in a human algorithm. Thus HLL programming is "task-oriented"
rather than "machine oriented"; the programmer is able to concentrate
on
developing task algorithms rather than on how the computer will carry
out
the instructions. However, the programmer must still specify a
complete
set of detailed instructions.C. HLL programs are translated into ML
by either compilers or interpreters. Most HLL
instructions
translate into multiple ML instructions.
- HLL have two
distinct
subcategories (different "paradigms"):
- Procedural
languages (imperative
paradigm),
by far the most common, require a complete algorithm to be specified.
- Such
languages typically use procedures to modularize programs, use loops
to implement repetition, and use arrays and records to build
more
advanced data structures.
- They are
typically used in sience and business applications.
- Examples include
Java, C, C++, C#, Pascal, Modula, Ada, etc.
- Functional languages
(declarative paradigm)
require that an operation be defined instead of its algorithm being
specified.
- They typically
use functions to modularize programs, recursion
to implement repetition, and use lists to build user-defined
data
structures. Lisp and Logo are examples of functional languages; Prolog
is an example of a relational language, a relative of
functional
languages.
- They are
typically used in artificial intelligence and expert systems
applications.
- Example include
Logo, Lisp, and Prolog.
1.3 Very
High-level
Languages (VHLL) are "human oriented":
VHLL are very new and are still evolutionary. Consequently there is
disagreement
over terminology at present. The text confuses VHLL with "4GLs" which
are,
according to conventional thinking, a subset of VHLL. Therefore, when
reading
the text, replace "4GL" with 'VHLL".
- VHLL are similar
to
HLL except
they are more sophisticated and easier to learn
and use
because many powerful primitives are built into the languages. One goal
of VHLL is to give nonprogrammers the ability to create simple
computer
applications.
- The translation
software
performs most of the details involved with handling information
processing
tasks. The commands require only that the programmer specify what tasks
are to be performed. This automation, however, removes a much control
from
the hands of the programmer.
- VHLL are "special
purpose
languages", (often associated with specific software packages like
a DBMS), and thus have have limited range of application, within which
they are very powerful. This power and ease of use must be balanced by
the sacrifices in control over the processing details and access to
computer
hardware. As long as the task fits the narrow capabilities of a VHLL,
coding
proceeds quickly and smoothly.
- There is little
standardization in
current VHLL (they are usually intimately associated to a particular
type
of hardware or software). This results in a lack of portability which
has restricted their current popularity. This is changing rapidly.
- Examples of VHLL:
- Forth
Generation
Languages
(4GLs) are VHLL associated with DBMS that facilitate the
manipulation
of the language in powerful, user-defined ways in order to develop management-oriented
applications. 4GL tools include:
- report
generators, such as
RPG,
- retrieval/update
languages such
as SQL (Rarely actually called a 4GL.)
- decision
support systems,
- graphics
generators, and
- application
generators that
facilitate custom-made applications within the domain of the DBMS.
- Authoring
systems are VHLL designed to allow nonprogrammers to create Multimedia
(text,
graphics, animation, audio, and video) applications. These have greater
potential for developing individualized learning system software. (For
more details see the presentation in COSC120.)
- Currently,
Hypertext Markup Language (HTML) is used to author World Wide
Web
pages.
- Extensible
Markup Language (XML), a platform-independent Web document
formatting
language, is an improvement on HTML. XML is "extensible" because,
unlike HTML, the ability to define new markup tags makes it virtually
unlimited
and self-defining.
- SMIL
(Synchronized
Multimedia Integration Language), pronounced "smile", was
designed to facilitate the definition
of and synchronization of streaming
multimedia elements (video, sound, still images)
- Virtual Reality
Modeling Language (VRML) is used to add
3D
environments to Web pages that can be "explored" and with which the
user can interacted; VRML can be "plugged into" HTML programs.
- Scripting
languages are
designed to help nonprogrammers customize applications or create simple
applications, e.g. JavaScript allows users to liven up their Web pages.
2.
COMPARISON OF THE LANGUAGE LEVELS:
- Comparison by Code
Format: The
following examples give the code for the simple assignment instruction,
Sum ¨ X + Y, i.e. adding the values in variables X and Y and then
storing
their sum in the variable Sum.
|
HLL
Instruction
(Pascal):
|
Equivalent
Assembly
Language Instructions:
|
Equivalent
Machine
Language Instructions (Hex; Binary):
|
| Sum := X + Y ; |
LDA A X |
B6 0300;
101101100000001100000000 |
|
ADD A Y |
BB 0301;
101110110000001100000001 |
|
STA A S |
B7 0302;
101101110000001100000010 |
- The Assembly
and
Machine
language instructions are:
- load the
accumulator
(A) with
the contents of X (only the machine language specifies the memory
location,
300),
- add the
contents
of Y
(301)
to the Contents of the accumulator, and
- store the
contents
of
the accumulator
at S (302).
- Note that ML
and
AL
have
instruction sets that are strictly CPU dependent; those in the
table
above are for the Motorola 6800 microprocessor. In the Intel 8080
instruction
set, where addition can only occur within registers (not the
accumulator),
the AL instructions would be:
LDA A X (Load the
accumulator
with the contents of X)
MOV B A (Move the contents
of the accumulator to register B)
LDA A Y (Load the
accumulator
with the contents of Y)
ADD B (Add the contents
of B to the contents the accumulator )
STA S (Store the contents
of the accumulator at S)
SAQ1:
In terms of percent, how much faster is the add instruction of the
Motorola
6800 than the Intel 8080?
- It is somewhat
surprising (and frustrating) to find the same instruction, in different
languages, is different, sometimes VERY different! Examples of
the
assignment statement
in other high level languages include:
Sum = X + Y; (Java, Javascript, C, C++, and all languages
based on standard C)
MAKE "Sum X + Y (Logo)
SAQ2:
(a) Why do you think there are so many different software development
languages and (b) why would the same instruction have different syntax?
3.
STRUCTURED
PROGRAMMING LANGUAGES:
According
to FOLDOC, "A structured programming language is
one in which a program may be broken down into blocks or procedures
which
can be written without detailed knowledge of the inner workings of
other
blocks, thus allowing a top-down design approach. For a
discussion
of structure programming see section
3 of LM IX, Software Development.
- Techniques
that impose a logical structure on the writing of a program.
- Large programs
are broken down into smaller modules
(called
procedures or functions).
- Algorithms
are defined in terms of three structured constructs:
- sequence,
the default execution is one instruction after another unless modified
by selection or repetition constructs,
- selection
(IF-THE-ELSE) allows a logical expression to select one of two
alternative
blocks of code to execute,
- repetition
(WHILE, or REPEAT-UNTIL loops or recursion) allows a logical expression
to govern the repetition of a block of code.
- To
make
programs more readable, each statement occupies only one line and
blocks
of code in selection or repetition blocks are indented.
- Structured
languages (e.g. Pascal and Ada) and
object
oriented languages (e.g. C++ and Java)
force
the programmer to write structured programs. However, unstructured
languages
such as older versions of FORTRAN,
COBOL and BASIC require discipline on the part of the programmer."
4.
OBJECT-ORIENTED PROGRAMMING LANGUAGES:
Object oriented programming languages allows software developers to
construct programs as if they are collections of self-contained
"components".
The fundamental component is the class which is a template from
which actual objects can be created (called
"instantiation").
The class (and consequently any object instantiated from it) are
completely
defined by the attributes that define its state and methods
that define its behaviour. For a discussion of OOP see section
4 of the Software Development learning module. Smalltalk
was the first purely object-oriented language, but object-oriented
extensions
have been added to many existing languages resulting in "hybrid"
languages
such as C++, Object Pascal, Ada 95, CLOS (object oriented Lisp), Object
Logo, Prolog++, etc. (Some of these are briefly described in the
following section.) Java, the fastest growing language in
popularity
(particularly for distributed systems like the Internet) is a purely
object
oriented programming language based on Smalltalk but with a syntax
similar
to C++. (See below.)
5.
SURVEY OF POPULAR HIGH-LEVEL LANGUAGES:
- FORTRAN
(1954-57): Stands
for FORmula TRANslation. First HLL programming language. Developed by
IBM.
Main use in science and engineering.
- COBOL
(1958-60): Stands
for COmmon Business Oriented Language. Developed by Department of
Defense
as a simple, standardized, portable language for writing business
programs
that are easily maintained.
- LISP (1956-62):
Stands
for LISt Processing. Developed at MIT to develop AI (Artificial
Intelligence)
programming. Still the dominant language for AI in the U.S.A.
Although
it is basically a functional language based on recursion,
several
dialects augment LISP with nonfunctional features.
- BASIC (1965) :
Stands
for Beginner's All-purpose Symbolic Instruction Code. Developed as an interpreted
language that was easy to learn and use. The relatively small and
inexpensive
interpreters and compilers caused it to be the language of choice
for
early microcomputers, most of which came "bundled" with BASIC. Visual
Basic is an object-oriented extension of BASIC that has a
user-friendly
GUI development system.
- Pascal (1971): Developed
by Nicholas Werth to facilitate teaching structured programming. The
standard teaching language world wide. Its success has resulted in its
being extended for use as a general purpose programming language,
something
for which it was not designed.
6.
SURVEY OF SOME NEWER LANGUAGES:
- Ada (1979) :
Ada, a very powerful,
complex language, was developed by the Department of Defense for general
purpose programming. Its sophisticated control structures and data
structures also make it ideal for embedded applications (e.g.
weapons
systems) and real-time applications. Ada 95 is a
superset
of Ada that incorporates OOP features.
- C (1974), C++,
and C#:
C, developed
for writing system software, is a "mid-level language" in that it has
AL
features and is more machine-oriented than HLL. Thus it can run faster
than typical HLL and is an alternative to hard-to-develop,
CPU-specific
assembly languages. It was very popular with professional software
developers, but has now been virtually replaced by C++, an extension of
the language that provides OOP facilities, thus producing a "hybrid
language".
Both C and C++ code can be very cryptic and hard to understand.
C# is the newest of this family of languages.
- Logo (1968,
1976): Logo
was developed at MIT, as a "user-friendly version of LISP, to
facilitate
learning math concepts. It has become the language of choice for
introducing
programming, via "turtle graphics", to elementary school children.
However its huge success at this has led to its underestimation as a
language
for other applications; in fact, many believed it is the most
underrated
of all programming languages. It is billed as a "complete learning
environment"
where exploration is the guiding principle.
- PROLOG (1970): Based
firmly on the principles of logic, it rivals LISP as the
language
of choice for AI programming. It has been chosen as the basic language
for the "Fifth Generation of Computers" being built by the
Japanese.
- HyperTalk(1987):
Hypertalkis
a VHLL contained within "Hypercard", Apple's object oriented
programming
environment that is called " a soft-ware erector set for non
programmers"
. Hypertalk is Apple's implementation of Hypermedia, a VHLL
language
concept for handling information in all forms (data, text, graphics,
animation,
audio, and video). It is billed as the "language for the rest of us"
in that it can be used by nonprogrammers to unleash the power of the
computer.
- Smalltalk
(1974-1980): Smalltalk
was the first purely object-oriented programming (OOP) language;
it extends the ideas of structured programming to more human
oriented
viewpoints involving objects which respond to messages
sent to them by the computer system under the direction of the user.
Many
say that Smalltalk is the prototype of the programming paradigm of the
future, OOP.
- Java (1991-today):
Java is a purely OO, procedural, HLL designed to facilitate reliable,
platform-independent, distributed processing. It has become "the"
development
language for Internet and intranet applications because Java "applets"
(special programs) can be called directly from HTML.
- Java is the the
language of choice for most computer science curricula, including that
at FSU.
- The reliability
goal
means it
was designed to be secure (hacker resistant) and robust
(bug
resistant); its platform-independence means it is independent of the
CPU
and OS on which it is used.
- JavaScript
is a
VHLL that
is a simplified version of Java, specifically designed to add scripts
(embedded programs) in HTML documents, especially to provide dynamic
capabilities
to Web pages; see HTML, below.
- Personally
I think that JavaScript is perhaps the best language for beginners to
learn; see the reasons
JavaScript is the best language to begin learning object oriented
software
developement (OOSD) in the Study Guide to LMVII of
COSC330.
JavaScript is very lenient about syntax,
compared
to many programming languages, which makes it more USER FRIENDLY
(especially for beginners),
- If
you are only interested
in learning JavaScript, click on the JavaScript
Thread of COSC330.
- Hypertext Markup
Language (HTML)
is the VHLL used to create Web pages. It is really only a
collection
of tags which, when incerted into regular text, tell a Web browser how
to:
- format text,
- incert an image,
video clip,
or sound into a Web page,
- link to another
location in
the page or another Web page, even on another computer (server) or
- link to other
programs written
in VRML, TVML, Java, JavaScript, or other languages.