CS 316 Concepts of Programming Languages Misc Topics

  • Slides: 14
Download presentation
CS 316 - Concepts of Programming Languages Misc Topics Spring 2002 UCCS CS 316

CS 316 - Concepts of Programming Languages Misc Topics Spring 2002 UCCS CS 316 Concepts of Programming Languages

Using Language • Create the artifact - source code • Translate the artifact -

Using Language • Create the artifact - source code • Translate the artifact - object code • Use the Translation - run the program This model has many variations. . . Spring 2002 UCCS CS 316 Concepts of Programming Languages 2

C++ Compiler . cpp File Spring 2002 Linker . obj File UCCS CS 316

C++ Compiler . cpp File Spring 2002 Linker . obj File UCCS CS 316 Concepts of Programming Languages . exe File 3

Basic Interpreter . bas File Spring 2002 UCCS CS 316 Concepts of Programming Languages

Basic Interpreter . bas File Spring 2002 UCCS CS 316 Concepts of Programming Languages 4

HTML Browser . html File Spring 2002 UCCS CS 316 Concepts of Programming Languages

HTML Browser . html File Spring 2002 UCCS CS 316 Concepts of Programming Languages 5

Java Compiler . java File Spring 2002 Bytecode Interpreter . byte code File UCCS

Java Compiler . java File Spring 2002 Bytecode Interpreter . byte code File UCCS CS 316 Concepts of Programming Languages 6

It’s not always clean. . . Compiler . c File Spring 2002 Assembler .

It’s not always clean. . . Compiler . c File Spring 2002 Assembler . asm File Linker . obj File UCCS CS 316 Concepts of Programming Languages . exe File 7

If Languages were Cars • Assembler – A Formula I race car. Vary fast

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. Spring 2002 UCCS CS 316 Concepts of Programming Languages 8

If Languages were Cars • COBOL – A delivery van. It's bulky and ugly,

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. Spring 2002 UCCS CS 316 Concepts of Programming Languages 9

If Languages were Cars • PL/I – A Cadillac convertible with automatic transmission, a

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). Spring 2002 UCCS CS 316 Concepts of Programming Languages 10

If Languages were Cars • ALGOL 60 – An Austin Mini. Boy, that's a

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. Spring 2002 UCCS CS 316 Concepts of Programming Languages 11

If Languages were Cars • APL – A double-decker bus. It takes rows and

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. Spring 2002 UCCS CS 316 Concepts of Programming Languages 12

Language Parenting • C treats you like a consenting adult • Pascal treats you

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 Spring 2002 UCCS CS 316 Concepts of Programming Languages 13

Language Summary? • Grand schemes and commercial failures have left persistent legacies: – ALGOL,

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, Small. Talk • All-encompassing projects; everything for everybody: – PL/I, Ada, (C++) Spring 2002 UCCS CS 316 Concepts of Programming Languages 14