計算機科學(xué)分類programming languages編程語言lec1slides_第1頁
計算機科學(xué)分類programming languages編程語言lec1slides_第2頁
計算機科學(xué)分類programming languages編程語言lec1slides_第3頁
計算機科學(xué)分類programming languages編程語言lec1slides_第4頁
計算機科學(xué)分類programming languages編程語言lec1slides_第5頁
已閱讀5頁,還剩28頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、CSE341: Programming LanguagesLecture 1Course MechanicsML Variable BindingsDan GrossmanSpring 2013 e!We have 10 weeks to learn the fundamental concepts of programming languagesWith hard work, patience, and an open mind, this course makes you a much better programmerEven in languages we wont useLearn

2、the core ideas around which every language is built, despite countless surface-level differences and variationsPoor course summary: “Uses ML, Racket, and Ruby”Todays class:Course mechanicsA rain-check on motivationDive into ML: Homework 1 due Wednesday of next weekSpring 20132CSE341: Programming Lan

3、guagesConcise to-do listIn the next 24-48 hours:Read course web page: Read all course policies (4 documents on web page)Adjust class email-list settings as necessaryComplete Homework 0 (survey worth 0 points)Get set up using Emacs and MLInstallation/configuration/use instructions on web pageEssentia

4、l; non-intellectualNo reason to delay!Spring 20133CSE341: Programming LanguagesWho: Course StaffSpring 20134CSE341: Programming LanguagesDan Grossman: Faculty, 341 my favorite course / area of expertiseTA: Amaris ChenTA: Patrick LarsonTA: Josiah AdamsGet to know us!Staying in touchCourse email list:

5、 cse341a_Students and staff already subscribedYou must get announcements sent thereFairly low trafficCourse staff: plus individual emailsMessage BoardFor appropriate discussions; TAs will monitorOptional, wont use for important announcementsAnonymous

6、 feedback link on webpageFor good and bad: If you dont tell me, I dont knowSpring 20135CSE341: Programming LanguagesLecture: DanSlides, code, and reading notes / videos postedMay be revised after classTake notes: materials may not describe everythingSlides in particular are visual aids for me to use

7、Ask questions, focus on key ideasEngage activelyArrive punctually (beginning matters most!) and well-restedJust like you will for the midterm!Write down ideas and code as we goIf attending and paying attention is a poor use of your time, one of us is doing something wrongSpring 20136CSE341: Programm

8、ing LanguagesSectionRequired: will usually cover new materialSometimes more language or environment detailsSometimes main ideas needed for homeworkWill meet this week: using Emacs and MLMaterial often also covered in reading notes / videosSpring 20137CSE341: Programming LanguagesReading Notes and Vi

9、deosPosted for each “course unit:” reading notes and videos that go over most (all?) of the material (and some extra stuff?)So why come to class?Because having these materials lets us make class-time much more usefulAnswer your questions without being rushed because occasionally “didnt get to X; rea

10、d about it”Can point to occasional optional topics/videosCan try different things in class, not just recite thingsSpring 20138CSE341: Programming LanguagesTextbooks, or lack thereofWill treat the “textbooks” as optional, possibly useful referencesLook up details you want/need to know, but often in f

11、ree online resources tooCan provide second explanations, but (because!) they often take a fairly different approachIf “Dans view” confuses you, lecture, reading notes, and video might all confuse youSome topics arent in the textsDont be surprised when I essentially ignore the textsList on web page w

12、hat sections are most relevantMost but maybe not all of you will do fine without the textsWould love your feedback on if/how they are usefulSpring 20139CSE341: Programming LanguagesOffice hoursRegular hours and locations on course web soonChanges as necessary announced on email listUse themPlease vi

13、sit meIdeally not just for homework questions (but thats good too)Spring 201310CSE341: Programming LanguagesHomeworkSeven totalTo be done individuallyDoing the homework involves:Understanding the concepts being addressedWriting code demonstrating understanding of the conceptsTesting your code to ens

14、ure you understand and have correct programs“Playing around” with variations, incorrect answers, etc.Only (2) is graded, but focusing on (2) makes homework harderChallenge problems: Low points/difficulty ratioSpring 201311CSE341: Programming LanguagesNote my writing styleHomeworks tend to be worded

15、very precisely and conciselyIm a computer scientist and I write like one (a good thing!)Technical issues deserve precise technical writingConciseness values your time as a readerYou should try to be precise tooSkimming or not understanding why a word or phrase was chosen can make the homework harder

16、By all means ask if a problem is confusingBeing confused is normal and understandableAnd I may have made a mistakeOnce youre unconfused, you might agree the problem wording didnt cause the confusionSpring 201312CSE341: Programming LanguagesAcademic IntegrityRead the course policy carefullyClearly ex

17、plains how you can and cannot get/provide help on homework and projectsAlways explain any unconventional actionI have promoted and enforced academic integrity since I was a freshmanGreat trust with little sympathy for violationsHonest work is the most important feature of a universitySpring 201313CS

18、E341: Programming LanguagesExamsMidterm: Friday May 3, in classFinal: Thursday June 13, 8:30-10:20Yes, late in finals weekYes, you have to be hereNo, this was not my choiceSame concepts, but different format from homeworkMore conceptual (but write code too)Will post old examsClosed book/notes, but y

