1 / 28

Programming Languages

Programming Languages. Xiaojuan Cai http://basics.sjtu.edu.cn/~xiaojuan/pl2014/. Do you know. how many programming languages in the world?. how to choose the most appropriate language for some given task?. There are strange(wierd) programming languages 99 Bottles of Beer.

tommy
Download Presentation

Programming Languages

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. Programming Languages • Xiaojuan Cai • http://basics.sjtu.edu.cn/~xiaojuan/pl2014/

  2. Do you know • how many programming languages in the world? • how to choose the most appropriate language for some given task? • There are strange(wierd) programming languages99 Bottles of Beer http://en.wikipedia.org/wiki/List_of_programming_languages

  3. Welcome to the world of PL!

  4. Roadmap • Why study PL? • Course overview • Policy

  5. What is the best kind of car? Cars are used for rather different things: • Winning a Formula 1 race • Taking kids to soccer practice • Hauling a mattress • Getting the wind in your hair • Staying dry in the rain

  6. More on cars • A good mechanic might have a specialty, but also understands how “cars” (not a particular make/model) work • The upholstery color isn’t essential (syntax) • A good mechanical engineer really knows how cars work, how to get the most out of them, and how to design better ones

  7. More on cars • To learn how car pieces interact, it may make sense to start with a classic design rather than the latest model • A popular car may not be best • May especially not be best for learning how cars work

  8. Are all cars the same? • They all have steering wheels, brakes, windows, headlights, etc. • still uncomfortable to learn a new one • Can you be a great driver if you only ever drive one car? • And maybe PLs are more like cars, trucks, boats, and bikes • So are all PLs really the same…

  9. Are all languages the same? Yes: • Any input-output behavior implementable in language X is implementable in language Y [Church-Turing thesis] • Java, ML, and a language with one loop and three infinitely-large integers are “the same” Yes: • Same fundamentals reappear: variables, abstraction, one-of types, recursive definitions, … No: • The primitive/default in one language is awkward in another

  10. Why study PL 1. Learning to think about software in “PL” way will make you a better programmer 2. It will also give you the mental tools and experience you need for a lifetime of confidently picking up new languages and ideas

  11. Why study PL Good languages make it easier to establish, verify, and maintain the relationship between code and its properties. —Robert Harper An ideal language allows us to express easily what is useful for the programming task and at the same time makes it difficult to write what leads to incomprehensible or incorrect programs. —Nico Habermann

  12. Roadmap • Why study PL? • Course overview • Policy

  13. Five different things 1. Syntax: How do you write language constructs? 2. Semantics: What do programs mean? (Evaluation rules) 3. Idioms: What are typical patterns for using language features to express your computation? 4. Libraries: What facilities does the language (or a well-known project) provide “standard”? (E.g., file access, data structures) 5. Tools: What do language implementations provide to make your job easier? (E.g., REPL, debugger, code formatter, …) These are 5 separate issues • In practice, all are essential for good programmers • Many people confuse them, but shouldn’t

  14. Our Focus This course focuses on semantics and idioms • Syntax is usually uninteresting • Libraries and tools crucial, but often learn new ones “on the job” • We are learning semantics and how to use that knowledge to understand all software and employ appropriate idioms • By avoiding most libraries/tools, our languages may look “silly” but so would any language used this way

  15. Course overview Special thanks to Prof. Dan Grossman. Programming languages Coursera by Dan Grossman(about 65,000 people registered this course) Dan Grossman Professor, University of Washington

  16. Course data(Coursera, Jan 2013 session, provided by Prof. Grossman • “Registered”: 65,000 totally irrelevant • Clicked play in first 2 weeks: 27,000 • Watched an hour of video: 12,000 like coming to first day? • Turned in 1st homework: 4,000 • Turned in 5th homework: 2,100 attrition doesn’t stop • “Passed”: 1,716 • Fan mail/posts: 300 • Consistent with “hard” course in Coursera!

  17. Course overview • Many essential concepts relevant in any programming language • And how these pieces fit together • Big focus on functional programming • Not using mutation (assignment statements) (!) • Using first-class functions (can’t explain that yet) • But many other topics too

  18. Course overview • Use ML, Racket, and Ruby languages: • They let many of the concepts“shine” • Using multiple languages shows how the same concept can “look different” or actually be slightly different (comparison) • In many ways simpler than Java, C#, Python, …

  19. Roadmap • Why study PL? • Course overview • Policy

  20. Instructor and TAs • 蔡小娟 (Instructor)Office: Software building 1210Email: cxj@sjtu.edu.cn • 靳阳 (for graduates)Office: Dianxin building 3-329Email: jyjz2008@sjtu.edu.cn • 马晓明 (for undergraduates)Office: Software buildingEmail: xinj2012sjtu@sjtu.edu.cn

  21. First things we need to do • Roster • Mini-course (about 5-10min for one PL, everyone has this chance!) • Recitation section – by group(8 groups for 7 assignments and 1 midexam)

  22. Roster sample

  23. Policy • Final score = 30% mid exam + 40% final exam + 30% otherwhereother = 70% homework + 15% mini-course + 15% recitation section • Exams cover topics harder to re-enforce with “just programming” because this is not just a programming course

  24. More on homework • 7 assignments • Challenge problems: Low points/difficulty ratio • Doing the homework involves: Understanding the concepts being addressed Writing code demonstrating understanding of the concepts Testing your code to ensure you understand and have correct programs “Playing around” with variations, incorrect answers, etc. Only (2) is graded, but focusing on (2) makes homework harder

  25. More on homework • Every word you submit should be your own! • Cheating: copy codes from other sources. You will directly get a fail score. • Maybe we will have a auto-grading system (still under construction)

  26. More on mini-course • You can talk anything about the language:history? who invented it? why? some stories? paradigm? what “hello world” program looks like? what it famous for? what tasks it good for? .... • Try to make it fun and make us remember your language!!!

  27. More on recitation section • When: in one week after the homework deadline, or mid-exam • What: review topics we have learnt, explain the solutions of homework especially on those that most students go wrong. • How: read and analyze the submitted codes together with TAs, make slides if necessary.

  28. “Sleep now, Dreams will come out; Study now, Dreams will come true.” -- selected from Allocutions on the Wall of the Harvard University Library

More Related