<<

Lisp (List Processing Language) Memory management was automatic. Example: A formal was ((lambda (x) (* x x)) 10) developed to define precisely Developed in the early 60s. what a program means. A radical departure from earlier programming languages. Programs and data are represented in a uniform list format. Types are a property of data values, not variables or parameters. A program can build and run new functions as it executes. Data values were not fixed in size.

© © CS 538 Spring 2007 24 CS 538 Spring 2007 25

Simula 67 ( Algol) and C++ Example: C was developed in the early Class Rectangle (Width, Height); 70’s; C++ in the mid-80s. Real Width, Height; Boolean Procedure IsSquare; These languages have a IsSquare := Width=Height; concise, expressive syntax; End of Rectangle; they generate high quality code Developed about 1967. sufficient for performance- Introduced the notion of a class critical applications. (for simulation purposes). C, along with Unix, proved the Included objects, a garbage viability of platform- collector, and notions of independent languages and extending a class. applications. C++ was originally C with C and C++ allow classes (as Simula was Algol a great deal of freedom in with classes). bending and breaking rules. Raises the issue of whether one language can span both novice and expert programmers.

© © CS 538 Spring 2007 26 CS 538 Spring 2007 27 Interesting issue—if most Java statements and expressions are meaningful, can errors be Developed in the late 90s. readily detected? Cleaner object-oriented if (a=) language than C++. a=0; Introduced notions of dynamic else a = 1; loading of class definitions across the Web. Much stronger emphasis on secure execution and detection of run-time errors. Extended notions of platform independence to system independence.

© © CS 538 Spring 2007 28 CS 538 Spring 2007 29

What Drives Research into 3. Reliability New Programming Languages? Too much low-level detail in programs greatly enhances the Why isn’t C or C++ or C+++ chance of minor errors. Minor enough? errors can raise significant 1. Curiosity problems in applications. What other forms can a 4. Security take? Computers are entrusted with What other notions of great responsibilities. How can programming are possible? we know that a program is safe 2. Productivity and reliable enough to trust? Procedural languages, 5. Execution speed including C, C++ and Java, are Procedural languages are very detailed. closely tied to the standard Many source lines imply sequential model of instruction significant development and execution. We may need maintenance expenses. radically different programming models to fully exploit parallel and distributed computers.

© © CS 538 Spring 2007 30 CS 538 Spring 2007 31 Desirable Qualities in a • The language should support Programming Language abstraction. You can’t anticipate all needed data Theoretically, all programming structures and operations, so adding new definitions easily and efficiently languages are equivalent (Why?) should be allowed. If that is so, what properties are • The language should support desirable in a programming testing, debugging and language? verification. • It should be easy to use. • The language should have a good Programs should be easy to read and development environment. understand. Integrated editors, , Programs should be simple to write, debuggers, and version control are a without subtle pitfalls. big plus. It should be orthogonal, providing • The language should be portable, only one way to do each step or spanning many platforms and computation. operating systems. Its notation should be natural for the application being programed.

© © CS 538 Spring 2007 32 CS 538 Spring 2007 33

• The language should be Programming Paradigms inexpensive to use: Execution should be fast. Programming languages Memory needs should be modest. naturally fall into a number of Translation should be fast and fundamental styles or modular. paradigms. Program creation and testing should be easy and cheap. Procedural Languages Maintenance should not be unduly cumbersome. Most of the widely-known and Components should be reusable. widely-used programming languages (C, , Pascal, Ada, etc.) are procedural. Programs execute statement by statement, reading and modifying a shared memory. This programming style closely models conventional sequential processors linked to a random access memory (RAM).

© © CS 538 Spring 2007 34 CS 538 Spring 2007 35 Question: Functional Languages Given Lisp, Scheme and ML are a = a + 1; functional in nature. if (a > 10) Programs are expressions to be b = 10; evaluated. else b = 15; Language design aims to a = a * b; minimize side-effects, including assignment. Why can’t 5 processors each Alternative evaluation execute one line to make the mechanisms are possible, program run 5 times faster? including Lazy (Demand Driven)

Eager (Data Driven or Speculative)

© © CS 538 Spring 2007 36 CS 538 Spring 2007 37