0% found this document useful (0 votes)
45 views

01-02-Language Design Issues

This document provides an overview of programming languages and their design. It discusses why programming languages are studied, how languages have developed over time to match different software architectures and paradigms, and important goals and attributes of language design. The document covers language paradigms like imperative, functional, logic-based, and object-oriented programming. It also discusses standardization and internationalization of programming languages.

Uploaded by

Gebru Gurmessa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

01-02-Language Design Issues

This document provides an overview of programming languages and their design. It discusses why programming languages are studied, how languages have developed over time to match different software architectures and paradigms, and important goals and attributes of language design. The document covers language paradigms like imperative, functional, logic-based, and object-oriented programming. It also discusses standardization and internationalization of programming languages.

Uploaded by

Gebru Gurmessa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

CHAPTER - 01

Programming Languages
Language Design Issues
Programming Languages
Language Design Issues
• Why study programming languages
• Language development
• Software architectures
• Design goals
• Attributes of a good programming language
• Language paradigms
• Standardization and internationalization
Why study programming
languages
• To improve your ability to develop effective
algorithms

• To improve your use of existing


programming languages

• To increase your vocabulary of useful


programming constructs
Why study programming
languages
• To allow a better choice of programming
language

• To make it easier to learn a new language

• To make it easier to design a new language


Language development
Numerically based languages
Computing mathematical expressions
FORTRAN, Algol, Pascal, PL/1, BASIC, C, C++
 

Business languages
COBOL (Common Business Oriented Language)
English-like notation
Language development
 Artificial intelligence languages
Tree search; Rule-based paradigm
LISP (LISt Processing)
PROLOG (PROgramming in LOGic)

System languages
C, C++
Script languages: AWK, Perl, TCL/TK
Web programming: HTML, XML, Java,
Microsoft *.NET family
Software architectures
Mainframe era
Batch processing (batches of files):
A program would take a set of data files as input and
produce a set of output files after processing.

Interactive processing (time sharing):


Computers were able to divide computation time amongst
all concurrent users, a process known as time share
Software architectures
Mainframe era
Effects on language design
•In batch processing environments, a terminated program
must be completely rerun, but termination is acceptable
•No external help from the user is possible
•No way to monitor or change the speed of execution
•In interactive environments, termination is usually not
acceptable.
Software architectures
Personal computers
 Interactive processing

Embedded system environments


•A computer system that controls a larger system such as a
plant, aircraft, machine, etc.
•Embedded system failure can be catastrophic
•Reliability and correctness are essential
•Ada, C, C++ used  
Software architectures
Personal computers
Effects on language design
•Performance is less of a concern in many domains
•User Interfaces (UI) and low prices lead to single-user
computers. No time share
•Users are used to windows-based UI, which can be hard to
program. OO makes it easy via libraries and packages.
Software architectures
Personal computers
Effects on language design
In regards to embedded systems,
•Programs must interact directly with device for I/O
•Access to devices provided via registers, memory locations,
subprograms
•All errors must be handled. Termination is not acceptable
•Embedded system must be able to work in real-time
•Often a distributed system
Software architectures
Networking era

Distributed Computing and Internet


Based on Client-server model of computing
Server: a program that provides information
Client - a program that requests information
LAN, FTP, SMTP
 
Software architectures
Networking era

Effects on language design


Interaction between the client and server programs
Active web pages, Security issues, Performance
Design Goals

During 1950s--1960s - Run-time considerations


Programmers are cheap, machines
expensive; Keep the machine busy

Today - program development time considerations


