CSC302 2006S, Class 3: A Biased History of Programming Languages Admin: * Sorry about Wednesday - You get one additional free sick day * Sorry about the confusion about "Homework 1" * Please submit comments on readings by midnight the night prior to class * Readings on the design of languages: * N. Wirth - Designed Pascal * C.A.R. Hoare - Designed Quicksort Overview * Dating key ideas and issues * An approximate history /What Errors Did You Find?/ * Why does Sam ask? * To embarass Davis * To remind you never to take readings as absolute truth * To remind you to read carefully, particularly code * The DEFUN should not be in a comment, p. 53 (DEFUN equal_lists (lis1 lis2) ... ) * Problem in C code, p. 81 * Average won't be precise b/c it's an integer (design?) * The array has size 98. The number of inputs can be of size 99. Whoops! * Why should you have picked up on that (almost immediately)? * Good programmers use defined constants instead of hard-coded numbers * Typical programming error: Off by one (in comparisons, array defn's, etc.) * What is the likely effect? * Null pointer error (possible) * Possibly overwrite some other piece of data * With incorrect output * With no observable incorrect output * How could a language designer help? * Check bounds, probably at run time, report error if bound error * Language design to make bounds errors difficult - Original design of Pascal Arrays take subranges as parameters Indices must be members of same subrange type * Automatically expand arrays as necessary * Can slow down the program * Inadvertent expansion is likely an error * Language design philosophy conflict * Some designers (e.g. Wall): Programmers know what they want to do, don't hamper them * Some designers (e.g., Sun Java team): Programmers make endless mistakes. Stop them! /Dating Some Key Concepts/ * Computational devices - Thousands of years, eg., abacus * The general-purpose computer (as opposed to ...) - Instead of a different complex machine for each algorithm, build one machine that can run different algorithms * Designed? 1800's - Babbage Programmer - Ada * Implemented? ENIAC, ABC - early 1940's * Stored program computers - Great idea that programs can be data (no patch cords! Yay) - John von Neumann * Punch cards Late 1700's Jacquard loom IBM's predecessor, late 1800's * The programming language * The first implemented programming language * Hypertext /Dating the Primary Paradigms/ * Imperative programming - Fortran, late 1950's * Functional programming - LISP, late 1950's early 1960's * Object-oriented programming - Simula67, mid 1960's * Logic programming - Prolog, early 1970's * Parallel programming - 1950's * Relational model - Mid 1960's * Declarative is a general term for "program with declarative statements, not with control" + Pure Functional + Logic + Relational /History of Languages, Approximated/