Project 2

CS441-Programming Languages: Design Implementation

Due: November 17, 2003

 

Authors:

Email Addresses:

Desiree Shaw

Desiree Shaw

LaAisha Ettress

LaAisha Ettress

Amanda Oropeza

Amanda Oropeza

 

 

 

  

"Simple Procedural and Blocked Structured, Procedural"

 

1. History:

 

A blocked structure procedural language called Algol was developed in the mid 1960’s.  In 1971 Nicklaus Wirth developed a language called Pascal.  Pascal was developed as a successor of Algol.  Pascal language was known for the ability to grow and shrink during runtime and the ability to define new data types.  Pascal was taught in classrooms because of its great portable compilers and was even used as the official language of the Advanced Placement test.  Pascal is no longer used.

 Dennis Ritchie developed a simple procedural language called C in 1972.  C had a lot of power because it could be used to re-write Unix assembly language.  C was also used in many classrooms, but like most languages, it is no longer used.

 Both languages were taught in classrooms.  Both languages are not as popular as they use to be.  Pascal is no being used because a better language came, alone which was C, and C, is no longer used because of C++.

 

2.     Overview of languages

The block structure was mainly designed to be a teaching tool.  The information is considered to be readable and typically easier for a person to understand.  The block structure language Pascal uses algorithms to express what the program is doing.  The compiler is designed to diagnose an incopability of any type to a variable of another type.

 Simple procedural languages such as Assembler are considered to be easier to read also.  It uses symbolic code, and its flexibility comes from being able to read high and low level languages.  Simple procedural languages are generally used for development in different products such as computer games, automobiles, and telecommunication equipment….

 

3. Handling of Data Objects

 The best representative of Block Structured Procedural languages is Pascal.  Pascal is a strongly typed language. Most of the languages in the block structured procedural languages are strong typed. Integers, reals, characters, enumerations, Booleans, arrays, records and pointer types are data types used by block structured procedural languages. Block structured procedural allows the programmer to develop new types, but does not provide grouping and encapsulation with a set of subprograms for operating on new type data objects.  Simple procedural languages also use the same data types as block structured procedural languages like variables, ints, Booleans and etc.  Simple procedural language statements manipulate data that either is local to the procedure, a parameter passed in from the calling procedure, or defined globally. 

  

4. Handling of Sequence Control

 Simple procedural languages consist of a series of procedures that run as soon as they are called in a program.  Each procedure consists of a sequence of statements that are executed in a first processed fashion. This process makes the language very easy to follow in terms of understanding the code.  Block Structured procedural languages used standard static scope rules and nested program format characteristic of block structure. Meaning the language runs in sections or blocks. These blocks contain procedures that run on statements to be executed. This is different from the simple procedural that runs on whatever function is first.

 

5. Handling of subprograms and storage management.  

a.     Subprograms

Block structure program Pascal has subprograms called procedures.  Procedures communicate with the main program.  The main problem with Pascal is that you cannot write a subprogram that takes an array of variable length as a parameter.

With simple procedural language the code can be called any where within the program, but generally do not allow recursion.

b.     Storage Management

Block structural language Pascal there is no storage class and it must be visible and unique in a large scope. 

Simple procedural has four main areas where storage management is kept and they are:

                                                   i.      Global/Static

                                                 ii.      Stack/Local

                                                iii.      Heap/Dynamic

                                               iv.      Registers/Temporary

 

Each of these can be executed during read-write of the memory page. 

6. Handling of abstraction and encapsulation

Neither block structured procedural languages nor simple procedural languages handle abstraction and encapsulation as well as other language families.  Simple procedural languages programs must be able to locally access all aspects of the program. Block languages can declare internal local procedures and create a full nested name hierarchy of data objects.

 

 

"Simple Procedural and Object-Based."

 

1. History:  

C++ is an object-base language and was named in 1983 and developed by Bjarne Stroustrup at Bell Labs during 1983-1985.  C++ is a re-designment of C.  C++ has all of the features of C but also has new features, functions, and operator overloading.  C++ was developed for the Unix environment.

Dennis Ritchie developed a simple procedural language called C in 1972.  C had a lot of power because it could be used to re-write Unix assembly language.  C was also used in many classrooms, but like most languages, it is no longer used.

C language has been dominated by C++ that is being taught in classrooms today. Both languages use algorithms that are designed to resemble the English language.

 

2. Overview

C++ was implemented in 1984; its ancestor is the C language.  When C++ was developed it provided things that C did not such as, collection of predefined classes, inheritance, virtual classes, and over loading among other things.

Simple procedural languages such as Assembler are considered to be easier to read also.  It uses symbolic code, and its flexibility comes from being able to read high and low level languages.  Simple procedural languages are generally used for development in different products such as computer games, automobiles, and telecommunication equipment….  Both languages are considered to be easy to read.

 

3. Handling of Data Objects

Object Based languages contain the same data types as simple procedural like integers, variables, Booleans and etc. However unlike simple procedural object-based languages also have objects, classes, subclasses, and other advanced data types that allow the language to function globally instead of just locally like simple procedural.

 

4. Handling of Sequence Control

Object based languages have classes. These classes have inheritance properties. There can be a single or multiple inheritances. A single inheritance contains a subclass, which has one super class. Java is an example of a single inheritance. Multiple inheritances have a subclass with more than one super class. C++ is an example. Object based languages operate by having a parameter or function called. The language will run the function when it receives the instructions on how to run the function. The instructions for a function are contained in a class definition. The definition specifies the properties of an function. It includes instructions on how to execute the function and variables for the function. Simple procedural goes by a first defined first run procedure.

5. Handling of subprograms and storage management.

c.     Subprograms

