Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
8Activity
0 of .
Results for:
No results containing your search query
P. 1
APL - Unit1 Lecture Notes

APL - Unit1 Lecture Notes

Ratings: (0)|Views: 346|Likes:
Published by Wayne Jones Jnr
Analysis of Programming Languages Lecture Notes 1
Analysis of Programming Languages Lecture Notes 1

More info:

Published by: Wayne Jones Jnr on Mar 27, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

02/05/2013

pdf

text

original

 
University of Technology, Jamaica
Faculty of Engineering and Computing
School of Computing & information Technology
 Course: Analysis of Programming LanguagesLecture:#1Group:BSCIT4/ EBSCIT4Topic:History and overview of programming languagesWHAT IS A PROGRAMMING LANGUAGE?
Any notation for the description of algorithms and data structures may be termed aProgramming Language.We will consider those that are implemented on a computer.Programming languages were invented to make machines easier to use. They thrive becausethey make problem easier to solveMachine computations are low level; full of details that have more to do with the inner workings of machine than with the computation is for.
 A programming language is a language that is intended for the expression of computer  programs and that is capable of expressing any computer program-[1]Machine language
is the native language of a computer; it is the notation to which thecomputer responds directly. The term
code
originally referred to machine language, althoughcode is now used more broadly to refer to any program text.Programming languages are designed to be both higher level and general purpose. Alanguage is higher level if it is independent of the underlying machine. A language is
 general  purpose
if it can be applied to a wide range of problems. For example,
Fortran
was initiallycreated for numerical computing,
Lisp
for artificial intelligence,
Simula
for simulations,
Prolog
for natural language processing.Are there differences among programming languages? By definition, any programminglanguage can be used to express any program, it follows that all programming languages areequally powerful—any program that can be written in one can be written in another. Westudy different programming languages because although it is possible to write any programin any programming language, it’s not equally easy to do so. Thus we will not be veryconcerned with the
theoretical 
 power of programming languages (they’re all the same).Rather we will concentrate on the
 practical 
power, as real tools used by real people[1].
Machine Language is Unintelligible
Programs in machine language are usually unintelligible at the lowest level, the most detailedlevel, since they consist only of 0s and1s.
Higher-Level Languages
Higher-level languages have replaced machine and assembly language in virtually all areasof programming, because they provide benefits like the following:
Readable familiar notations
Machine independence
Summarized by Felix Oluwole AkinladejoUpdated by Arnett B. Campbell January 2005
1
 
Availability of program libraries
Consistency checks during implementation that can detect errors
 Portability
is another term for machine independence; a language is
 portable
if programs inthe language can be run on different machines with little or no change.Originally written in assembly language, the UNIX operating system was rewritten in programming language C in 1973. Ritchie [1978] recounts the resulting benefits
REASONS FOR STUDYING PROGRAMMING LANGUAGES.
1.
To improve your ability to develop effective algorithms.
Many languages providefeatures, that when used properly, are of benefit to the programmer but, when usedimproperly, may waste large amounts of computer time or the programmer into time-consuming logical errors. 2.
To improve your use of your existing programming language.
By understanding howfeatures in your language are implemented, you greatly increase your ability to writeefficient programs.3.
To increase your vocabulary of useful programming constructs.
Language serves both as an aid and a constraint to thinking. People use language to express thought, but language also serves to structure how one thinks, to the extent that it is difficult tothink in ways that allow no direct expression in words.4.
To allow a better choice of programming language.
A knowledge of a variety of languages may allow the choice of just right language for a particular project, therebyreducing the required coding effort.5.
To make it easier to learn a new language.
A linguist, through a deep understandingof the underlying structure of natural languages, often can learn a new foreignlanguage more quickly than straggling novice who understand little of the structureeven of their native tongue.6.
To make it easier to design a new language.
Few programmers ever think of themselves as language designers, yet many applications are really a form of  programming language.
BRIEF HISTORY OF PROGRAMMING LANGUAGES.
Programming is difficult—almost as soon as the first computer was built; it became obviousthat programming was very difficult. The tasks we have attempted to accomplish withcomputers have grown rapidly in ambitiousness and size. Much of the difficulty of stemsfrom
complexity
, the necessity of dealing with many different details at one time. One of the primary tasks of programming languages is the conquest of this complexity.Programming early computers was especially difficult—although the problems addressed byearly computers were smaller than many of those now addressed, programming was still verydifficult. Part of the reason was that early computers had very little storage; few thousandwords were considered a large memory. Thus, compact code was a necessity, also the earlycomputers were very slow, and so it was important that programs be coded efficiently.Additionally, early computers were more complicated to program than the ones we arefamiliar with today.During the early years the following were invented:[1]
Many program design notations were developed—for example the von Neumannand Goldstine’s
 flow diagrams,