CPU power and memory are very cheap
Attributes of a good
language
• Conceptual integrity
• Orthogonality
• Naturalness for the application
• Support for abstraction
• Ease of program verification
• Programming environment
• Portability of programs
• Cost of use
Attributes of a good
language
Conceptual integrity
•The language must provide a framework for thinking about algorithms
•The language must provide a way to express ideas of algorithm
implementations
•Its concepts should be simple so they can be used in developing
algorithms
•The language should have a minimum number of concepts (conceptual
integrity)
•Language syntax determines ease of writing, reading, testing, modifying
code
Attributes of a good
language
Orthogonality
•This attribute of being able to combine various features with
all combinations of features.
•Ex: Language can evaluate expression to get boolean T/F.
Language also has conditionals based on T/F. If any
expression can be used/evaluated within a conditional
statement, these features are orthogonal.
– Orthogonal features makes a language easier to learn
– A negative aspect is that it may hide errors
Attributes of a good
language
Naturalness for the application
•Language syntax should allow the program structure to reflect the algorithm.
Examples of algorithms differing in structure are:
– sequential
– concurrent
– logic
•The language should provide the following tools for solving a problem:
– appropriate data structures
– appropriate operations
– appropriate control structures
– a natural syntax for the problem
Attributes of a good
language
Support for abstraction
•There is always a gap between abstract data
structures and primitive data structures.
•The language should allow data structures, data
types, and operations to be defined and maintained as
self-contained abstractions.
•Ada developed for lack of abstraction in Pascal, C++
for lack of abstraction in C
Attributes of a good
language
Ease of program verification
•Reliability of programs is a huge concern
•Methods of testing program correctness:
– formal verification
– desk checking
– testing via input data
Attributes of a good
language
Programming environment
•A weak language with a good environment can be easier
than a strong language
•Factors that influence the programming environment
include:
– reliable, efficient, well-documented implementation
– Special editors
– Special testing packages
– Version control
Attributes of a good
language
Portability of programs
•Transportability of the program to a computer which is
different from the computers on which is written
•A language's definition is independent of a particular
machine
•ADA, FORTRAN, C have standardized definitions for
portable application development
Attributes of a good
language
Cost of use
•Cost of program execution
•Cost of program translation
•Cost of program creation, testing, use
•Cost of program maintenance
Syntax and Semantic

• Syntax means by what the program looks like.


How statements, declarations, and other
language constructs are written.
• While semantics means by the meaning given
to the various syntactic constructs.
Language paradigms
• Imperative / procedural languages
• Applicative / functional languages
• Rule-based / declarative languages
• Object-oriented languages
Imperative / procedural languages

Statement oriented languages that


change machine state
(C, Pascal, FORTRAN, COBOL)

Computation: a sequence of machine


states (contents of memory)
Syntax: S1, S2, S3, ... where S1, S2, …
are statements
Applicative / functional languages

Programming consists of building the


function that computes the answer
Computation: Function composition is major
operation (ML, LISP)
Program develops by creating functions from previous functions
that manipulate the initial data set until the solution is achieved.

Syntax: P3(P2(P1(X)))
Rule-based / declarative
languages

Computation: Actions are specified by


rules that check for the presence of
certain enabling conditions. (Prolog)
The order of execution is determined
by the enabling conditions, not by the
order of the statements.
Syntax: Condition  Action
Object-oriented languages

Imperative languages that merge


applicative design with imperative
statements (Java, C++, Smalltalk)

Syntax: Set of objects (classes)


containing data (imperative concepts)
and methods (applicative concepts)
Language standardization

A concept of a programming language is


tied to an implementation of it
Ex: Can you move a C program to another
computer using a different compiler?
If you extend features of a language, is it
still that language?
Language standardization

The need for standards - to increase


portability of programs
Problem: When to standardize a language?
If too late - many incompatible versions
If too early - no experience with language
Problem: What happens with the software developed
before the standardization?
  Ideally, new standards have to be compatible
with older standards.
Language standardization

There are two types of standards:


Proprietary standards: definitions by the company

that developed and owns the language. This doesn't


work for widely used languages.
Consensus standards: Documents produced by

organizations on an agreement. Currently the major


method of ensuring uniformity.
Internationalization
I18N issue - How to specify languages
useful in a global economy?
• What character codes to use?
• Collating sequences? - How do you
alphabetize various languages?
• Dates? - What date is 10/12/01?
10-12-01? 12.10.01 ?
Is it a date in October or December?
Internationalization
• Time? - How do you handle
• time zones,
• summer time in Europe,
• daylight savings time in US,
• Southern hemisphere is 6 months out of phase
with northern hemisphere,
• the date to change from summer to standard
time is not consistent.
• Currency? - How to handle dollars, pounds,
marks, francs, euros, etc.
Programming environments
Programming environment:
the environment in which programs
are created and tested.
 
Programming environments
Effects on language design: 

Programming environments have


affected language design primarily in
two major areas:
1. Separate compilation & execution
2. Testing and Debugging
Programming environments

Effects on language design:


Modular organization
Local/global variables
Libraries
Programming environments
Process control languages
Scripting languages
• Usually interpreted,
• Able to process programs and data files
• Specify a sequence of operations on
program and data files.
Awk, Perl, Tcl/Tk
Summary

Language design must:


• Allow program solution to match
problem structure
• Allow for world-wide use
• Be easy to prove correctness of
solutions

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy