CSC302 2005S, Class 1: Introduction Overview: * Warning! Participation ahead * What is a programming language? * Why study programming languages? * How to study programming languages? * This class * Expectations * Other stuff Preliminaries * Sam calls on people *a lot* * These notes available online * Take your own notes * Web site note quite ready What is a programming language? * Steve: A series of statements used to take in certain preconditions and with the desired postconditions * John translates: * "Series of statements" = "Lines of code" * "Preconditions" = "Things we already know or hold true" * "Postconditions" = "Things we want to accomplish" * Ben suggests that we've just described a program; the language is more what you use to write the program. * Ben: A language is something used to write programs * Cassandra: Missing some aspects * Cassandra: A method for communicating instructions to the computer * Gene: A tool that the computer can execute to perform some task Detour: What is computer science? * The study of ALGORITHMS and DATA * The study of PROBLEM SOLVING Refining Cassie's definitions * Omondi replaces "stuff" with "ALGORITHMS and DATA" * Revised: A method for communicating ALGORITHMS and DATA to the computer * Mark suggests sometimes we communicate with people (define map (lambda (fun lst) (if (null? lst) null (cons (fun (car lst) (map fun (cdr lst))))))) Map is a function of two parameters, a function, fun, and a list, lst. Map creates a new list by applying fun to each element of lst. * Revised: A method for communicating ALGORITHMS and DATA (to computers or people or both) * Arjun: "Language" would be better than "method", but that's circular. * A language is a group of symbols, grammatical rules, and semantic rules for expressing something What does it mean to study programming languages? * Learn a lot. * Study common and uncommon design issues * Historical perspective * Design our own * Implement one or more languages Focus of CSC302 * Study common and uncommon design issues * Learn "a lot": * Languages you should already know: Scheme, Java, C * Languages you probably don't know: FP, Haskell, Smalltalk, Prolog * "Primary literature" study Our goal is to study these things this semester. Why? * It's required. (Why do we require it?) * Josh is here because he's trying to write a language for Plans ([Yellow Tail]) * Graduate departments expect it. (Why do departments expect PL?) * Different languages provide different ways to think about writing algorithms and organizing data. Learning different languages gives you broader thinking skills. * Josh2 agrees with Daren. * By learning more about the tools we use, we become better at using them * Evidence suggests that most large programs include their own language * Knowing more about languages helps you find the best language for a taks Why did Josh have to buy Gries? * Important to learn how to formally define the statements in a language * Important to learn how to "prove" a program is correct * Formal methods are good