which developed into flowcharts that are still widelyused in the design of programs.
Floating point and indexing were simulated—floating point operations did notappear until the IBM 704 in 1953.
Pseudo code interpreters were invented—it was quickly recognized that consistentuse of the floating-point and indexing subroutines simplified the programming process; it allowed one to program as though these facilities were provided by the
Summarized by Felix Oluwole AkinladejoUpdated by Arnett B. Campbell January 2005
2
 
hardware of the computer. This led to the idea of a pseudo-code, that is, aninstruction code that is different from that provided by the machine—and presumably better. Since the program was going to spend most of its time in thefloating point and indexing subroutines anyway, why not simplify programming by providing an entire new instruction code that was easier to use than the machine’sown.
Compiling routines were used.The following are nineteen important programming language design principles [1]:1.The
automation
principle—automate mechanical, tedious, or error-prone activities.2.The
regularity
principle—regular rules, without exceptions, areeasier to learn, and implement.3.The
impossible error 
 principle—making errors impossible tocommit is preferable to detecting them after their commission.4.The
orthogonality
principle—independent functions should becontrolled by independent mechanisms.5.
 Abstraction— 
avoid requiring something to be stated more thanonce; factor out recurring patterns.6.
 Defense in depth— 
have a series of defenses so that if an error is not caught by one, it will probably be caught by another.7.
 Elegance— 
confine your attention to designs that look good because they are good.8.
 Information Hiding— 
the language should permit modulesdesigned so that (1) the user has all the information needed touse the module correctly, and nothing more; and (2) theimplementor has all the information needed to implement themodule correctly, and nothing more.9.
 Labeling— 
avoid arbitrary sequences more than a few itemslong. Do not require user to know the absolute position of anitem in a list. Instead, associate a meaningful label with eachitem and allow the items to occur in any order.10.
 Localized Cost— 
users should pay only for what they use; avoiddistributed costs.11.
Manifest Interface— 
all interfaces should be apparent(manifest) in the syntax.12.
 Portability— 
avoid features or facilities that are dependent on a particular computer or a small class of computers.13.
 Preservation of Information— 
the language should allow therepresentation of information that the user might know and thatthe compiler might need.14.
 Responsible Design— 
do not ask users what they want; find outwhat they need.15.
Security— 
no program that violates the definition of thelanguage, or its own intended structure, should escapedetection.16.
Simplicity— 
a language should be as simple as possible. Thereshould be a minimum number of concepts, with simple rulesfor their combinations.17.
Structure— 
the static structure of the program shouldcorrespond in a simple way to the dynamic structure of thecorresponding computations.18.
Syntactic Consistency— 
similar things should look similar,different things different.19.
 Zero-One-Infinity— 
the only reasonable numbers are zero, one,and infinity.
Caveat:
design principles must be applied flexibly
orthogonality may be inappropriate.
Summarized by Felix Oluwole AkinladejoUpdated by Arnett B. Campbell January 2005
3

Activity (8)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
CHANDRA BHUSHAN liked this
gladwel liked this
prabajaya liked this
bdharaskar liked this
ialwinps liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->