cs 316 - concepts of programming languages misc topics

14
CS 316 - Concepts of Programming Languages Misc Topics

Upload: blanche-fowler

Post on 17-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 316 - Concepts of Programming Languages Misc Topics

CS 316 - Concepts of Programming Languages

Misc Topics

Page 2: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

2

Using Language

• Create the artifact - source code• Translate the artifact - object code• Use the Translation - run the program

This model has many variations...

Page 3: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

3

C++

.cppFile

Compiler Linker

.objFile

.exeFile

Page 4: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

4

Basic

.basFile

Interpreter

Page 5: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

5

HTML

.htmlFile

Browser

Page 6: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

6

Java

.javaFile

CompilerBytecodeInterpreter

.bytecodeFile

Page 7: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

7

It’s not always clean...

.cFile

Compiler Linker

.objFile

.exeFile

Assembler

.asmFile

Page 8: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

8

If Languages were Cars

• Assembler– A Formula I race car. Vary fast but difficult to drive

and expensive to maintain

• FORTRAN II– A Model T Ford. Once it was king of the road

• FORTRAN IV– A Model A Ford.

• FORTRAN 77– A six-cylinder Ford Fairlane with standard

transmission and no seat belts.

Page 9: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

9

If Languages were Cars

• COBOL– A delivery van. It's bulky and ugly, but gets the job

done.

• BASIC– A second-hand Rambler with a rebuilt engine and

patched upholstery. Your dad bought it for you to learn to drive. You'll ditch it as soon as you can afford a new car.

Page 10: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

10

If Languages were Cars

• PL/I– A Cadillac convertible with automatic transmission,

a two-tone paint job, white-wall tires, chrome exhaust pipes and fuzzy dice hanging from the rearview mirror.

• C– A black Firebird, the all-macho car. Optional seat

belts (lint) and optional fuzz buster (escape to assembler).

Page 11: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

11

If Languages were Cars

• ALGOL 60– An Austin Mini. Boy, that's a small car.

• Pascal– A Volkswagen Beetle. Small but sturdy. Once

popular with intellectuals.

• LISP– An electric car. Simple but slow. Seat belts not

available.

Page 12: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

12

If Languages were Cars

• APL– A double-decker bus. It takes rows and columns of

passengers to the same place all at the same time. But, it drives only in reverse gear and is instrumented in Greek.

• Ada– An army-green Mercedes Benz staff car. Power

steering, power brakes, automatic transmission. No other colors or options available. If it's good enough for the generals, it's good enough for you.

Page 13: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

13

Language Parenting

• C treats you like a consenting adult• Pascal treats you like a naughty child• Ada treats you like a criminal

Bruce Powel Douglass

Real-time UML, AW 1998

Page 14: CS 316 - Concepts of Programming Languages Misc Topics

Spring 2002 UCCS CS316 Concepts of Programming Languages

14

Language Summary?

• Grand schemes and commercial failures have left persistent legacies:– ALGOL, PL/I, Ada

• Less original projects have produced commercial successes:– FORTRAN, C, C++, BASIC

• Small, enduring languages based on a single concept:– LISP, SmallTalk

• All-encompassing projects; everything for everybody:– PL/I, Ada, (C++)