1 / 42

CS 655: Programming Languages Scheming Schemers, Mocking Mockingbirds, and Objecting Objectively

CS 655: Programming Languages Scheming Schemers, Mocking Mockingbirds, and Objecting Objectively. Lecture 1: Wherefore CS655?. The use of <???> cripples the mind; its teaching should, therefore, be regarded as a criminal offence. Edsger W.Dijkstra, 1975. CS655: Programming Languages

cachez
Download Presentation

CS 655: Programming Languages Scheming Schemers, Mocking Mockingbirds, and Objecting Objectively

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 655: Programming LanguagesScheming Schemers, Mocking Mockingbirds, and Objecting Objectively Lecture 1: Wherefore CS655? The use of <???> cripples the mind; its teaching should, therefore, be regarded as a criminal offence. Edsger W.Dijkstra, 1975 CS655: Programming Languages University of Virginia Computer Science David Evans http://www.cs.virginia.edu/~evans

  2. Menu • What is Computer Science? • Goals for the Course • Programming Languages • Design Tradeoffs Send registration email by Sunday CS 655: Lecture 1

  3. What is Computer Science? CS 655: Lecture 1

  4. Let AB and CD be the two given numbers not relatively prime. It is required to find the greatest common measure of AB and CD. If now CD measures AB, since it also measures itself, then CD is a common measure of CD and AB. And it is manifest that it is also the greatest, for no greater number than CD measures CD. But, if CD does not measure AB, then, when the less of the numbers AB and CD being continually subtracted from the greater, some number is left which measures the one before it. CS 655: Lecture 1

  5. For a unit is not left, otherwise AB and CD would be relatively prime, which is contrary to the hypothesis. Therefore some number is left which measures the one before it. Now let CD, measuring BE, leave EA less than itself, let EA, measuring DF, leave FC less than itself, and let CF measure AE. Since then, CF measures AE, and AE measures DF, therefore CF also measures DF. But it measures itself, therefore it also measures the whole CD. But CD measures BE, therefore CF also measures BE. And it also measures EA, therefore it measures the whole BA. But it also measures CD, therefore CF measures AB and CD. Therefore CF is a common measure of AB and CD. I say next that it is also the greatest. If CF is not the greatest common measure of AB and CD, then some number G, which is greater than CF, measures the numbers AB and CD. Now, since G measures CD, and CD measures BE, therefore G also measures BE. But it also measures the whole BA, therefore it measures the remainder AE. But AE measures DF, therefore G also measures DF. And it measures the whole DC, therefore it also measures the remainder CF, that is, the greater measures the less, which is impossible. Therefore no number which is greater than CF measures the numbers AB and CD. Therefore CF is the greatest common measure of AB and CD. Euclid’s Elements, Book VII, Proposition 2 (300BC) CS 655: Lecture 1

  6. By the word operation, we mean any process which alters the mutual relation of two or more things, be this relation of what kind it may. This is the most general definition, and would include all subjects in the universe. Again, it might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine... Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent. • Ada, Countess of Lovelace, around 1830 CS 655: Lecture 1

  7. What is the difference between Euclid and Ada? “It depends on what your definition of ‘is’ is.” Bill Gates (speaking at Microsoft’s anti-trust trial) CS 655: Lecture 1

  8. Geometry vs. Computer Science • Geometry (mathematics) is about declarative knowledge: “what is” If now CD measures AB, since it also measures itself, then CDis a common measure of CD and AB • Computer Science is about imperative knowledge: “how to” Computer Science has nothing to do with beige (or translucent blue) boxes called “computers” and is not a science. CS 655: Lecture 1

  9. Next: My Goals for the Course CS 655: Lecture 1

  10. Goal #1 Make this the first real Computer Science most of you have taken. CS 655: Lecture 1

  11. Imperative Knowledge • The core of Computer Science is describing and reasoning about computations • This class is about: • Tools for describing computations (programming languages) • Tools for reasoning about those tools (mostly formal semantics) CS 655: Lecture 1

  12. Goal #2 Not waste your time. CS 655: Lecture 1

  13. Graduate Students • Should make research their highest priority (after sleeping, eating, and maintaining sanity and happiness) • Should not spend time on courses except when it: • Makes them better researchers • Is of intrinsic interest and value • Should be mature enough to decide what it is worthwhile to spend time on CS 655: Lecture 1

  14. Hence: • Everything in this class is optional • Except Problem Set 0: Registration Survey • You should not take this course unless you believe most of the material we will cover is either: • Relevant to your research • Intrinsically cool and interesting (Note: all of it is both) CS 655: Lecture 1

  15. Evaluation • I still need to grade you, of course... • To get an A in this course, you need to convince me of your deep understanding of the most important course material. CS 655: Lecture 1

  16. Ways to get an A in CS 655 • Do well on the assignments or • Do well on an oral final exam or • Produce a quality research paper on a relevant topic or • Demonstrate your understanding through outstanding class contributions CS 655: Lecture 1

  17. QuestionsNext: Goals 3-8 CS 655: Lecture 1

  18. Goal #3 When you need to invent a language (and most of you will at some point in your career) you will design it, not just make it up. CS 655: Lecture 1

  19. What’s the difference? Moral? A bigger army beats good design every time But, good designs can influence people with armies CS 655: Lecture 1

  20. Goal #4 When you design your language, you will have sufficient knowledge of other languages not to repeat their mistakes, and solid enough theory background to describe your language well. CS 655: Lecture 1

  21. Goal #5 You will become better at programming and building systems. You will think more clearly and maybe even write better. A language that doesn't affect the way you think about programming, is not worth knowing. Alan Perlis CS 655: Lecture 1

  22. Goal #6 Some of you will do projects that lead to conference papers and influence your theses. All of you will be able to understand nearly all PLDI papers and many POPL papers. CS 655: Lecture 1

  23. Goal #7 Enable at least half of you to understand at least half of R5RS Section 7.2 (2½ pages) CS 655: Lecture 1

  24. Goal #8 FUN! CS 655: Lecture 1

  25. Disclaimer • Sorry, no refunds if not all goals are satisfied. • Tell me your goals on the survey. CS 655: Lecture 1

  26. QuestionsNext: What is a Programming Language? CS 655: Lecture 1

  27. What is a language? Webster: A systematic means of communicating ideas or feelings by the use of conventionalized signs, sounds, gestures, or marks having understood meanings. CS 655: Lecture 1

  28. Nerdy Linguist’s Definition A description of pairs (S, M), where S stands for sound, or any kind of surface forms, and M stands for meaning. A theory of language must specify the properties of S and M, and how they are related. CS 655: Lecture 1

  29. Programming Language A language (according to the Nerdy Linguist’s definition) intended to be read and written by humans and processed by machines. Stricter definition add: that has some notion of control flow. CS 655: Lecture 1

  30. Some other definitions • Bruce MacLellan’s definition: A language that is intended for the expression of computer programs and that is capable of expressing any computer program. • Ravi Sethi’s definition: Notations used for specifying, organizing, and reasoning about computations. CS 655: Lecture 1

  31. What makes a PL important? CS 655: Lecture 1

  32. Lots of People Learn It No books in print: Algol60, CLU, Simula Amazon.com sales rank for best-selling book related to language (30 November 1999) CS 655: Lecture 1

  33. You Can Get a Job No job listings: Algol60, CLU, Simula Monster.com job listings in Virginia matching language (30 November 1999) CS 655: Lecture 1

  34. Changes How Programmers ThinkInfluences other Languages • FORTRAN - use a high level language • Algol60 - program in a structured way • Simula - use classes • CLU - use data abstraction • FP - program without state CS 655: Lecture 1

  35. Languages we will focus on • Scheme • Simplest, cleanest, most elegant language I know • Extremely powerful tool for describing computations • CLU • Because I like it, and its my course • Because it has the best support for data abstraction • Java • Because it is popular and modern • Others, possibly including: • Ada, Algol60, Algol68, C, C++, Eiffel, Euclid, FL, ML, Linda, Pascal, Sather, Simula, Tcl CS 655: Lecture 1

  36. Language DesignArt and Engineering CS 655: Lecture 1

  37. Language Design as Engineering Safety Performance Java, CLU FORTRAN, BLISS, C Ease of Use Ease/size of Implementation BASIC, CLU Forth, C Orthogonality Safety, Simplicity Algol68 Pascal Simplicity Expressiveness Scheme Common LISP CS 655: Lecture 1

  38. Example: Is assignment an expression? • Wulf (BLISS): Of course, everything is a := if .c >4 then .e else f := 7 • Richie (C): Yes, why not while (x = 0) x++; but not: x = if (a > 3) 4 else 5; • Wirth (Pascal): No, only math-like things are expressions Who’s right? What were their design tradeoffs? CS 655: Lecture 1

  39. C’s main design requirement Memory Space 24K on PDP-11 total. Needed to fit OS, compiler, and leave a little room for user programs. The “good” languages and operating systems of the day (Algol60, Multics) didn’t fit. Note: C++’s main design requirement: be as compatible as possible with C. CS 655: Lecture 1

  40. Language Design as Art • Aesthetics matter • Readability is usually more important than Writability • CLU vs. APL • Intuitive meaning more important than formal semantics • But formal semantics necessary to make sure we agree on intuitive meaning CS 655: Lecture 1

  41. Interaction of Art & EngineeringExample: C void test (int x) { while (x = 1) { printf (“I’m an imbecile!”); x = x + 1; } } Art: use = for assignment (not :=) Engineering: make assignments expressions, no Boolean type, weak types, etc. CS 655: Lecture 1

  42. Charge • Think about my definition of Computer Science • Send me a better one if you can • Think about how well the languages you use are designed • Send me your registration survey by Sunday • Next time: Scheme CS 655: Lecture 1

More Related