UT Dallas CS 4337 - #Sebesta ch01 - rev1 short (28 pages)

Previewing pages 1, 2, 3, 26, 27, 28 of 28 page document View the full content.
View Full Document

#Sebesta ch01 - rev1 short



Previewing pages 1, 2, 3, 26, 27, 28 of actual document.

View the full content.
View Full Document
View Full Document

#Sebesta ch01 - rev1 short

92 views


Pages:
28
School:
University of Texas at Dallas
Course:
Cs 4337 - Organization of Programming Languages
Unformatted text preview:

Chapter 1 Preliminaries Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved background for choosing appropriate languages Increased ability to learn new languages Better understanding of significance of implementation Better use of languages that are already known Overall advancement of computing Copyright 2012 Addison Wesley All rights reserved 1 2 Programming Domains Scientific applications Large numbers of floating point computations use of arrays Fortran Business applications Produce reports use decimal numbers and characters COBOL Artificial intelligence Symbols rather than numbers manipulated use of linked lists LISP Systems programming Need efficiency because of continuous use C Web Software Eclectic collection of languages markup e g HTML scripting e g PHP general purpose e g Java Copyright 2012 Addison Wesley All rights reserved 1 3 Language Evaluation Criteria Readability the ease with which programs can be read and understood Writability the ease with which a language can be used to create programs Reliability conformance to specifications i e performs to its specifications Cost the ultimate total cost Copyright 2012 Addison Wesley All rights reserved 1 4 Evaluation Criteria Readability Overall simplicity A manageable set of features and constructs Minimal feature and Minimal operator overloading Easy to read a program to understand and maintain Orthogonality A relatively small set of primitive constructs can be combined in a relatively small number of ways Every possible combination is legal Keywords 32 for C 63 for C 50 for Java 112 reserved words plus 120 keywords for Oracle Data types Adequate predefined data types Syntax considerations Identifier forms flexible composition Special words and methods of forming compound statements Form and meaning self descriptive or meaningful keywords Copyright 2012 Addison Wesley All rights reserved 1 5 Evaluation Criteria Writability Simplicity and orthogonality Few constructs a small number of primitives a small set of rules for combining them Easy to remember and easy to use To reduce chance of misspelling or typo in programming Support for abstraction The ability to define and use complex structures or operations in ways that allow details to be ignored Expressivity A set of relatively convenient ways of specifying operations e g dot notation a b c Strength and number of operators and predefined functions e g to add various mixed type numbers Copyright 2012 Addison Wesley All rights reserved 1 6 Evaluation Criteria Reliability Type checking Testing for type errors Exception handling Intercept run time errors and take corrective measures Aliasing Presence of two or more distinct referencing methods for the same memory location Readability and writability A language that does not support natural ways of expressing an algorithm will require the use of unnatural approaches and hence reduced reliability Copyright 2012 Addison Wesley All rights reserved 1 7 Evaluation Criteria Cost Training programmers to use the language Writing programs Compiling programs Testing programs Executing programs Maintaining programs Availability of free compilers Reliability poor reliability leads to high costs Copyright 2012 Addison Wesley All rights reserved 1 8 Evaluation Criteria Others Portability The ease with which programs can be moved from one implementation to another C Unix system Java JVM platform independent Generality The applicability to a wide range of applications Cobol Fortran C SAS or SPSS Java Perl Python Well definedness The completeness and precision of the language s official definition Copyright 2012 Addison Wesley All rights reserved 1 9 Influences on Language Design Computer Architecture Languages are developed around the prevalent computer architecture known as the von Neumann architecture Program Design Methodologies New software development methodologies e g object oriented software development led to new programming paradigms and by extension new programming languages C and Java Copyright 2012 Addison Wesley All rights reserved 1 10 Computer Architecture Influence Well known computer architecture Von Neumann Imperative languages most dominant because of von Neumann computers Data and programs stored in memory Memory is separate from CPU Instructions and data are piped from memory to CPU Basis for imperative languages Variables model memory cells Assignment statements model piping Iteration is efficient and easy to understand Copyright 2012 Addison Wesley All rights reserved 1 11 The von Neumann Architecture Copyright 2012 Addison Wesley All rights reserved 1 12 The von Neumann Architecture Fetch execute cycle on a von Neumann architecture computer initialize the program counter repeat forever fetch the instruction pointed by the counter increment the counter decode the instruction execute the instruction end repeat Copyright 2012 Addison Wesley All rights reserved 1 13 Programming Methodologies Influences 1950s and early 1960s Simple applications worry about machine efficiency Late 1960s People efficiency became important readability better control structures structured programming top down design and step wise refinement Late 1970s Process oriented to data oriented data abstraction Middle 1980s Object oriented programming Data abstraction inheritance polymorphism Copyright 2012 Addison Wesley All rights reserved 1 14 Language Categories 1 Imperative including OOP Central features are variables assignment statements and iteration Include languages that support object oriented programming Include scripting languages and the visual languages Examples C Java Perl JavaScript Visual BASIC NET C 2 Functional Main means of making computations is by applying functions to given parameters Examples LISP Scheme ML F 3 Logic Rule based rules are specified in no particular order 1 st order logic Example Prolog 4 Answer Set Programming Markup programming hybrid Markup languages extended to support some programming Examples JSTL XSLT extending HTML XHTML XML Copyright 2012 Addison Wesley All rights reserved 1 15 Language Design Trade Offs Reliability vs Cost of Execution Example Java demands all references to array elements be checked for proper indexing which leads to increased execution costs Readability vs Writability Expressiveness Example APL or MathLab provides many powerful operators and a large number of new symbols allowing complex computations to be written in a compact program


View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view #Sebesta ch01 - rev1 short and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view #Sebesta ch01 - rev1 short and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?