19、ou bring one sheet with whatever you want on itSpring 201314CSE341: Programming LanguagesCoursera (more info in document)Ive taught this material to thousands of people around the worldA lot of work and extremely rewardingYou are not allowed to participate in that class!Do not web-search related to

20、homework problems!This should have little impact on youTwo courses are separate341 is a great class and staff is committed to this offering being the best everBut this is an exciting new thing you are likely curious aboutSpring 201315CSE341: Programming LanguagesMore CourseraWhy are we doing this?Da

21、ns answers: Have more impact (like a textbook)Experiment with where higher-ed might be goingCSE / UW answers: Gain experience, be leadersSo why are you paying tuition?Personal attention from humansHomeworks/exams with open-ended questionsClass will adjust as neededWe can be sure you actually learned

22、Course is part of a coherent curriculumBeyond the classroom: job fairs, advisors, social, Spring 201316CSE341: Programming LanguagesWill Coursera help/hurt 341?Biggest risks es easier to cheat dont!I e too resistant to change hope not!There are benefits tooThe videosMore robust grading scriptsEasier

23、 software installation (new SML Mode)Taking the “VIP version” of a more well-known courseChange the world to be more 341-friendlySpring 201317CSE341: Programming LanguagesQuestions?Anything I forgot about course mechanics before we discuss, you know, programming languages?Spring 201318CSE341: Progra

24、mming LanguagesWhat this course is aboutMany essential concepts relevant in any programming language And how these pieces fit togetherUse ML, Racket, and Ruby languages:They let many of the concepts “shine”Using multiple languages shows how the same concept can “l(fā)ook different” or actually be slight

25、ly differentIn many ways simpler than JavaBig focus on functional programmingNot using mutation (assignment statements) (!)Using first-class functions (cant explain that yet)But many other topics tooSpring 201319CSE341: Programming LanguagesWhy learn this?This is the “normal” place for course motiva

26、tionWhy learn this material?But in my experience, we dont have enough shared vocabularySo 3-4 week delay on motivation for functional programmingI promise full motivation: delay is worth it(Will motivate immutable data at end of “Unit 1”)Spring 201320CSE341: Programming LanguagesMy claimLearning to

27、think about software in this “PL” way will make you a better programmer even if/when you go back to old waysIt will also give you the mental tools and experience you need for a lifetime of confidently picking up new languages and ideasSomewhat in the style of The Karate Kid movies (1984, 2010)Spring

28、 201321CSE341: Programming LanguagesA strange environmentNext 4-5 weeks will useML languageEmacs editorRead-eval-print-loop (REPL) for evaluating programsYou need to get things installed and configuredEither in the department labs or your own machineWeve written thorough instructions (questions e)On

29、ly then can you focus on the content of Homework 1Working in strange environments is a CSE life skillSpring 201322CSE341: Programming LanguagesMindset“Let go” of all programming languages you already knowFor now, treat ML as a “totally new thing”Time later to compare/contrast to what you knowFor now

30、, “oh that seems kind of like this thing in Java” will confuse you, slow you down, and you will learn lessStart from a blank fileSpring 201323CSE341: Programming LanguagesA very simple ML programThe same program we just wrote in Emacs; here for convenience if reviewing the slidesSpring 201324CSE341:

31、 Programming Languages(* My first ML program *)val x = 34;val y = 17;val z = (x + y) + (y + 2);val q = z + 1;val abs_of_z = if z 0 then 0 z else z;val abs_of_z_simpler = abs zA variable bindingSyntax:Keyword val and punctuation = and ;Variable xExpression e Many forms of these, most containing subex

32、pressionsSpring 201325CSE341: Programming Languagesval z = (x + y) + (y + 2); (* comment *)More generally: val x = e; The semanticsSyntax is just how you write somethingSemantics is what that something meansType-checking (before program runs)Evaluation (as program runs)For variable bindings:Type-che

33、ck expression and extend static environmentEvaluate expression and extend dynamic environmentSo what is the precise syntax, type-checking rules, and evaluation rules for various expressions? Good question!Spring 201326CSE341: Programming LanguagesML, carefully, so farA program is a sequence of bindi

34、ngsType-check each binding in order using the static environment produced by the previous bindingsEvaluate each binding in order using the dynamic environment produced by the previous bindingsDynamic environment holds values, the results of evaluating expressionsSo far, the only kind of binding is a

35、 variable bindingMore soonSpring 201327CSE341: Programming LanguagesExpressionsWe have seen many kinds of expressions:34 true false x e1+e2 e1e2 if e1 then e2 else e3Can get arbitrarily large since any subexpression can contain subsubexpressions, etc. Every kind of expression hasSyntaxType-checking

36、rulesProduces a type or fails (with a bad error message )Types so far: int bool unitEvaluation rules (used only on things that type-check)Produces a value (or exception or infinite-loop)Spring 201328CSE341: Programming LanguagesVariablesSyntax: sequence of letters, digits, _, not starting with digitType-checking: Look up type in current static environmentIf not there failEvaluation: Look up value in current dynamic environmentSpring 201329CSE341: Programming Languag

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論