Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views

Programming Language 01 - 02

Uploaded by

Cobe Bryn Lopez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Programming Language 01 - 02

Uploaded by

Cobe Bryn Lopez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

IT2009

Introduction to Programming Languages


Programming Language
It is used for communicating instructions to a computer. It is designed to facilitate certain operations such as
numerical computation, text manipulation, or input/output.

Reasons for Studying Concepts of Programming Languages


• Increased capacity to express ideas
• Improved background for choosing appropriate language
• Increased ability to learn new languages
• Better understanding of the significance of implementation
• Better use of languages that are already known
• Overall advancement of computing
Programming Domains
• Scientific Applications
• Business Applications
• Artificial Intelligence
• Systems Programming
• Web Software

Language Evaluation Criteria


• Readability – the ease with which programs can be read or understood
• Writability – how easily a language can be used to create programs
• Reliability – if a program performs to its specifications under all conditions
• Cost
Characteristics that Affect Readability
• Overall Simplicity: A language with a large number of basic constructs is more difficult to learn than
one with a smaller number.
• Orthogonality – means that a relatively small set of primitive constructs can be combined in a
relatively small number of ways to build the control and data structures of the language
• Data Types
• Syntax Design
o Special Words
o Form and Meaning
Characteristics that Affect Writability
• Simplicity and Orthogonality
• Support for Abstraction: Abstraction is the ability to define and then use complicated structures or
operations in ways that allow many of the details to be ignored.
o Process (Ex. The use of a subprogram to implement a sort algorithm that is required several
times in a program
o Data (Ex. A binary tree that stores integer data in its nodes can be implemented using an
abstraction of a tree node in the form of a simple class with two pointers and an integer
• Expressivity – means that a language has relatively convenient ways of specifying computation.
Characteristics that Affect Reliability
• Type Checking – testing for type errors in a given program, either by the compiler or during program
execution
• Exception Handling – the ability of a program to intercept run-time errors (as well as other unusual
• conditions detectable by the program), take corrective measures, and then continue
• Aliasing – having two or more distinct names that can be used to access the same memory cell
• Readability and Writability

01 Handout 1 *Property of STI


Page 1 of 5
IT2009

Language Evaluation Criteria


Source: Sebesta, 2012
Influences on Language Design
• Computer Architecture

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.

The von Neumann Architecture


Source: Sebesta, 2012
• Programming Design Methodologies: The evolutionary steps in software development methodologies
led to new language constructs to support them. The most familiar design methodologies are
procedural and object-oriented programming.

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

• Examples: Algol, Cobol, PL1, Ada, C, Modula-3

01 Handout 1 *Property of STI


Page 3 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 – programs are translated into machine language

01 Handout 1 *Property of STI


Page 4 of 5
IT2009

Compilation
Source: Sebesta, 2012

• Pure Interpretation – programs are interpreted by another program called interpreter, without
translation

Pure Interpretation
Source: Sebesta, 2012

01 Handout 1 *Property of STI


Page 5 of 5
IT2009

• Hybrid Implementation Systems – the combination of compilation and interpretation

Hybrid Implementation Systems


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

Evolution of the Major Programming Languages


Early Languages
• Plankalkül
• Pseudocodes
• IBM 704 and Fortran
• COBOL
• LISP
• Prolog

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

IBM 704 and Fortran


• The capabilities of IBM 704 prompted the development of Fortran (derived from Formula Translation).
• Fortran is a general-purpose imperative programming language created for numeric computation and
scientific computing.
• Fortran versions: Fortran I, Fortran II, Fortran III, IBM 1401 Fortran, Fortran IV, Fortran 66, Fortran 77,
Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008
• Fortran’s environment was developed based on the following ideas:
o Computers had small memories and were slow and relatively unreliable.
o The primary use of computers was for scientific computations.
o There were no existing efficient and effective way to program computers.
o Because of the high cost of computers compared to the cost of programmers, the speed of
the generated object code was the primary goal of the first Fortran compilers.

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

02 Handout 1 *Property of STI


Page 1 of 5
IT2009

• 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

02 Handout 1 *Property of STI


Page 2 of 5
IT2009

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.

02 Handout 1 *Property of STI


Page 3 of 5
IT2009

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.

02 Handout 1 *Property of STI


Page 4 of 5
IT2009

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

02 Handout 1 *Property of STI


Page 5 of 5

You might also like