1 / 19

CS2403 Programming Languages Course Outline

CS2403 Programming Languages Course Outline. Chung-Ta King Department of Computer Science National Tsing Hua University. (Slides are adopted from Concepts of Programming Languages , R.W. Sebesta; Modern Programming Languages: A Practical Introduction, A.B. Webber ). On Valentine’s Day.

landen
Download Presentation

CS2403 Programming Languages Course Outline

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. CS2403 Programming LanguagesCourse Outline Chung-Ta King Department of Computer Science National Tsing Hua University (Slides are adopted from Concepts of Programming Languages, R.W. Sebesta; Modern Programming Languages: A Practical Introduction, A.B. Webber)

  2. On Valentine’s Day • You want to impress your girl friend by baking a chocolate cake specifically for her.

  3. Ask the Chef!!!

  4. 巧克力蛋糕食譜 • 材料: • 1/2杯牛油 • 約120克黑巧克力 • 兩個雞蛋 • 兩個蛋黃 • 1/4杯砂糖 • 2茶匙中筋麵粉 • 步驟: • 預熱烤箱到230度。 • 將巧克力和牛油隔水融化。 • 攪拌雞蛋、蛋黃和糖至到顏色變淺。 • 混合巧克力和牛油,倒入蛋液中,加入麵粉,攪拌至完全融合。 • 把攪拌物倒入模具,放入烤箱烤6~7分鐘。 • 把模具翻轉到盤中,靜置15秒後脫模。可配上鮮奶油。

  5. Chocolate Cake Receipt • Materials: • 1/2 cup butter • 4 ounce bittersweet chocolate • 2 eggs • 2 egg yolks • 1/4 cup white sugar • 2 teaspoons all purpose flour • Step: • Preheat oven to 450°F. • Heat butter and chocolate until chocolate is almost melted. • Beat eggs, yolks and sugar until light colored and thick. • Mix chocolate and butter, and slowly pour into egg mixture, stirring constantly. Stir in flour until just combined. • Pour batter into molds and bake for 6 to 7 minutes. Invert molds on plates, let sit 15 seconds, and unmold. Serve with whipped cream.

  6. Receipt: 阿基師tells you how to make a chocolate cake Has inputs (butter, eggs, chocolate, flour, sugar) & output (chocolate cake) Define a procedure Instruct how processors (oven, mixer) process inputs to generate output Can be expressed in different languages Program: You tell a computer how to do a computation Has inputs and outputs Define a procedure (algorithm) Instruct how processors process inputs to generate outputs Can be expressed in different languages A Receipt Is Like a Program

  7. Questions • Given two languages, how do they differ in expressing the same receipt/algorithm? • Which language is better?  How to evaluate “goodness” of languages? • Why are there so many different languages? • What is “programming language” anyway? • Why does a programming language have so many different features? • How are these features implemented? • … Topics of this course

  8. A Programming Language Is … • An artificial language designed to express computations or algorithms that can be performed by a computer -- Wikipedia • A language is a means of expressing your thoughts to others • In the case of PL, it is a means of expressing your thoughts (algorithms) to a computer • Natural languages such as Chinese and English are not used because they cannot be easily translated into machine language executable by the computer   Keywords: expressiveness, implementation

  9. Why PL Important? • A language is a framework for problem-solving • It may facilitate or hinder your thoughts and, thus, the abilities to solve problems • It may help you make fewer mistakes • Example: tense and gender, e.g.“He was doing great!” in English • Example: a C language that supports only static and global variables  no malloc() • How to implement hash table? linked list? How to choose PL? (Ref.: John Mitchell, http://www.stanford.edu/class/cs242)

  10. Important to Know PL by Trend (TIOBE Programming Community)

  11. TIOBE

  12. Important to Know PL by Trend • Increasing use of type-safe languages: Java, C#, … • Scripting languages for web applications with increasing client-side functionality • More on expressing algorithms than syntax • Runtime environment and virtualization with continuous compilation, analysis, and checking • More program analysis abilities: automated error detection and recovery (Ref.: John Mitchell, http://www.stanford.edu/class/cs242)

  13. Important to Know PL by Tradeoffs Factors influencing programming language • Expressiveness: • Application domains • Programming methods: multiprogramming, interactive systems,… • Implementation: efficiency • Computer architecture, OS, toolchain, library • Every convenience has its cost; must recognize cost of presenting an abstract view of machine • Understand trade-offs in programming language design (Ref.: M. Sirjani, http://ut.ac.ir/classpages/ProgrammingLanguages)

  14. PL as a Course • What is not • Do not teach you a programming language • Do not teach you how to program • What is • Introduce fundamental concepts of programming languages • Discuss design issues of various language constructs • Examine design/implementation choices for these constructs • Compare design alternatives • Need to be familiar in at least one PL

  15. Why Study PL? • To improve your ability to develop effective algorithms and to use your language • O-O features, recursion • Call by value, call by reference • To allow a better choice of PL • Increased ability to learn new languages • To make it easier to design a new language • To understand significance of implementation • E.g. the efficiency of a recursive function

  16. Course Information • 教授: 金仲達 • 辦公室: 資電館443 分機: 42804 • email: king@cs.nthu.edu.tw • 助教: • 陳志中、劉正芝 • 上課時間: • 週一13:10–15:00 • 週四13:10–14:00 • 上課地點: CSEE131 • http://www.cs.nthu.edu.tw/~king/courses/cs2403.html

  17. Textbook • Concepts of Programming Languages, Robert W. Sebesta, 9th Edition, Addison Wesley, 2009 • Describing Syntax and Semantics • Names, Bindings, and Scopes • Data Types • Expressions and Assignment • Control Structures • Subprograms • Abstract Data Types, Encapsulation • Concurrency • Exception Handling and Event Handling • Functional and Logic Programming Languages

  18. Expected Workload • Assignments: • Expect one assignment every two weeks, including programming assignments • Grade breakdown • Assignments 50% • Examinations 45% • Class participation 5%

  19. Course Problems • Cannot make examinations • Tell us early and we will schedule makeup • Cannot turn in homework on time • No late homework is accepted • What is cheating? • Study together in groups is encouraged • Work must be your own

More Related