no
play

NO Midterm: Whats the point? Midterm: Whats the point? Sadism? - PowerPoint PPT Presentation

Midterm CSE 341 : Programming Languages Friday was . . . interesting? Interlude Spent the weekend reflecting. Course Motivation, Midterm Debrief Learning experience for all of us. Debrief: Zach Tatlock - what we learned Spring 2014 -


  1. Midterm CSE 341 : Programming Languages Friday was . . . interesting? Interlude Spent the weekend reflecting. Course Motivation, Midterm Debrief Learning experience for all of us. Debrief: Zach Tatlock - what we learned Spring 2014 - what we’re going to do moving forward 2 NO Midterm: What’s the point? Midterm: What’s the point? Sadism? Preparation, study, review. Flexing some intellectual muscle? Feedback for me and feedback for you. Break spirits so we can reshape them? Just one part of demonstrating your ability. Build reputation as a super hardcore prof? Practice performing under pressure. 3 4

  2. Midterm: How did we do? Midterm: Feedback / Analyzing Results Feedback for me: Preparation, study, review. - despite best efforts, test a bit long / difficult - in the end, distribution very informative Feedback for me and feedback for you. - y’all did *extremely* well considering challenge Just one part of demonstrating your ability. Feedback for you: - great job preparing, keep it up! Practice performing under pressure. - pretty good job being strategic, nice work J - opportunity to consider motivations / priorities 5 6 Midterm: How did we do? Midterm: Just One Part of Grade Preparation, study, review. Midterm Feedback for me and feedback for you. Final Cookies Just one part of demonstrating your ability. Class Practice performing under pressure. HW 7 8

  3. Midterm: Just One Part of Grade Midterm: How did we do? That said, I was once an undergrad myself. Preparation, study, review. Despair = worst possible midterm outcome. Feedback for me and feedback for you. Just one part of demonstrating your ability. So: midterm = max (midterm 0 , final) Practice performing under pressure. or (curried): We’re actually in pretty good shape. midterm = max midterm 0 final 9 10 I really like studying programming languages. Super stoked to explore PL with all of you. Why? 11 12

  4. If you ar If you are in a shipwr e in a shipwreck and al ck and all the b l the boats ar ats are gone, a e gone, a piano top buoyant enough to ke piano top buoyant enough to keep you aflo ep you afloat may c at may come ome along and make a fortuitous life pr along and make a fortuitous life preserver. eserver. This is not to say, though, that the b This is not to say, though, that the best way to design a life est way to design a life pr preserver is in the form of a piano top. eserver is in the form of a piano top. I think we ar I think we are clinging to a gr e clinging to a great many piano tops in at many piano tops in ac accepting yester epting yesterday's fortuitous day's fortuitous contrivings ontrivings as c as constituting onstituting the only me the only means for solving a given pr ans for solving a given problem. oblem. R. Buckminster Fuller 14 More Detailed Course Motivation I really like studying programming languages. • Why learn fundamental concepts that appear in all languages? • Why use languages quite different from C, C++, Java, Python? Super stoked to explore PL with all of you. • Why focus on functional programming? • Why use ML, Racket, and Ruby in particular? Why? • Not: Language X is better than Language Y [You won’t be tested on this stuff] PL helps us break free to think thoughts, ask questions, and solve problems that would otherwise be inaccessible. 15 16

  5. Summary • No such thing as a “best” PL • Fundamental concepts easier to teach in some (multiple) PLs What is the best kind of car? • A good PL is a relevant, elegant interface for writing software – There is no substitute for precise understanding of PL semantics What is the best kind of shoe? • Functional languages have been on the leading edge for decades – Ideas have been absorbed by the mainstream, but very slowly – First-class functions and avoiding mutation increasingly essential – Meanwhile, use the ideas to be a better C/Java/PHP hacker • Many great alternatives to ML, Racket, and Ruby, but each was chosen for a reason and for how they complement each other 17 18 Cars / Shoes More on cars Cars are used for rather different things: • A good mechanic might have a specialty, but also understands how “cars” (not a particular make/model) work – Winning a Formula 1 race – The upholstery color isn’t essential (syntax) – Taking kids to soccer practice – Off-roading • A good mechanical engineer really knows how cars work, how – Hauling a mattress to get the most out of them, and how to design better ones – Getting the wind in your hair (some of us … ) – I don’t have a favorite kind of car or a favorite PL – Staying dry in the rain • To learn how car pieces interact, it may make sense to start with Shoes: a classic design rather than the latest model – Playing frisbee – A popular car may not be best – Going to a formal – May especially not be best for learning how cars work – Going to the beach 19 20

  6. Why semantics and idioms Hamlet This course focuses as much as it can on semantics and idioms The play Hamlet : – Is a beautiful work of art Correct reasoning about programs, interfaces, and compilers – Teaches deep, eternal truths • requires a precise knowledge of semantics – Is the source of some well-known sayings – Not “I feel that conditional expressions might work like this” – Makes you a better person – Not “I like curly braces more than parentheses” – Much of software development is designing precise Continues to be studied centuries later even though: interfaces; what a PL means is a really good example – The syntax is really annoying to many – There are more popular movies with some of the same lessons • Idioms make you a better programmer – Reading Hamlet will not get you a summer internship – Best to see in multiple settings, including where they shine – See Java in a clearer light even if I never show you Java 21 22 All cars are the same Are all languages the same? • To make it easier to rent cars, it is great that they all have Yes: steering wheels, brakes, windows, headlights, etc. – Any input-output behavior implementable in language X is – Yet it is still uncomfortable to learn a new one implementable in language Y [Church-Turing thesis] – Can you be a great driver if you only ever drive one car? – Java, ML, and a language with one loop and three infinitely- large integers are “the same” Yes: • And maybe PLs are more like cars, trucks, boats, and bikes – Same fundamentals reappear: variables, abstraction, one-of types, recursive definitions, … • So are all PLs really the same … No: – The human condition vs. different cultures (travel to learn more about home) – The primitive/default in one language is awkward in another – Beware “the Turing tarpit” 23 24

  7. Functional Programming Ahead of their time All these were dismissed as “beautiful, worthless, slow things PL Why spend 60-80% of course using functional languages : professors make you learn” – Mutation is discouraged • Garbage collection (Java didn’t exist in 1995, PL courses did) – Higher-order functions are very convenient • Generics ( List<T> in Java, C#), much more like SML than C++ – One-of types via constructs like datatypes • XML for universal data representation (like Racket/Scheme/LISP/ … ) • Higher-order functions (Ruby, Javascript, C#, … ) Because: • Type inference (C#, Scala, … ) 1. These features are invaluable for correct, elegant, efficient software (great way to think about computation) • Recursion (a big fight in 1960 about this – I’m told J ) 2. Functional languages have always been ahead of their time • … 3. Functional languages well-suited to where computing is going Most of course is on (1), so a few minutes on (2) and (3) … 25 26 The future may resemble the past Recent-ish Surge, Part 1 Other popular functional PLs (alphabetized, pardon omissions) Somehow nobody notices we are right … 20 years later • Clojure http://clojure.org • Erlang http://www.erlang.org • “To conquer” versus “to assimilate” • F# http://tryfsharp.org • Haskell http://www.haskell.org • Societal progress takes time and muddles “taking credit” • OCaml http://ocaml.org • Scala http://www.scala-lang.org • Maybe pattern-matching, currying, hygienic macros, etc. will be next Some “industry users” lists (surely more exist): • http://www.haskell.org/haskellwiki/Haskell_in_industry • http://ocaml.org/companies.html • In general, see http://cufp.org 27 28

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend