Intro to Programming

OS and apps are software, or programs
  1. a set of instructions telling the computer (hardware) what to do with some data
The computer itself only does very basic instructions
  1. move a word in memory
  2. add two words
  3. compare two words
  4. jump to another instruction
  5. set the color at some pixel on the screen
  6. read a keyboard key push
If all programs were written at this level, programming would be very hard and tedious!
  1. not only that, but the basic instructions can be different from computer to computer
So, a level of abstraction is made.
  1. abstraction is a key concept in computer science, and comes up again and again.
  2. abstraction is a generalization meant to hide details and complexity
  3. allows us to build complex systems (e.g., automobile)
  4. allows us to relate different systems (e.g., diesel truck, car, airplane)
Define an virtual computation environment, then define a language for writing programs in that environment.
  1. must be able to somehow translate the virtual computations into real ones
  2. Turing (19...) showed the equivalence of computation environments
  3. Example: my kitchen as a real environment, a recipe as a virtual computation
Let's look at math as a virtual computation environment
  1. what is the data? numbers.
  2. we can talk about sets of numbers -- naturals, reals, integers, positives
  3. what are some operations? plus, minus, times, greater-than, less-than, log
  4. is there a difference between doing and just being? what is 4*3?
  5. note that complex operations can be defined in terms of simpler ones -- multiplication
  6. algebra introduces unknowns -- identifiers.
  7. equality in math is a relation, not an assignment.
  8. so, algebra also introduces functions.
  9. functions as doing, or as being
Math, in this pure form, forms a functional computation environment.
  1. all computation is in terms of relations
  2. what values for the unkowns make the relations true?
  3. function is a mapping from one set to another set
  4. (a mathemetician is a computer using the math virtual computation environment)
Our functional programming language is ML.

A Programming Language is:

  1. a language for a virtual compuation environment
  2. a very formal language
  3. precise syntax (structure)
  4. precise semantics (meaning)
Reading Assignment: Ullman (ML), Chapter 1 and Chapter 2, section 1 (2.1)