Object-based subprograms in C++ have functions whose parameters are checked, they have to be declared before they can be used (called).

 With simple procedural language the code can be called any where within the program, but generally will not allow recursion.

 

d.     Storage Management

 

Object-based storage management with C++ is not that great because of the ability to allow memory leakage.

 Simple procedural has four main areas where storage management is kept and they are:

                                                   i.      Global/Static

                                                 ii.      Stack/Local

                                                iii.      Heap/Dynamic

                                               iv.      Registers/Temporary

 

Each of these can be executed during read-write of the memory page.

6. Handling of abstraction and encapsulation


Object based languages handle abstraction and encapsulation very well. Object based languages are able to control certain aspects of the language. The language employs the use of public and private class and function names.  Object oriented uses private capabilities to ensure certain definitions and executions are not shown to the outside code.  Private variables are shared by all instances of a defined class. Global variables are shared by all instances of all defined classes. Simple procedural languages only access locally.

 

"Simple Procedural & Logic"

 

1.HISTORY

 

FORTRAN is an example of a simple procedural language, and was the first high-level language. Developed in 1954 by John Backus at IBM and designed for use on their IBM 704 systems, released in 1957. All versions, including the latest, FORTRAN 95, were designed as “Formula Translators”. The idea was to emulate mathematical formulae in coding so that scientific applications could be written in a language that looked like math, and could be translated into machine language. Other examples include B, C, ALGOL and PL/I.

Logic Based programming languages came later, in the 1970’s. Of these languages, Prolog, after “Programming Logic”, was developed in France and England at the University of Aix-Marseille by Colmerauer and Rousselat, and at the University of Edinburgh by Kowalski. Here the plan was to develop a language that emulated predicate calculus. Applications include database management and Artificial Intelligence, and are limited in scope.

 

 

2.OVERVIEW

 

FORTRAN was remarkably efficient, and until its release, programmers did not believe that a high level language could be as efficient as hand coding. The three aspects: high level, compiled, and efficiency changed programming forever. All storage is allocated statically before program execution begins. Other Simple procedural languages share these characteristics, and other attributes.

Simple procedural languages feature a main program, and subprograms. Instructions are sequenced, and executed in order. They share block structure, recursion, and parameter passing by value and name. In this chart are some other characteristics of Procedural Languages.

Logic based programs are a stark contrast. Specific problems are solved using the truth or falsehood of the processes, rather than the computed value. This has been likened to using the logical components of the CPU, versus the arithmetic components. This strategy makes for very difficult and inefficient programming, but is well suited for applications in artificial intelligence that depend on decision making. Applications also include database management, expert systems, and processing of natural languages, again, where decision-making is more logic focused than mathematically computed.

 

 3.HANDLING OF DATA TYPES

 

Procedural languages have a variety of data types, as opposed to relatively few in logic-based languages. In Simple Procedural languages there are: integers, real, complex, Boolean, logical, character, strings, void, just to name a few.  In Logic Based there are less than Procedural which are: variables, atoms, and numbers.

Simple procedural languages have built in functions, usually in libraries, and a host of structures. Logic based languages have predicates, rules, and use databases to relate facts with each other. Structures are limited.

 

SEQUENCE CONTROL

Simple procedural languages were written with sequence control. They follow “Order of Operations” similar to rules for sequencing. Linear thinking was a design prerogative. Statements to aid this control are logical loops, CASE, DO and IF-THEN-ELSE. Goto and recursion are also supported, as well as built in function call & return.

Logic based languages use non-arithmetic expression forms, arithmetic expressions, pattern matching and back tracking to handle sequence control. CUT in Prolog is somewhat analogous to GOTO. A main feature of Prolog is the use of pattern matching to determine if a query is solved by a fact in the database or if the fact can be deduced using the rules in the database applied to other facts or rules.

 

4.HANDLING OF SUBPROGRAMS AND STORAGE MANAGEMENT

 

Sub programming is a vital part of the design of simple procedural languages. Subprograms have the feel of mathematical functions and can be nested, operated upon and composed. Pass by reference, name of value are built in. Libraries are provided with built in mathematical functions, and programmer defined functions are allowed. Static and dynamic memory allocation is allowed.

Logic based languages also allow dynamic memory allocation, but the similarity ends there. Sub programming is difficult, but may be included as function, which returns true or false.

 

5.HANDLING OF ABSTRACTION AND ENCAPSULATION

 

Abstract data types are not supported directly in simple procedural languages, and not supported at all in logic based languages. The use of modularization emulates abstraction and encapsulation. Simple procedural type languages emulate encapsulation with the use of subprograms. However, this method provides for poor encapsulation constructs. Prolog uses modules to implement encapsulation and abstraction.

 

 

 

 

 

Reference:

 

Authors:

Language Type:

Web Addresses:

Ahmad Ibrawish, Afrazuddin Mohannad,

Neal Bellamy,

Nghi Phan.

Simple Procedural

http://a.students.umkc.edu/atic9f,

http://a.students.umkc.edu/azm150,

http://n.students.umkc.edu/nlb477/index.html,

http://p.students.umkc.edu/phann/.

 

Brian Buckly, Ryan Johnson, Prasad Natoo,

Lisa Presson

Block Structre, Procedural

 

Andrew Lee,

Lei Zhu,

Nancy Schneider,

Sepideh Dehghani, Trung Nguyen

Object - Bases

 

 

Concepts of Programming Languages, Fifth Edition Sebesta, Robert W.

Addison-Wesley Publishing Company, Inc. 1999

 

http://www-4.ibm.com/software/ad/pli/about.htm

 

http://www.cs.bsu.edu/homepages/dmz/cs335/ppt/fortran_c/ppframe.htm

 

http://www.cs.bsu.edu/homepages/dmz/cs335/ppt/pascal/ppframe.htm