Download presentation
Presentation is loading. Please wait.
1
Overview of Programming Languages
Prof. Steven A. Demurjian Computer Science & Engineering Department The University of Connecticut 371 Fairfield Way, Box U-255 Storrs, CT (860) 486–4818 (Office) (860) (CSE Office)
2
Overview Review the History of Programming Languages
High level View –Trees and Graphs Chapter 2 of Concepts of Programming Languages Evolution of the Major Programming Languages Fortran, Lisp, ALGOL 60, COBOL, Basic PL/I, APL,SNOBOL, SIMULA 67, ALGOL 68 Prolog, Ada, Smalltalk, C++, Java, C# Scripting & Markup/Programming Hybrid Languages Excerpts from Potted History of Programming Languages (Vitaly Shmatikov) Ethics in Programming Languages Programming Languages Steve Learned
3
Tree of Languages
4
https://www. google. com/url
5
https://griffsgraphs. wordpress
7
Evolution of the Major Programming Languages
Chapter 2 Evolution of the Major Programming Languages
8
Copyright © 2015 Pearson. All rights reserved.
Chapter 2 Topics Zuse’s Plankalkül Minimal Hardware Programming: Pseudocodes The IBM 704 and Fortran Functional Programming: Lisp The First Step Toward Sophistication: ALGOL 60 Computerizing Business Records: COBOL The Beginnings of Timesharing: Basic Copyright © 2015 Pearson. All rights reserved.
9
Chapter 2 Topics (continued)
Everything for Everybody: PL/I Two Early Dynamic Languages: APL and SNOBOL The Beginnings of Data Abstraction: SIMULA 67 Orthogonal Design: ALGOL 68 Some Early Descendants of the ALGOLs Programming Based on Logic: Prolog History's Largest Design Effort: Ada Copyright © 2015 Pearson. All rights reserved.
10
Chapter 2 Topics (continued)
Object-Oriented Programming: Smalltalk Combining Imperative ad Object-Oriented Features: C++ An Imperative-Based Object-Oriented Language: Java Scripting Languages The Flagship .NET Language: C# Markup/Programming Hybrid Languages Copyright © 2015 Pearson. All rights reserved.
11
Genealogy of Common Languages
Copyright © 2015 Pearson. All rights reserved.
12
Copyright © 2015 Pearson. All rights reserved.
Zuse’s Plankalkül Designed in 1945, but not published until 1972 Never implemented Advanced data structures floating point, arrays, records Invariants Copyright © 2015 Pearson. All rights reserved.
13
Copyright © 2015 Pearson. All rights reserved.
Plankalkül Syntax An assignment statement to assign the expression A[4] + 1 to A[5] | A + 1 => A V | (subscripts) S | 1.n n (data types) Copyright © 2015 Pearson. All rights reserved.
14
Minimal Hardware Programming: Pseudocodes
What was wrong with using machine code? Poor readability Poor modifiability Expression coding was tedious Machine deficiencies--no indexing or floating point Copyright © 2015 Pearson. All rights reserved.
15
Pseudocodes: Short Code
Short Code developed by Mauchly in 1949 for BINAC computers Expressions were coded, left to right Example of operations: 01 – 06 abs value 1n (n+2)nd power 02 ) n (n+2)nd root 03 = 08 pause n if <= n 04 / 09 ( print and tab Copyright © 2015 Pearson. All rights reserved.
16
Pseudocodes: Speedcoding
Speedcoding developed by Backus in 1954 for IBM 701 Pseudo ops for arithmetic and math functions Conditional and unconditional branching Auto-increment registers for array access Slow! Only 700 words left for user program Copyright © 2015 Pearson. All rights reserved.
17
Pseudocodes: Related Systems
The UNIVAC Compiling System Developed by a team led by Grace Hopper Pseudocode expanded into machine code David J. Wheeler (Cambridge University) developed a method of using blocks of re-locatable addresses to solve the problem of absolute addressing Copyright © 2015 Pearson. All rights reserved.
18
Copyright © 2015 Pearson. All rights reserved.
IBM 704 and Fortran Fortran 0: not implemented Fortran I:1957 Designed for the new IBM 704, which had index registers and floating point hardware - This led to the idea of compiled programming languages, because there was no place to hide the cost of interpretation (no floating-point software) Environment of development Computers were small and unreliable Applications were scientific No programming methodology or tools Machine efficiency was the most important concern Copyright © 2015 Pearson. All rights reserved.
19
Design Process of Fortran
Impact of environment on design of Fortran I No need for dynamic storage Need good array handling and counting loops No string handling, decimal arithmetic, or powerful input/output (for business software) Copyright © 2015 Pearson. All rights reserved.
20
Copyright © 2015 Pearson. All rights reserved.
Fortran I Overview First implemented version of Fortran Names could have up to six characters Post-test counting loop (DO) Formatted I/O User-defined subprograms Three-way selection statement (arithmetic IF) No data typing statements Copyright © 2015 Pearson. All rights reserved.
21
Fortran I Overview (continued)
First implemented version of FORTRAN No separate compilation Compiler released in April 1957, after 18 worker-years of effort Programs larger than 400 lines rarely compiled correctly, mainly due to poor reliability of 704 Code was very fast Quickly became widely used Copyright © 2015 Pearson. All rights reserved.
22
Copyright © 2015 Pearson. All rights reserved.
Fortran II Distributed in 1958 Independent compilation Fixed the bugs Copyright © 2015 Pearson. All rights reserved.
23
Copyright © 2015 Pearson. All rights reserved.
Fortran IV Evolved during Explicit type declarations Logical selection statement Subprogram names could be parameters ANSI standard in 1966 Copyright © 2015 Pearson. All rights reserved.
24
Copyright © 2015 Pearson. All rights reserved.
Fortran 77 Became the new standard in 1978 Character string handling Logical loop control statement IF-THEN-ELSE statement Copyright © 2015 Pearson. All rights reserved.
25
Copyright © 2015 Pearson. All rights reserved.
Fortran 90 Most significant changes from Fortran 77 Modules Dynamic arrays Pointers Recursion CASE statement Parameter type checking Copyright © 2015 Pearson. All rights reserved.
26
Latest versions of Fortran
Fortran 95 – relatively minor additions, plus some deletions Fortran 2003 – support for OOP, procedure pointers, interoperability with C Fortran 2008 – blocks for local scopes, co-arrays, Do Concurrent Copyright © 2015 Pearson. All rights reserved.
27
Copyright © 2015 Pearson. All rights reserved.
Fortran Evaluation Highly optimizing compilers (all versions before 90) Types and storage of all variables are fixed before run time Dramatically changed forever the way computers are used Copyright © 2015 Pearson. All rights reserved.
28
FORTRAN History One of the oldest computer languages Version history
created by John Backus and released in 1957 designed for scientific and engineering computations Version history FORTRAN 1957 FORTRAN II FORTRAN IV FORTRAN 66 (released as ANSI standard in 1966) FORTRAN 77 (ANSI standard in 1977) FORTRAN 90 (ANSI standard in 1990) FORTRAN 95 (ANSI standard version) FORTRAN 2003 (ANSI standard version) Many different “dialects” produced by computer vendors (Digital VAX Fortran, now Intel Fortran) Large majority of existing engineering software is coded in FORTRAN (various versions)
29
Statement Source Format
Classic format Free format PROGRAM MAIN C COMMENTS ARE ALLOWED IF A “C” IS PLACED IN COLUMN #1 DIMENSION X(10) READ(5,*) (X(I),I=1,10) WRITE(6,1000) X 1000 FORMAT(1X,’THIS IS A VERY LONG LINE OF TEXT TO SHOW HOW TO CONTINUE ’ * ‘THE STATEMENT TO A SECOND LINE’,/,10F12.4) PROGRAM MAIN ! A COMMENT DIMENSION X(10) READ(5,*) (X(I),I=1,10) WRITE(6,1000) X ! Another comment 1000 FORMAT(1X,’THIS IS A VERY LONG LINE OF TEXT TO SHOW HOW TO CONTINUE ’& &‘THE STATEMENT TO A SECOND LINE’,/,10F12.4)
30
Statement Format FORTRAN fixed format
“C” in column 1 indicates that line is a comment columns 1-5 are reserved for statement labels statement labels are not required unless the statement is the target of a goto labels are numeric values only column 6 is the continuation flag any character in column 6, other than space or “0”, indicates that this line is a continuation of the previous line there is usually a limit of 19 on the number of continuations columns 7-72 are contain Fortran statements columns is for sequence information only of any use when using punch cards
31
Statement Format IBM punch card
32
Fortran Variable Fortran variables
Fortran IV numbers and letters, at least 6 characters Fortran 77 numbers and letters and “_”, at least 16 characters must start with a letter Up through 77, spaces in a Fortran program are ignored IVALUE and I VAL UE are the same using strange spacing, while acceptable, is bad practice Fortran variables are typed Fortran is case insensitive ivar is the same as IVAR or IvAr INTEGER, REAL, DOUBLE PRECISION, COMPLEX LOGICAL, CHARACTER (77+)
33
Fortran Variable Typing
A feature of Fortran – implicit typing when a variable appears that has not been declared previously it is created (at compile time) it is assigned a type based on the first character of the name A-H,O-Z is type REAL I-N is type INTEGER a typo can cause the creation of a new variable – not an error Starting with 77 the implicit statement was added allowed changing the first letter assignments most 77 compilers include the implicit none statement that requires that all variables be explicitly typed – prevents the typo problem It is good practice to use implicit none
34
Fortran Variable Typing
Fortran 90+ uses a different method to deal with number ranges that is architecture independent CHARACTER*20 TITLE INTEGER*4 TITLE(5) DATA TITLE/4Habcd,4Hefgh,…/ INTEGER A DIMENSION A(10 INTEGER B DIMENSION B(10,10) REAL C(10,10,10)
35
Fortran Literals INTEGER A A = 34 REAL A(20) A(1) = 31.4159E-1
ITERM = -10.3 COMPLEX Z Z = (10,-10.5) REAL_PART = REAL(Z) AIMAG_PART = AIMAG(Z) Z = CMPLX(REAL_PART * 2,AIMAG_PART)
36
Fortran Statements The executable statements in Fortran assignment (=)
branching (GOTO) comparison (IF) looping (DO) subroutine invocation (CALL) A = 4.0 * AINIT GOTO 200 100 B = 52.0 … 200 C = B * A
37
Fortran Logical If The logical if statement performed a test using the logical operators .EQ., .NE., .LT., .LE., .GT., .GE. .AND., .OR., .NOT. If result is true then a single statement is executed IF (ISTART .EQ. 50) GOTO 100 … 100 CONTINUE IF (IMODE .EQ. 2) A = SQRT(CVALUE) … LOGICAL QUICK QUICK = .TRUE. IF (QUICK) STEP=0.5 IF (.NOT. QUICK) STEP = 0.01
38
Fortran Modern If This form eliminates the goto statements from the previous example LOGICAL QUICK QUICK = .TRUE. IF (QUICK) THEN STEP=0.5 ELSE STEP = 0.01 ENDIF … IF (QUICK .AND. (ABS(XVALUE – EPS) .LT )) THEN END IF
39
Program Layout of a main program
Can contain an arbitrary number of internal sub-program units Variables in the main program are accessible in the sub-programs, unless re-defined in the sub-program The sub-programs can themselves contain sub-programs PROGRAM main … CONTAINS SUBROUTINE sub END SUBROUTINE sub FUNCTION func END FUNCTION func END PROGRAM
40
Sample Fortran Code Hello World print *,"Hello world!“
100 format (5X,A,"!") print 100,"Hello world!“ write (89,100) "Hello world!" 99 Bottles of Beer program bottlestest implicit none integer :: i character(len=*), parameter :: bwall = " on the wall", & bottles = "bottles of beer", & bottle = "bottle of beer", & take = "Take one down, pass it around", & form = "(I0, ' ', A)" do i = 99,0,-1 if ( i /= 1 ) then write (*,form) i, bottles // bwall if ( i > 0 ) write (*,form) i, bottles else write (*,form) i, bottle // bwall write (*,form) i, bottle end if if ( i > 0 ) write (*,*) take end do end program bottlestest
41
Sample Fortran Code INTEGER ENUFF !A value has to be specified beforehand,. PARAMETER (ENUFF = 2468) !Provide some provenance. CHARACTER*(ENUFF) ALINE !A perfect size? CHARACTER*66 FNAME !What about file name sizes? INTEGER LINPR,IN !I/O unit numbers. INTEGER L,N !A length, and a record counter. LOGICAL EXIST !This can't be asked for in an "OPEN" statement. LINPR = 6 !Standard output via this unit number. IN = 10 !Some unit number for the input file. FNAME = "Read.for" !Choose a file name. INQUIRE (FILE = FNAME, EXIST = EXIST) !A basic question. IF (.NOT.EXIST) THEN !Absent? WRITE (LINPR,1) FNAME !Alas, name the absentee. 1 FORMAT ("No sign of file ",A) !The name might be mistyped. STOP "No file, no go." !Give up. END IF !So much for the most obvious mishap. OPEN (IN,FILE = FNAME, STATUS = "OLD", ACTION = "READ") !For formatted input. N = 0 !No records read so far. 10 READ (IN,11,END = 20) L,ALINE(1:MIN(L,ENUFF)) !Read only the L characters in the record, up to ENUFF. 11 FORMAT (Q,A) !Q = "how many characters yet to be read", A = characters with no limit. N = N !A record has been read. IF (L.GT.ENUFF) WRITE (LINPR,12) N,L,ENUFF !Was it longer than ALINE could accommodate? 12 FORMAT ("Record ",I0," has length ",I0,": my limit is ",I0) !Yes. Explain. WRITE (LINPR,13) N,ALINE(1:MIN(L,ENUFF)) !Print the record, prefixed by the count. 13 FORMAT (I9,":",A) !Fixed number size for alignment. GO TO 10 !Do it again. 20 CLOSE (IN) !All done. END !That's all. PROGRAM MAIN INTEGER N, X EXTERNAL SUB1 COMMON /GLOBALS/ N X = 0 PRINT *, 'Enter number of repeats' READ (*,*) N CALL SUB1(X,SUB1) END SUBROUTINE SUB1(X,DUMSUB) EXTERNAL DUMSUB IF(X .LT. N)THEN X = X + 1 PRINT *, 'x = ', X CALL DUMSUB(X,DUMSUB) END IF
42
Sample Fortran Code print *,"Hello world!“
100 format (5X,A,"!") print 100,"Hello world!“ Read file line by iine INTEGER ENUFF !A value has to be specified beforehand,. PARAMETER (ENUFF = 2468) !Provide some provenance. CHARACTER*(ENUFF) ALINE !A perfect size? CHARACTER*66 FNAME !What about file name sizes? INTEGER LINPR,IN !I/O unit numbers. INTEGER L,N !A length, and a record counter. LOGICAL EXIST !This can't be asked for in an "OPEN" statement. LINPR = 6 !Standard output via this unit number. IN = 10 !Some unit number for the input file. FNAME = "Read.for" !Choose a file name. INQUIRE (FILE = FNAME, EXIST = EXIST) !A basic question. IF (.NOT.EXIST) THEN !Absent? WRITE (LINPR,1) FNAME !Alas, name the absentee. 1 FORMAT ("No sign of file ",A) !The name might be mistyped. STOP "No file, no go." !Give up. END IF !So much for the most obvious mishap. OPEN (IN,FILE = FNAME, STATUS = "OLD", ACTION = "READ") !For formatted input. N = 0 !No records read so far. 10 READ (IN,11,END = 20) L,ALINE(1:MIN(L,ENUFF)) !Read only the L characters in the record, up to ENUFF. 11 FORMAT (Q,A) !Q = "how many characters yet to be read", A = characters with no limit. N = N !A record has been read. IF (L.GT.ENUFF) WRITE (LINPR,12) N,L,ENUFF !Was it longer than ALINE could accommodate? 12 FORMAT ("Record ",I0," has length ",I0,": my limit is ",I0) !Yes. Explain. WRITE (LINPR,13) N,ALINE(1:MIN(L,ENUFF)) !Print the record, prefixed by the count. 13 FORMAT (I9,":",A) !Fixed number size for alignment. GO TO 10 !Do it again. 20 CLOSE (IN) !All done. END !That's all.
43
Sample Fortran Code -- This is one of the examples shipped with GNAT.
With Gnat.IO; use Gnat.IO; procedure Gnatioex is C : Character; I : Integer; S : String ( ); begin Put_Line ("Hello. Welcome to the GNAT IO example" & "!"); New_Line; Put ("Note: This example uses GNAT.IO which does not raise Data_Error"); Put_Line (" for bad data."); Put (" "); Put_Line ("For that you need to use the standard package Ada.Text_IO."); New_line; Put ("Please enter a single character now followed by <CR> "); Get (C); Put ("Your character is: "); Put (C); Get (C); -- read the <CR> New_Line (2); Put ("Please enter a String now followed by <CR> :"); Get_Line (S, I); Put ("Your String is : "); Put_Line (S (1 .. I)); Put ("Its length is : "); Put (I); Put ("Please enter an integer now followed by <CR> "); Get (I); Put ("Your number is: "); end;
44
Functional Programming: Lisp
LISt Processing language Designed at MIT by McCarthy AI research needed a language to Process data in lists (rather than arrays) Symbolic computation (rather than numeric) Only two data types: atoms and lists Syntax is based on lambda calculus Copyright © 2015 Pearson. All rights reserved.
45
Representation of Two Lisp Lists
Representing the lists (A B C D) and (A (B C) D (E (F G))) Copyright © 2015 Pearson. All rights reserved.
46
Copyright © 2015 Pearson. All rights reserved.
Lisp Evaluation Pioneered functional programming No need for variables or assignment Control via recursion and conditional expressions Still the dominant language for AI Common Lisp and Scheme are contemporary dialects of Lisp ML, Haskell, and F# are also functional programming languages, but use very different syntax Copyright © 2015 Pearson. All rights reserved.
47
Copyright © 2015 Pearson. All rights reserved.
Scheme Developed at MIT in mid 1970s Small Extensive use of static scoping Functions as first-class entities Simple syntax (and small size) make it ideal for educational applications Copyright © 2015 Pearson. All rights reserved.
48
Copyright © 2015 Pearson. All rights reserved.
Common Lisp An effort to combine features of several dialects of Lisp into a single language Large, complex, used in industry for some large applications Copyright © 2015 Pearson. All rights reserved.
49
Functional programming: LISP
Originally developed for symbolic computing First interactive, interpreted language Dynamic typing: values have types, variables do not Garbage-collected Homogeneity of program and data Extensible: multiple dialects, implementations. Convenient testbed for language design experiments Main descendants: Scheme (compact) Common Lisp (massive). Statically typed functional languages: ML
50
Uniform syntax: lists Expressions are either atoms or lists
atoms are numeric or symbols lists nest, to form full trees Syntax is simple because programmer supplies what would otherwise be the internal representation of a program: (+ ( * 10, 12) (* 7, 11)) evaluates (10*12 + 7*11) A program is a list: (define (factorial n) (if (eq n 0) 1 ( * n (factorial (- n 1))))
51
List manipulation Three primitives and one constant
get head of list: car get rest of list: cdr add an element to a list: cons null list: nil or () Add equality ( = or eq) and recursion, and this is a universal model of computation
52
Rule of evaluation A number evaluates to itself
An atom evaluates to its current binding A list is a computation. Its first element must evaluate to an operation the remaining elements are actual parameters the result is the application of the operation to the evaluated actuals
53
Quoted data If every list is a computation, how do we describe data?
Another primitive: quote (quote ( )) => ( ) (quote (this is a simple declarative sentence) => (this is a simple declarative sentence) ‘ (this also works) => (this also works)
54
Decomposing a list (cdr ‘(singleton))
(car ‘(this is a list of symbols)) => this (cdr ‘(this is a list of symbols)) => (is a list of symbols) (cdr ‘(this that)) => (that) ; a list (cdr ‘(singleton)) => () ; the empty list (car ‘()) ; run time error
55
Building lists (cons ‘this ‘(that and the other))
(cons ‘a ‘()) => (a) useful shortcut: list (list ‘a ‘b ‘c ‘d ‘e) => (a b c d e) equivalent to (cons ‘a (cons ‘b (cons ‘c (cons ‘d (cons ‘e ‘())))))
56
Control structures Conditional (if condition expr1 expr2)
Generalized form (cond (pred1 expr1) (pred2 expr2) … (else exprn) Needs special rule: evaluate only the successful entry if and cond are not regular functions
57
Function declarations
(define (sqr n) (* n n)) define is also special: body is not evaluated defines produces a binding: sqr is bound to the body of the computation: (lambda (n) (* n n)) define can produce value bindings as well: (define x 15) (sqr x) => 225
58
Recursion (define (add1 x) (+ x 1)) ; the beginnings of Peano arithmetic (define (sub1 x) (- x 1)) (define (add x y) (if (= y 0) x (add ( (add1 x) (sub1 y)))) (define (times x y) (cond ((= y 0) 0) ((= y 1) x) (else (add x (times (x (sub1 y)))))))
59
Sample LISPCode (print "Hello world!") Read File line by Line
(with-open-file (input "file.txt") (loop for line = (read-line input nil) while line do (format t "~a~%" line))) 99 Bottles of Beer (defun bottles (x) (loop for bottles from x downto 1 do (format t "~a bottle~:p of beer on the wall ~:*~a bottle~:p of beer Take one down, pass it around ~a bottle~:p of beer on the wall~2%" bottles (1- bottles)))) (defun beer-verse (count) "Recurses the verses" (format t "~A bottle~:P of beer on the wall~%" count) (format t "~A bottle~:P of beer~%" count) (format t "Take one down, pass it round~%") (format t "~A bottle~A of beer on the wall~%~%" (if (= count 1) "No" (- count 1)) (if (/= count 2) "s" "")) (if (> count 1) (beer-verse (- count 1)))) (beer-verse 99)
60
The First Step Toward Sophistication: ALGOL 60
Environment of development FORTRAN had (barely) arrived for IBM 70x Many other languages were being developed, all for specific machines No portable language; all were machine dependent No universal language for communicating algorithms ALGOL 60 was the result of efforts to design a universal language Copyright © 2015 Pearson. All rights reserved.
61
Copyright © 2015 Pearson. All rights reserved.
Early Design Process ACM and GAMM met for four days for design (May 27 to June 1, 1958) Goals of the language Close to mathematical notation Good for describing algorithms Must be translatable to machine code Copyright © 2015 Pearson. All rights reserved.
62
Copyright © 2015 Pearson. All rights reserved.
ALGOL 58 Concept of type was formalized Names could be any length Arrays could have any number of subscripts Parameters were separated by mode (in & out) Subscripts were placed in brackets Compound statements (begin ... end) Semicolon as a statement separator Assignment operator was := if had an else-if clause No I/O - “would make it machine dependent” Copyright © 2015 Pearson. All rights reserved.
63
Copyright © 2015 Pearson. All rights reserved.
ALGOL 58 Implementation Not meant to be implemented, but variations of it were (MAD, JOVIAL) Although IBM was initially enthusiastic, all support was dropped by mid 1959 Copyright © 2015 Pearson. All rights reserved.
64
Copyright © 2015 Pearson. All rights reserved.
ALGOL 60 Overview Modified ALGOL 58 at 6-day meeting in Paris New features Block structure (local scope) Two parameter passing methods Subprogram recursion Stack-dynamic arrays Still no I/O and no string handling Copyright © 2015 Pearson. All rights reserved.
65
Copyright © 2015 Pearson. All rights reserved.
ALGOL 60 Evaluation Successes It was the standard way to publish algorithms for over 20 years All subsequent imperative languages are based on it First machine-independent language First language whose syntax was formally defined (BNF) Copyright © 2015 Pearson. All rights reserved.
66
ALGOL 60 Evaluation (continued)
Failure Never widely used, especially in U.S. Reasons Lack of I/O and the character set made programs non-portable Too flexible--hard to implement Entrenchment of Fortran Formal syntax description Lack of support from IBM Copyright © 2015 Pearson. All rights reserved.
67
Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel
CSCE 330 Project Algol 68 Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel
68
Design Goals Design goals: (but, Pascal more like A60 than A68 is)
general purpose, rigorously-defined language Clears up trouble spots in ALGOL60 (but, Pascal more like A60 than A68 is) orthogonality, extensibility
69
Features Value Name Supports a Block Structure
Two types of Parameter Passing Value Name Recursion Arrays Reserved Words
70
Failures and Shortcomings
The prime cause of the failure of ALGOL 68 was that too much was expected of it. It was not widely implemented or not soon enough implemented. Its formal definition was too complex to implement. ALGOL 68 is known to be ‘unreadable’. ALGOL 68 report was not properly typed hence too difficult to read. ALGOL 68 semantic model was too big with lots of extensions ALGOL 68 was a very mathematical language fairly difficult to understand, difficult to implement. The language was considered to complex for its time.
71
Key Ideas User type declarations (modes)
Reference mode (pointers of a sort) United modes (predecessor to variant records) Auto declaration of FOR LOOP index User-specified operator overloading
72
Key Ideas (Continued) Mode requirement for formals
Casting: user-specified mode conversion Redefinition of operator precedence Semaphores W-grammars - two-level grammar
73
Structure ALGOL68 is block structured w/ static scope rules
ALGOL68's model of computation: static stack: block/procedure AR's; local data objects heap: “heap” -- dynamic-- data objects ALGOL68 is an expression-oriented language
74
Organization Declarations: Imperatives (units)
Must be given (FOR LOOP index only exception) Can name new types (modes) Imperatives (units) 15 major unit types Assignment is allowable side-effect of units
75
Algol 68 Modes Primitive modes Compound Modes int --arrays
Real structures Char procedures bool sets string pointers Compl(complex) bits bytes Sema (semaphore) Format (I/O) file
76
Other features of Algol 68
Storage management • Local storage on stack • Heap storage, explicit alloc and garbage collection Parameter passing • Pass-by -value • Use pointer types to obtain Pass-by -reference Assignable procedure variables • Follow “orthogonality ” principle rigorously Source: Tanenbaum, Computing Surveys
77
Basic Syntax Addition : “ + ” Subtraction : “ - ”
Multiplication : “ * ” Division : “ / ” Exponentiation : “ ** ” Assignment : “ := ” Boolean Expressions = , > , < , <= , >= , /=
78
Block Structure First language to implement a block structure
Similar in form to pascal begin ….. end; Each block can have its own variables, visible only to that block (local variables). After the block is exited the values of all the local variables are lost.
79
Block Structure example
begin own integer i; integer j,k; i := j + k; end; The integer i will have the value of j+k stored the next time the block is entered By using the “own” statement the variable will retain its value for the next time the block is entered
80
Arrays Three types of arrays: real, integer, Boolean
Each array must contain all the same types All arrays are of type real unless specified Can have multidimensional arrays Declarations: array name1[1:100]; (1D array of type real) real array name2(-3:6,20:40); (2D array of type real) integer array name3, name4(1:46); (2 1D arrays of type integer) Boolean array name5(-10:n); (1D array of type Boolean) (Allocated Dynamically)
81
Sample Algol Code main: (printf($"Hello world!"l$)) Read File line by Line #!/usr/local/bin/a68g --script # FILE foobar; INT errno = open(foobar, "Read_a_file_line_by_line.a68", stand in channel); STRING line; FORMAT line fmt = $gl$; PROC mount next tape = (REF FILE file)BOOL: ( print("Please mount next tape or q to quit"); IF read char = "q" THEN done ELSE TRUE FI ); on physical file end(foobar, mount next tape); on logical file end(foobar, (REF FILE skip)BOOL: done); FOR count DO getf(foobar, (line fmt, line)); printf(($g(0)": "$, count, line fmt, line)) OD; done: SKIP 99 Bottles of Beer main:( FOR bottles FROM 99 TO 1 BY -1 DO printf(($z-d" bottles of beer on the wall"l$, bottles)); printf(($z-d" bottles of beer"l$, bottles)); printf(($"Take one down, pass it around"l$)); printf(($z-d" bottles of beer on the wall"ll$, bottles-1)) OD )
82
Computerizing Business Records: COBOL
Environment of development UNIVAC was beginning to use FLOW-MATIC USAF was beginning to use AIMACO IBM was developing COMTRAN Copyright © 2015 Pearson. All rights reserved.
83
COBOL Historical Background
Based on FLOW-MATIC FLOW-MATIC features Names up to 12 characters, with embedded hyphens English names for arithmetic operators (no arithmetic expressions) Data and code were completely separate The first word in every statement was a verb Copyright © 2015 Pearson. All rights reserved.
84
Copyright © 2015 Pearson. All rights reserved.
COBOL Design Process First Design Meeting (Pentagon) - May 1959 Design goals Must look like simple English Must be easy to use, even if that means it will be less powerful Must broaden the base of computer users Must not be biased by current compiler problems Design committee members were all from computer manufacturers and DoD branches Design Problems: arithmetic expressions? subscripts? Fights among manufacturers Copyright © 2015 Pearson. All rights reserved.
85
Copyright © 2015 Pearson. All rights reserved.
COBOL Evaluation Contributions First macro facility in a high-level language Hierarchical data structures (records) Nested selection statements Long names (up to 30 characters), with hyphens Separate data division Copyright © 2015 Pearson. All rights reserved.
86
Copyright © 2015 Pearson. All rights reserved.
COBOL: DoD Influence First language required by DoD would have failed without DoD Still the most widely used business applications language Copyright © 2015 Pearson. All rights reserved.
87
Introduction to COBOL Programming
Tuesday, January 25, 2009
88
Full COBOL Example IDENTIFICATION DIVISION.
PROGRAM-ID. SequenceProgram. DATA DIVISION. WORKING-STORAGE SECTION. 01 Num PIC 9 VALUE ZEROS. 01 Num PIC 9 VALUE ZEROS. 01 Result PIC 99 VALUE ZEROS. PROCEDURE DIVISION. CalculateResult. ACCEPT Num1. ACCEPT Num2. MULTIPLY Num1 BY Num2 GIVING Result. DISPLAY "Result is = ", Result. STOP RUN.
89
Layout (margins) of a COBOL Program
90
Layout cont’ - Components of Each Line
91
Structure of a COBOL Program
Divisions Section(s) Paragraph(s) Sentence(s) Statement(s)
92
Divisions IDENTIFICATION DIVISION. PROGRAM-ID. SequenceProgram.
DATA DIVISION. WORKING-STORAGE SECTION. 01 Num PIC 9 VALUE ZEROS. 01 Num PIC 9 VALUE ZEROS. 01 Result PIC 99 VALUE ZEROS. PROCEDURE DIVISION. CalculateResult. ACCEPT Num1. ACCEPT Num2. MULTIPLY Num1 BY Num2 GIVING Result. DISPLAY "Result is = ", Result. STOP RUN.
93
How to Code the Procedure Division
Divided into paragraphs Each paragraph in the Procedure Division represents one procedure of the program The name of each paragraph can be referred to as either a paragraph name or a procedure name The name of the first procedure should represent the function of the entire program The names of the procedures called by the first procedure should represent the functions performed by those procedures
94
Sections A section is a block of code made up of one or more paragraphs. A section begins with the section name and ends where the next section name is encountered or where the program text ends A section name consists of a name devised by the programmer or defined by the language followed by the word SECTION followed by a full stop SelectUlsterRecords SECTION. FILE SECTION.
95
Paragraphs A paragraph is a block of code made up of one or more sentences A paragraph begins with the paragraph name and ends with the next paragraph or section name or the end of the program text The paragraph name consists of a name devised by the programmer or defined by the language followed by a full stop PrintFinalTotals. PROGRAM-ID.
96
Quick Paragraph Example
ProcessRecord. DISPLAY StudentRecord READ StudentFile AT END MOVE HIGH-VALUES TO StudentRecord END-READ. ProduceOutput. DISPLAY “Here is a message”. ProcessRecord Paragraph ProduceOutput Paragraph NOTE The scope of ‘ProcessRecord’ is delimited by the occurrence the paragraph name ‘ProduceOutput’.
97
Sentences and Statements
A paragraph consists of one or more sentences A sentence consists of one or more statements and is terminated by a full stop MOVE .21 TO VatRate COMPUTE VatAmount = ProductCost * VatRate. DISPLAY "Enter name " WITH NO ADVANCING ACCEPT StudentName DISPLAY "Name entered was " StudentName. A statement consists of a COBOL verb and an operand or operands SUBTRACT Tax FROM GrossPay GIVING NetPay READ StudentFile AT END SET EndOfFile TO TRUE END-READ
98
Declaring Data in COBOL
Definitions must occur in the Data Division In COBOL a variable declaration consists of a line containing the following items; Œ A level number (more on this later). A data-name or identifier. Ž A PICTURE clause. We can give a starting value to variables by means of an extension to the picture clause called the value clause. DATA DIVISION. WORKING-STORAGE SECTION. 01 Num PIC 999 VALUE ZEROS. 01 VatRate PIC V99 VALUE .18. 01 StudentName PIC X(10) VALUE SPACES. Num1 VatRate StudentName 000 .18 DATA
99
Data Examples Examples If you wish you can use the abbreviation PIC
PICTURE a three digit (+ive only) integer PICTURE S999 a three digit (+ive/-ive) integer PICTURE XXXX a four character text item or string PICTURE 99V99 a +ive ‘real’ in the range 0 to 99.99 PICTURE S9V9 a +ive/-ive ‘real’ in the range ? If you wish you can use the abbreviation PIC Numeric values can have a maximum of 18 (eighteen) digits (i.e. 9’s) The limit on string values is usually system-dependent
100
Group Items/Records cont’
WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName PIC X(10). 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. H E N N E S S Y R M L M F StudentName StudentId CourseCode Grant Gender
101
Group Items/Records cont’
WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. H E N N E S S Y R M L M F StudentName StudentId CourseCode Grant Gender
102
The Move Statement
103
Move Example C O U G H L A N MOVE “RYAN” TO Surname.
MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8). C O U G H L A N Lecture 3
104
Move Example R Y A N MOVE “RYAN” TO Surname.
MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8). R Y A N Lecture 3
105
Move Example F I T Z P A T R I C K MOVE “RYAN” TO Surname.
MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8). F I T Z P A T R I C K Lecture 3
106
Moving to a Numeric When the destination item is numeric, or edited numeric, then data is aligned along the decimal point with zero filling or truncation as necessary When the decimal point is not explicitly specified in either the source or destination items, the item is treated as if it had an assumed decimal point immediately after its rightmost character
107
Move to a Numeric Examples
01 GrossPay PIC 9(4)V99. GrossPay MOVE ZEROS TO GrossPay. MOVE 12.4 TO GrossPay. MOVE TO GrossPay. MOVE TO GrossPay. ñ l GrossPay ñ l GrossPay ñ l GrossPay Lecture 3 ñ l
108
Additional Move Examples
109
The IF Statement
110
IF Statement
111
The Perform Statement
112
The PERFORM UNTIL Statement
PERFORM procedure-name UNTIL condition An example of a Perform Until statement PERFORM 100-CALCULATE-ONE-SALES-TAX UNTIL END-OF-SESSION-SWITCH = "Y". The operation of the Perform Until statement The Perform Until statement tests if a condition is true. If it isn’t true, the statement performs the procedure that it names until the condition becomes true. Then, the program continues with the statement after the Perform Until statement. The execution of a Perform Until statement is often referred to as a processing loop, or simply a loop. The condition in a Perform Until statement is formed the same way it is formed in an If statement.
113
The ADD Statement ADD {data-name-1 | literal} TO data-name-2 [ROUNDED] [ON SIZE ERROR statement-group] ADD {data-name-1 | literal-1} {data-name-2 | literal-2} GIVING data-name-3 [ROUNDED] [ON SIZE ERROR statement-group] Examples of Add statements ADD 1 TO YEAR-COUNTER. ADD CUSTOMER-SALES TO GRAND-TOTAL-SALES. ADD OLD-BALANCE NEW-CHARGES GIVING NEW-BALANCE. ADD JAN-SALES FEB-SALES MAR-SALES GIVING FIRST-QUARTER-SALES.
114
Arithmetic Verb Template
Example; ADD Takings TO CashTotal. ADD Males TO Females GIVING TotalStudents. SUBTRACT Tax FROM GrossPay. SUBTRACT Tax FROM GrossPay GIVING NetPay. DIVIDE Total BY Members GIVING MemberAverage. DIVIDE Members INTO Total GIVING MemberAverage. MULTIPLY 10 BY Magnitude. MULTIPLY Members BY Subs GIVING TotalSubs. The exceptions are the COMPUTE and the DIVIDE with REMAINDER. Lecture 3
115
Add Examples 3 1003 ADD Cash TO Total. ADD Cash, 20 TO Total, Wage.
Before After ADD Cash, 20 TO Total, Wage. Before ADD Cash, Total GIVING Result. Before ADD Males TO Females GIVING TotalStudents. Before Lecture 3
116
The COMPUTE Statement COMPUTE data-name [ROUNDED] = arithmetic-expression [ON SIZE ERROR statement-group] The arithmetic operators + Addition - Subtraction * Multiplication / Division ** Exponentiation
117
Examples of COMPUTE Statements
118
Rounding Receiving Field Actual Result Truncated Result Rounded Result PIC 9(3)V PIC 9(3) The ROUNDED option takes effect when, after decimal point alignment, the result calculated must be truncated on the right hand side. The option adds 1 to the receiving item when the leftmost truncated digit has an absolute value of 5 or greater. Lecture 3
119
The ACCEPT Statement ACCEPT {data-name}
When the Accept statement is run, the computer waits for the user to type an entry on the keyboard and press the Enter key When the user presses the Enter key, the entry is stored in the variable identified on the Accept statement, and the cursor moves to the next line on the screen The user entry should be consistent with the Picture of the variable. If it isn’t, it will be truncated or adjusted On an IBM mainframe, the Accept statement gets its data from the SYSIN device. As a result, this device must be set to the terminal keyboard Note: data must be entered to match the PIC statement of the receiving variable
120
The DISPLAY Statement The Display statement displays one or more literal or variable values on the screen of a monitor or terminal. After it displays these values, the cursor moves to the next line on the screen After the word DISPLAY, you can code one or more literals or variable names If you code more than one literal or variable name after the word DISPLAY, you must separate them by one or more spaces On an IBM mainframe, the Display statement sends its data to the SYSOUT device. As a result, this device must be set to the terminal screen
121
DISPLAY Syntax DISPLAY {data-name-1 | literal-1} ...
Examples of Display statements DISPLAY " ". DISPLAY DISPLAY " ". DISPLAY "End of session.". DISPLAY SALES-AMOUNT. DISPLAY "THE SALES AMOUNT IS " SALES-AMOUNT ".". DISPLAY "THE SALES TAX ON " SALES-TAX ".". The data displayed by the statements above (one space or a blank line) 15000 End of session. 100.00 THE SALES AMOUNT IS THE SALES TAX IS
122
Sample COBOL Code program-id. hello. procedure division. display "Hello world!". stop run. Read File line by Line read: procedure options (main); declare line character (500) varying; on endfile (sysin) stop; do forever; get edit (line)(L); end; end read; 99 Bottles of Beer
123
Sample COBOL Code identification division. program-id. ninety-nine. environment division. data division. working-storage section. 01 counter pic no-bottles-left value one-bottle-left value parts-of-counter redefines counter. 05 tens pic digits pic after-ten-words. 05 filler pic x(7) value spaces. 05 filler pic x(7) value "Twenty". 05 filler pic x(7) value "Thirty". 05 filler pic x(7) value "Forty". 05 filler pic x(7) value "Fifty". 05 filler pic x(7) value "Sixty". 05 filler pic x(7) value "Seventy". 05 filler pic x(7) value "Eighty". 05 filler pic x(7) value "Ninety". 01 after-ten-array redefines after-ten-words. 05 atens occurs 10 times pic x(7). 01 digit-words. 05 filler pic x(9) value "One". 05 filler pic x(9) value "Two". 05 filler pic x(9) value "Three". 05 filler pic x(9) value "Four". 05 filler pic x(9) value "Five". 05 filler pic x(9) value "Six". 05 filler pic x(9) value "Seven". 05 filler pic x(9) value "Eight". 05 filler pic x(9) value "Nine". 05 filler pic x(9) value "Ten". 05 filler pic x(9) value "Eleven". 05 filler pic x(9) value "Twelve". 05 filler pic x(9) value "Thirteen". 05 filler pic x(9) value "Fourteen". 05 filler pic x(9) value "Fifteen". 05 filler pic x(9) value "Sixteen". 05 filler pic x(9) value "Seventeen". 05 filler pic x(9) value "Eighteen". 05 filler pic x(9) value "Nineteen". 05 filler pic x(9) value spaces. 01 digit-array redefines digit-words. 05 adigits occurs 20 times pic x(9). 01 number-name pic x(15). procedure division. 100-main section. 100-setup. perform varying counter from 99 by -1 until no-bottles-left perform 100-show-number display " of beer on the wall" display " of beer" display "Take " with no advancing if one-bottle-left display "it " with no advancing else display "one " with no advancing end-if display "down and pass it round" subtract 1 from counter giving counter add 1 to counter giving counter display space end-perform. display "No more bottles of beer on the wall" display "No more bottles of beer" display "Go to the store and buy some more" display "Ninety Nine bottles of beer on the wall" stop run. 100-show-number. if no-bottles-left display "No more" with no advancing if counter < 20 display function trim( adigits( counter ) ) with no advancing if counter < 100 move spaces to number-name string atens( tens ) delimited by space, space delimited by size, adigits( digits ) delimited by space into number-name display function trim( number-name) with no advancing end-if. display " bottle" with no advancing display " bottles" with no advancing 100-end. end-program.
124
The Beginning of Timesharing: Basic
Designed by Kemeny & Kurtz at Dartmouth Design Goals: Easy to learn and use for non-science students Must be “pleasant and friendly” Fast turnaround for homework Free and private access User time is more important than computer time Current popular dialect: Visual Basic First widely used language with time sharing Copyright © 2015 Pearson. All rights reserved.
125
Sample Basic Code PRINT "Hello world!" Read File line by Line Open "input.txt" For Input As #1 Dim line_ As String While Not Eof(1) Line Input #1, line_ '' read each line Print line_ '' echo it to the console Wend Close #1 Print Print "Press any key to quit" Sleep 99 Bottles of Beer Dim As Integer bottles = 99 Dim As String b = " bottles " Do Print Str(bottles); b; "of beer hanging on the wall" Print "And if one bottle of beer should accidently be drunk" bottles -= 1 If bottles = 1 Then b = " bottle " ElseIf bottles = 0 Then b = " bottles " End If Print "There'll be"; bottles; b; "of beer hanging on the wall" Loop Until bottles = 0 Print "Press any key to sleep it off"
126
2.8 Everything for Everybody: PL/I
Designed by IBM and SHARE Computing situation in 1964 (IBM's point of view) Scientific computing IBM 1620 and 7090 computers FORTRAN SHARE user group Business computing IBM 1401, 7080 computers COBOL GUIDE user group Copyright © 2015 Pearson. All rights reserved.
127
Copyright © 2015 Pearson. All rights reserved.
PL/I: Background By 1963 Scientific users began to need more elaborate I/O, like COBOL had; business users began to need floating point and arrays for MIS It looked like many shops would begin to need two kinds of computers, languages, and support staff--too costly The obvious solution Build a new computer to do both kinds of applications Design a new language to do both kinds of applications Copyright © 2015 Pearson. All rights reserved.
128
Copyright © 2015 Pearson. All rights reserved.
PL/I: Design Process Designed in five months by the 3 X 3 Committee Three members from IBM, three members from SHARE Initial concept An extension of Fortran IV Initially called NPL (New Programming Language) Name changed to PL/I in 1965 Copyright © 2015 Pearson. All rights reserved.
129
Copyright © 2015 Pearson. All rights reserved.
PL/I: Evaluation PL/I contributions First unit-level concurrency First exception handling Switch-selectable recursion First pointer data type First array cross sections Concerns Many new features were poorly designed Too large and too complex Copyright © 2015 Pearson. All rights reserved.
130
Sample PL/1 Code goodbye:proc options(main); put list('Hello world!'); end goodbye; Read File line by Line read: procedure options (main); declare line character (500) varying; on endfile (sysin) stop; do forever; get edit (line)(L); end; end read;
131
Sample PL/1 Code SHELL: PROCEDURE OPTIONS (MAIN); DECLARE ARRAY(50) FIXED BIN(15), (K,N) FIXED BIN(15); GET LIST(N); GET EDIT((ARRAY(K) DO K = 1 TO N)); PUT EDIT((ARRAY(K) DO K = 1 TO N)); CALL BUBBLE(ARRAY,N); END BUBBLE; BUBBLE: PROCEDURE(ARRAY,N); /* BUBBLE SORT*/ DECLARE (I,J) FIXED BIN(15); DECLARE S BIT(1); /* SWITCH */ DECLARE Y FIXED BIN(15); /* TEMPO */ DO I = N-1 BY -1 TO 1; S = '1'B; DO J = 1 TO I; IF X(J)>X(J+1) THEN DO; S = '0'B; Y = X(J); X(J) = X(J+1); X(J+1) = Y; END; IF S THEN RETURN; RETURN; END SRT;
132
Sample PL/1 Code /* A sample program which updates the salaries for those employees */ /* whose current commission total is greater than or equal to the */ /* value of COMMISSION. The salaries of those who qualify are */ /* increased by the value of PERCENTAGE, retroactive to RAISE_DATE. */ /* A report is generated showing the projects which these employees */ /* have contributed to, ordered by project number and employee ID. */ /* A second report shows each project having an end date occurring */ /* after RAISE_DATE (i.e. is potentially affected by the retroactive */ /* raises) with its total salary expenses and a count of employees */ /* who contributed to the project. */ /*********************************************************************/ PLIEX: PROC; DCL RAISE_DATE CHAR(10); DCL WORK_DAYS FIXED BIN(15); DCL COMMISSION FIXED DECIMAL(8,2); DCL PERCENTAGE FIXED DECIMAL(5,2); /* File declaration for sysprint */ DCL SYSPRINT FILE EXTERNAL OUTPUT STREAM PRINT; /* Structure for report 1 */ DCL 1 RPT1, /* 15 PROJNO CHAR(6), */ %INCLUDE PROJECT (PROJECT, RECORD,,COMMA); 15 EMPNO CHAR(6), 15 NAME CHAR(30), 15 SALARY FIXED DECIMAL(8,2);
133
Sample PL/1 Code /* Structure for report 2 */ DCL 1 RPT2, 15 PROJNO CHAR(6), 15 PROJECT_NAME CHAR(36), 15 EMPLOYEE_COUNT FIXED BIN(15), 15 TOTL_PROJ_COST FIXED DECIMAL(10,2); EXEC SQL INCLUDE SQLCA; COMMISSION = ; PERCENTAGE = 1.04; RAISE_DATE = ' '; WORK_DAYS = 253; OPEN FILE(SYSPRINT); /* Update the selected employee's salaries by the new percentage. */ /* If an error occurs during the update, ROLLBACK the changes. */ EXEC SQL WHENEVER SQLERROR GO TO UPDATE_ERROR; EXEC SQL UPDATE CORPDATA/EMPLOYEE SET SALARY = SALARY * :PERCENTAGE WHERE COMM >= :COMMISSION ;
134
Sample PL/1 Code EXEC SQL COMMIT; EXEC SQL WHENEVER SQLERROR GO TO REPORT_ERROR; /* Report the updated statistics for each project supported by one */ /* of the selected employees. */ /* Write out the header for Report 1 */ put file(sysprint) edit('REPORT OF PROJECTS AFFECTED BY EMPLOYEE RAISES') (col(22),a); edit('PROJECT','EMPID','EMPLOYEE NAME','SALARY') (skip(2),col(1),a,col(10),a,col(20),a,col(55),a); exec sql declare c1 cursor for select DISTINCT projno, EMP_ACT.empno, lastname||', '||firstnme, salary from CORPDATA/EMP_ACT, CORPDATA/EMPLOYEE where EMP_ACT.empno = EMPLOYEE.empno and comm >= :COMMISSION order by projno, empno; OPEN C1; /* Fetch and write the rows to SYSPRINT */ EXEC SQL WHENEVER NOT FOUND GO TO DONE1; DO UNTIL (SQLCODE ^= 0); FETCH C1 INTO :RPT1.PROJNO, :RPT1.EMPNO, :RPT1.NAME, :RPT1.SALARY; PUT FILE(SYSPRINT) EDIT(RPT1.PROJNO,RPT1.EMPNO,RPT1.NAME,RPT1.SALARY) (SKIP,COL(1),A,COL(10),A,COL(20),A,COL(54),F(8,2)); END;
135
Sample PL/1 Code DONE1: EXEC SQL CLOSE C1; /* For all projects ending at a date later than 'raise_date' */ /* (i.e. those projects potentially affected by the salary raises) */ /* generate a report containing the project number, project name */ /* the count of employees participating in the project and the */ /* total salary cost of the project. */ /* Write out the header for Report 2 */ PUT FILE(SYSPRINT) EDIT('ACCUMULATED STATISTICS BY PROJECT') (SKIP(3),COL(22),A); PUT FILE(SYSPRINT) EDIT('PROJECT','NUMBER OF','TOTAL') (SKIP(2),COL(1),A,COL(48),A,COL(63),A); EDIT('NUMBER','PROJECT NAME','EMPLOYEES','COST') (SKIP,COL(1),A,COL(10),A,COL(48),A,COL(63),A,SKIP); DECLARE C2 CURSOR FOR SELECT EMP_ACT.PROJNO, PROJNAME, COUNT(*), SUM( (DAYS(EMENDATE) - DAYS(EMSTDATE)) * EMPTIME * DECIMAL(( SALARY / :WORK_DAYS ),8,2) ) FROM CORPDATA/EMP_ACT, CORPDATA/PROJECT, CORPDATA/EMPLOYEE WHERE EMP_ACT.PROJNO=PROJECT.PROJNO AND EMP_ACT.EMPNO =EMPLOYEE.EMPNO AND PRENDATE > :RAISE_DATE GROUP BY EMP_ACT.PROJNO, PROJNAME ORDER BY 1; OPEN C2;
136
Sample PL/1 Code /* Fetch and write the rows to SYSPRINT */ EXEC SQL WHENEVER NOT FOUND GO TO DONE2; DO UNTIL (SQLCODE ^= 0); EXEC SQL FETCH C2 INTO :RPT2; PUT FILE(SYSPRINT) EDIT(RPT2.PROJNO,RPT2.PROJECT_NAME,EMPLOYEE_COUNT, TOTL_PROJ_COST) (SKIP,COL(1),A,COL(10),A,COL(50),F(4),COL(62),F(8,2)); END; DONE2: CLOSE C2; GO TO FINISHED; /* Error occurred while updating table. Inform user and rollback */ /* changes. */ UPDATE_ERROR: EXEC SQL WHENEVER SQLERROR CONTINUE; PUT FILE(SYSPRINT) EDIT('*** ERROR Occurred while updating table.'|| ' SQLCODE=',SQLCODE)(A,F(5)); ROLLBACK; /* Error occurred while generating reports. Inform user and exit. */ REPORT_ERROR: PUT FILE(SYSPRINT) EDIT('*** ERROR Occurred while generating '|| 'reports. SQLCODE=',SQLCODE)(A,F(5)); /* All done */ FINISHED: CLOSE FILE(SYSPRINT); RETURN; END PLIEX;
137
Two Early Dynamic Languages: APL and SNOBOL
Characterized by dynamic typing and dynamic storage allocation Variables are untyped A variable acquires a type when it is assigned a value Storage is allocated to a variable when it is assigned a value Copyright © 2015 Pearson. All rights reserved.
138
APL: A Programming Language
Designed as a hardware description language at IBM by Ken Iverson around 1960 Highly expressive (many operators, for both scalars and arrays of various dimensions) Programs are very difficult to read Still in use; minimal changes Copyright © 2015 Pearson. All rights reserved.
139
Sample APL Code 'Hello world!‘ Matrix Multiplication x ← +.× A ← ↑A*¨⊂A←⍳4 ⍝ Same A as in other examples ( ⍪ ⍪ ,[0.5] ) B ← ⌹A ⍝ Matrix inverse of A 'F6.2' ⎕FMT A x B bob ← { (⍕⍵), ' bottle', (1=⍵)↓'s of beer'} bobw ← {(bob ⍵) , ' on the wall'} beer ← { (bobw ⍵) , ', ', (bob ⍵) , '; take one down and pass it around, ', bobw ⍵-1} ↑beer¨ ⌽(1-⎕IO)+⍳99
140
Copyright © 2015 Pearson. All rights reserved.
SNOBOL Designed as a string manipulation language at Bell Labs by Farber, Griswold, and Polensky in 1964 Powerful operators for string pattern matching Slower than alternative languages (and thus no longer used for writing editors) Still used for certain text processing tasks Copyright © 2015 Pearson. All rights reserved.
141
Sample SNOBOL Code OUTPUT = "Hello world!" END Read File Line by Line input(.infile,20,"readfrom.txt") :f(end) rdloop output = infile :s(rdloop) End 99 Bottles of Beer x = 99 again output = X " bottles of beer on the wall" output = X " bottles of beer" ?eq(X,0) :s(zero) output = "Take one down, pass it around" output = (X = gt(x,0) X - 1) " bottle of beer on the wall..." :s(again) zero output = "Go to store, get some more" output = "99 bottles of beer on the wall" end
142
The Beginning of Data Abstraction: SIMULA 67
Designed primarily for system simulation in Norway by Nygaard and Dahl Based on ALGOL 60 and SIMULA I Primary Contributions Coroutines - a kind of subprogram Classes, objects, and inheritance Copyright © 2015 Pearson. All rights reserved.
143
Sample SIMULA67 Code BEGIN OUTTEXT("Hello world!"); OUTIMAGE END Multiplication Table begin integer i, j; outtext( " " ); for i := 1 step 1 until 12 do outint( i, 4 ); outimage; outtext( " +" ); for i := 1 step 1 until 12 do outtext( "----" ); for i := 1 step 1 until 12 do outint( i, 3 ); outtext( "|" ); for j := 1 step 1 until i - 1 do outtext( " " ); for j := i step 1 until 12 do outint( i * j, 4 ); outimage end; end
144
Sample SIMULA67 Code Classes BEGIN CLASS MyClass(instanceVariable); INTEGER instanceVariable; PROCEDURE doMyMethod(n); INTEGER n; Outint(instanceVariable, 5); Outtext(" + "); Outint(n, 5); Outtext(" = "); Outint(instanceVariable + n, 5); Outimage END; REF(MyClass) myObject; myObject :- NEW MyClass(5); myObject.doMyMethod(2) END
145
Orthogonal Design: ALGOL 68
From the continued development of ALGOL 60 but not a superset of that language Source of several new ideas (even though the language itself never achieved widespread use) Design is based on the concept of orthogonality A few basic concepts, plus a few combining mechanisms Copyright © 2015 Pearson. All rights reserved.
146
Copyright © 2015 Pearson. All rights reserved.
ALGOL 68 Evaluation Contributions User-defined data structures Reference types Dynamic arrays (called flex arrays) Comments Less usage than ALGOL 60 Had strong influence on subsequent languages, especially Pascal, C, and Ada Copyright © 2015 Pearson. All rights reserved.
147
Copyright © 2015 Pearson. All rights reserved.
Pascal Developed by Wirth (a former member of the ALGOL 68 committee) Designed for teaching structured programming Small, simple, nothing really new Largest impact was on teaching programming From mid-1970s until the late 1990s, it was the most widely used language for teaching programming Copyright © 2015 Pearson. All rights reserved.
148
Copyright © 2015 Pearson. All rights reserved.
Designed for systems programming (at Bell Labs by Dennis Richie) Evolved primarily from BCLP and B, but also ALGOL 68 Powerful set of operators, but poor type checking Initially spread through UNIX Though designed as a systems language, it has been used in many application areas Copyright © 2015 Pearson. All rights reserved.
149
Programming Based on Logic: Prolog
Developed, by Comerauer and Roussel (University of Aix-Marseille), with help from Kowalski ( University of Edinburgh) Based on formal logic Non-procedural Can be summarized as being an intelligent database system that uses an inferencing process to infer the truth of given queries Comparatively inefficient Few application areas Copyright © 2015 Pearson. All rights reserved.
150
Sample Prolog Code :- write('Hello world!'), nl. Read line by line NOT AVAILABLE 99 bottles of Beer bottles(0):-!. bottles(X):- writef('%t bottles of beer on the wall \n',[X]), writef('%t bottles of beer\n',[X]), write('Take one down, pass it around\n'), succ(XN,X), writef('%t bottles of beer on the wall \n\n',[XN]), bottles(XN). :- bottles(99).
151
Sample Prolog Code – DB and Queries
female(lola). female(bonnie). female(bonnie_h). female(carrie). female(phyl). female(rachel). male(dave). male(tom). male(theo). male(dennis). male(bill). male(tom_h). parent(bill, tom). parent(phyl, tom). parent(tom, bonnie). parent(tom, theo). parent(tom, rachel). parent(lola, bonnie). parent(lola, theo). parent(lola, rachel). parent(carrie, adam). parent(dennis, adam). parent(bonnie_h, lola). parent(bonnie_h, carrie). parent(tom_h, lola). parent(tom_h, carrie). parent(phyl, dave). husband(tom, lola). husband(dennis, carrie). husband(bill, phyl). husband(tom_h, bonnie_h). wife(X,Y) :- husband(Y,X). spouse(X,Y) :- husband(X,Y). spouse(X,Y) :- wife(X,Y). mother(X,Y) :- female(X), parent(X,Y). father(X,Y) :- male(X), parent(X,Y). sibling(X,Y) :- mother(Z,X), mother(Z,Y), X \== Y. brother(X,Y) :- male(X), sibling(X,Y). sister(X,Y) :- female(X), sibling(X,Y). brother_in_law(X,Y) :- brother(X, Z), spouse(Z, Y). brother_in_law(X,Y) :- husband(X, Z), sister(Z, Y). sister_in_law(X,Y) :- sister(X, Z), spouse(Z, Y). sister_in_law(X,Y) :- wife(X, Z), brother(Z, Y). ancestor(X,Y) :- parent(X,Y). ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).
152
Sample Prolog Code – Simple List Ops
% Append lists: app(X,Y,Z) means that X append Y yields Z. The base case says % that anything appended to the empty list gives back the anything. The % second one says that, if T1 append X yeilds T2, then I can append A to the % front of T1 and T2 and maintain the relationship. More precisely, if T1 % append X yeilds T2, then [A|T1] append X yeilds [A|T2]. % app([],X,X). app([A|T1],X,[A|T2]) :- app(T1,X,T2). % The length of the list: len(N, L) means N is the length of list L. The % basis rule says that the length of the empty list is 0. The recursive % rule says that, if N2 is the length of Tail, then N2 + 1 is the length of % Tail with one additional member added to the front. (Recall that _ is a % variable. The name _ is used when the value of a variable is not used % elsewhere.) len(0,[]). len(N, [_ | Tail]) :- len(N2, Tail), N is N2 + 1. % Take the sum of the members of a list of integers: sum_list(N, L) means that % N is the sum of the members of L. If SubTot is the sum of the members of % Tail, then Head + SubTot is the sum of the members of [Head | Tail]. sum_list(0, []). sum_list(Sum, [Head | Tail]) :- sum_list(SubTot, Tail), Sum is Head + SubTot. % Reverse the list. rev([],[]). rev([H|T], R) :- rev(T, TR), app(TR, [H], R). % Tell if the list (second argument) contains the first argument. contains(X, [X|_]). contains(X, [_|T]) :- contains(X,T).
153
History’s Largest Design Effort: Ada
Huge design effort, involving hundreds of people, much money, and about eight years Sequence of requirements ( ) (Strawman, Woodman, Tinman, Ironman, Steelman) Named Ada after Augusta Ada Byron, the first programmer Copyright © 2015 Pearson. All rights reserved.
154
Copyright © 2015 Pearson. All rights reserved.
Ada Evaluation Contributions Packages - support for data abstraction Exception handling - elaborate Generic program units Concurrency - through the tasking model Comments Competitive design Included all that was then known about software engineering and language design First compilers were very difficult; the first really usable compiler came nearly five years after the language design was completed Copyright © 2015 Pearson. All rights reserved.
155
Copyright © 2015 Pearson. All rights reserved.
Ada 95 Ada 95 (began in 1988) Support for OOP through type derivation Better control mechanisms for shared data New concurrency features More flexible libraries Ada 2005 Interfaces and synchronizing interfaces Popularity suffered because the DoD no longer requires its use but also because of popularity of C++ Copyright © 2015 Pearson. All rights reserved.
156
Sample Ada Code BEGIN OUTTEXT("Hello world!"); OUTIMAGE END Read line by line NOT AVAILABLE 99 bottles of Beer with Ada.Text_Io; use Ada.Text_Io; procedure Bottles is begin for X in reverse loop Put_Line(Integer'Image(X) & " bottles of beer on the wall"); Put_Line(Integer'Image(X) & " bottles of beer"); Put_Line("Take one down, pass it around"); Put_Line(Integer'Image(X - 1) & " bottles of beer on the wall"); New_Line; end loop; end Bottles;
157
Object-Oriented Programming: Smalltalk
Developed at Xerox PARC, initially by Alan Kay, later by Adele Goldberg First full implementation of an object-oriented language (data abstraction, inheritance, and dynamic binding) Pioneered the graphical user interface design Promoted OOP Copyright © 2015 Pearson. All rights reserved.
158
Sample Smalltalk Code Transcript show: 'Hello world!'; cr. Read line by line 'foobar.txt' asFilename readingLinesDo:[:eachLine | eachLine printCR] |s| s := 'foobar.txt' asFilename readStream. [ s atEnd ] whileFalse:[ s nextLine printCR. ]. s close 99 bottles of Beer Smalltalk at: #sr put: 0 ; at: #s put: 0 ! sr := Dictionary new. sr at: 0 put: ' bottle' ; at: 1 put: ' bottles' ; at: 2 put: ' of beer' ; at: 3 put: ' on the wall' ; at: 4 put: 'Take one down, pass it around' ! 99 to: 0 by: -1 do: [:v | v print. ( v == 1 ) ifTrue: [ s := 0. ] ifFalse: [ s := 1. ]. Transcript show: (sr at:s) ; show: (sr at:2) ; show: (sr at:3) ; cr. v print. Transcript show: (sr at:s) ; show: (sr at:2) ; cr. (v ~~ 0) ifTrue: [ Transcript show: (sr at:4) ; cr. ].
159
Combining Imperative and Object-Oriented Programming: C++
Developed at Bell Labs by Stroustrup in 1980 Evolved from C and SIMULA 67 Facilities for object-oriented programming, taken partially from SIMULA 67 A large and complex language, in part because it supports both procedural and OO programming Rapidly grew in popularity, along with OOP ANSI standard approved in November 1997 Microsoft’s version: MC++ Properties, delegates, interfaces, no multiple inheritance Copyright © 2015 Pearson. All rights reserved.
160
Copyright © 2015 Pearson. All rights reserved.
A Related OOP Language Objective-C (designed by Brad Cox – early 1980s) C plus support for OOP based on Smalltalk Uses Smalltalk’s method calling syntax Used by Apple for systems programs Copyright © 2015 Pearson. All rights reserved.
161
An Imperative-Based Object-Oriented Language: Java
Developed at Sun in the early 1990s C and C++ were not satisfactory for embedded electronic devices Based on C++ Significantly simplified (does not include struct, union, enum, pointer arithmetic, and half of the assignment coercions of C++) Supports only OOP Has references, but not pointers Includes support for applets and a form of concurrency Copyright © 2015 Pearson. All rights reserved.
162
Copyright © 2015 Pearson. All rights reserved.
Java Evaluation Eliminated many unsafe features of C++ Supports concurrency Libraries for applets, GUIs, database access Portable: Java Virtual Machine concept, JIT compilers Widely used for Web programming Use increased faster than any previous language Most recent version, 8, released in 2014 Copyright © 2015 Pearson. All rights reserved.
163
Scripting Languages for the Web
Perl Designed by Larry Wall—first released in 1987 Variables are statically typed but implicitly declared Three distinctive namespaces, denoted by the first character of a variable’s name Powerful, but somewhat dangerous Gained widespread use for CGI programming on the Web Also used for a replacement for UNIX system administration language JavaScript Began at Netscape, but later became a joint venture of Netscape and Sun Microsystems A client-side HTML-embedded scripting language, often used to create dynamic HTML documents Purely interpreted Related to Java only through similar syntax PHP PHP: Hypertext Preprocessor, designed by Rasmus Lerdorf A server-side HTML-embedded scripting language, often used for form processing and database access through the Web Copyright © 2015 Pearson. All rights reserved.
164
Scripting Languages for the Web
Python An OO interpreted scripting language Type checked but dynamically typed Used for CGI programming and form processing Dynamically typed, but type checked Supports lists, tuples, and hashes Ruby Designed in Japan by Yukihiro Matsumoto (a.k.a, “Matz”) Began as a replacement for Perl and Python A pure object-oriented scripting language - All data are objects Most operators are implemented as methods, which can be redefined by user code Purely interpreted Copyright © 2015 Pearson. All rights reserved.
165
Scripting Languages for the Web
Lua An OO interpreted scripting language Type checked but dynamically typed Used for CGI programming and form processing Dynamically typed, but type checked Supports lists, tuples, and hashes, all with its single data structure, the table Easily extendable Copyright © 2015 Pearson. All rights reserved.
166
The Flagship .NET Language: C#
Part of the .NET development platform (2000) Based on C++ , Java, and Delphi Includes pointers, delegates, properties, enumeration types, a limited kind of dynamic typing, and anonymous types Is evolving rapidly Copyright © 2015 Pearson. All rights reserved.
167
Markup/Programming Hybrid Languages
XSLT eXtensible Markup Language (XML): a metamarkup language eXtensible Stylesheet Language Transformation (XSTL) transforms XML documents for display Programming constructs (e.g., looping) JSP Java Server Pages: a collection of technologies to support dynamic Web documents JSTL, a JSP library, includes programming constructs in the form of HTML elements Copyright © 2015 Pearson. All rights reserved.
168
Copyright © 2015 Pearson. All rights reserved.
Summary Development, development environment, and evaluation of a number of important programming languages Perspective into current issues in language design Copyright © 2015 Pearson. All rights reserved.
169
Potted History of Programming Languages
CS 345 Potted History of Programming Languages Vitaly Shmatikov
170
Why So Many Languages? “There will always be things we wish to say in our programs that in all languages can only be said poorly.” - Alan Perlis
171
What’s Driving Their Evolution?
Constant search for better ways to build software tools for solving computational problems Many PLs are general purpose tools Others are targeted at specific kinds of problems For example, massively parallel computations or graphics Useful ideas evolve into language designs Algol Simula Smalltalk C with Classes C++ Often design is driven by expediency Scripting languages: Perl, Tcl, Python, PHP, etc. “PHP is a minor evil perpetrated by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals.” - Jon Ribbens
172
What Do They Have in Common?
Lexical structure and analysis Tokens: keywords, operators, symbols, variables Regular expressions and finite automata Syntactic structure and analysis Parsing, context-free grammars Pragmatic issues Scoping, block structure, local variables Procedures, parameter passing, iteration, recursion Type checking, data structures Semantics What do programs mean and are they correct
173
Core Features vs. Syntactic Sugar
What is the core high-level language syntax required to emulate a universal Turing machine? What is the core syntax of C? Are ++, --, +=, -=, ?:, for/do/while part of the core? Convenience features? Structures/records, arrays, loops, case/switch? Preprocessor macros (textual substitution) Run-time libraries String handling, I/O, system calls, threads, networking, etc. “Syntactic sugar causes cancer of the semicolons” - Alan Perlis
174
Brave New World Programming tool “mini-languages”
awk, make, lex, yacc, autoconf … Command shells, scripting and “web” languages sh, csh, tcsh, ksh, zsh, bash … Perl, JavaScript, PHP, Python, Rexx, Ruby, Tcl, AppleScript, VBScript … Web application frameworks and technologies ASP.NET, AJAX, Flash, Silverlight … Note: HTML/XML are markup languages, not programming languages, but they often embed executable scripts like Active Server Pages (ASPs) & Java Server Pages (JSPs)
175
Final Thoughts There will be new languages invented
You will have to spend time learning them on your own! For now, enjoy the luxury of being able to take a class Conflicting goals for language design can lead to feature creep and hideous complexity Exhibit A: PL/I Exhibit B: C++ Then someone gets fed up … A language that adopts the original simple and elegant ideas, while eliminating the complexity (e.g., Java)
176
Ethics in Programming Languages
Review Ethical Issues in Programming Languages Found at: Social/Ethical Issues in PL Course S. Tanimoto
177
Social and Ethical Issues in Programming Language Design
Can harm be done by designers of programming languages? Support for system safety in P.L. Security policies. Who gets to program? Should languages be easy to learn or easy to use? Is there a right to literacy in programming? (to read programs? to write programs?) What part do programming languages play in ethical and unethical uses of technology? CSE 341 S. Tanimoto Social/Ethical Issues -
178
Can harm be done by designers of programming languages?
Direct harm ? Indirect harm ? CSE 341 S. Tanimoto Social/Ethical Issues -
179
Software Can Kill: The Yakima Software Bug
“On Saturday, January 17, 1987, the second patient of the day was to be treated for a carcinoma. This patient was to receive two film verification exposures of 4 and 3 rads plus a 79 rad photon treatment (for a total exposure of 86 rads)... The console displayed ‘beam ready,’ and the operator hit the B key to turn the beam on... the patient...reported ‘feeling a burning sensation’ in his chest. Later in the day, the patient developed a skin burn over the entire treatment area...The patient died in April from complications related to the overdose.” [from N. Leveson: Safeware, pp ]. CSE 341 S. Tanimoto Social/Ethical Issues -
180
The Yakima Software Bug (cont)
“The software problem ... is fairly well established. ...Every pass through the Set Up Test routine ...increments... a shared variable called Class3. If Class3 is nonzero, there is an inconsistency and treatment should not proceed. A zero value for Class3 indicates that the relevant parameters are consistent with treatment and the software does not inhibit the beam.” Problem: Class3 was a 1-byte variable. Adding 1 to 255 produced 0. Being treated with the Therac-25 radiation treatment machine was a bit like playing Russian roulette. CSE 341 S. Tanimoto Social/Ethical Issues -
181
Who is responsible for damage caused by bugs in a program ?
(a) the user (b) the author of the program (c) the compiler writer (d) the designer of the programming language the patient? the hospital? the manufacturing company? the software designer? coder? tester? CSE 341 S. Tanimoto Social/Ethical Issues -
182
Emergent Language Properties That Relate to Human Errors
Masterability Fault proneness understandability maintainability checkability [J. J. Horning: Programming languages for reliable computing systems, 1979]. CSE 341 S. Tanimoto Social/Ethical Issues -
183
Language Features Found to be Prone to Error:
pointers control transfers of various kinds defaults implicit type conversions global variables Overloading variable names CSE 341 S. Tanimoto Social/Ethical Issues -
184
Defensive Programming
Design thoroughly Design for testability Design for safety by identifying, preventing, and checking for dangerous conditions Design test methods into the system Test during development Keep a log of testing activities Maintain testing tools as well as product code CSE 341 S. Tanimoto Social/Ethical Issues -
185
Is There a Right to Program?
Literacy as a human right in the 21st century Computer literacy ... What forms of programming should be accessible? CSE 341 S. Tanimoto Social/Ethical Issues -
186
CSE 341 S. Tanimoto Social/Ethical Issues -
Learning to Program Several important programming languages developed from efforts to make programming easier to learn. Logo: Lisp-like, interpreted language + turtle graphics BASIC -- developed by Kurtz and Kemeny at Dartmouth Univ. to help undergraduates learn about computing. Karel the Robot (a pre-Pascal teaching tool by Richard Pattis) Smalltalk -- envisioned by Alan Kay as a programming language for kids. Visual-rule based simulations (KidSim, Stagecast Creator, AgentBuilder, Visual AgenTalk) Color XFORM (Image processing system) + scripting language (e.g., Lisp) -- a visual & symbolic approach at U of Wash. CSE 341 S. Tanimoto Social/Ethical Issues -
187
Is Language Learnability Important from an Ethical Standpoint?
Some professions create barriers to entry. Should programmers or language designers ever do this? If they do, is it ethical to do it by making languages difficult to learn? Software written so that no one but the author can maintain it can pose a risk for those who depend on the software being up to date. CSE 341 S. Tanimoto Social/Ethical Issues -
188
“Religious” Attitudes in Programming
Should programmers be dogmatic about language features or philosphies? Can a programmer be pluralistic about language and still hold strong convictions? How should programmers respect the tradeoffs between idealism and practicality in the choice and uses of programming languages? CSE 341 S. Tanimoto Social/Ethical Issues -
189
Using Computer-Based Languages for Human Communication
Social issues in language design Cultural biases Limited ontologies Visual vs non-visual (symbolic) Interface biases CSE 341 S. Tanimoto Social/Ethical Issues -
190
Programming Languages Steve’s Used
Boston College: PL/1 on IBM mainframe on punch cards (dropping deck in h2o) Pascal on paper terminal and Assembly Michigan State Pascal …most courses didn’t have projects! Ohio State & Naval postgraduate school Three Different C Compilers (before ANSI C) PDP, Vax, Unix All Implemented Operating Precedence Differently! Learned to Use LOTS of ()()()()() to be Safe! Mutli-Computer, Multi-Process Programming Code moved from PDP/Vax to Unix Started Failing (if (…) | (…)) had bitwise or that started to Cause a Execution Problem!
191
Programming Languages Steve’s Used
Teaching at Uconn CSE110 (123) Pascal, C++ CSE230 (2102) C++, Ada95, and Java, C CSE235 (CSE4102) C++, prolog, lisp, ml, modula 2 CSE3002 Pascal, Ada, Modula-2, Prolog CSE4100 flex, bison, C CSE4701 Oracle in 2007 on Unix Server MySQL workbench in 2014 on Student PCs
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.