DOC PREVIEW
UW CSE 341 - Course Introduction

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

'&$%CSE 341:Programming LanguagesDan GrossmanWinter 2008Lecture 1— Course IntroductionDan Grossman CSE341 Winter 2008, Lecture 1 1'&$%Welcome!We have 10 weeks to learn different paradigms and fundamentalconcepts of programming languages.With diligence, patience, and an open mind, this course makes you amuch better programmer (in languages we won’t use).Today in class:• Course mechanics• (A rain-check on motivation)• Dive into ML (homework 1 due Thursday January 17)In the next day or so:• Adjust class mail-list settings• Email homework 0 (worth 0 points) to mehttp://www.cs.washington.edu/education/courses/cse341/08wiDan Grossman CSE341 Winter 2008, Lecture 1 2'&$%Who and What• 3 class meetings (slides, code, and questions)– Material on-line (subject to change), but take notes.– Will try to make “e ssay versions” of lectures available.• 1 section (Ben Lerner)– Essential material on tools, style , examples, language-features,...• Office hours (Patrick Carroll, Ben, me)– Use them• Course “dictionary” (to be) online– To help with terminology; not tested; feedback welcomeDan Grossman CSE341 Winter 2008, Lecture 1 3'&$%TextbooksTexts are good, but take a fairly different approach to explainingthings:• That’s a good thing, for when my explanation doesn’t make sense.• But don’t be surprised when I essentially ignore the texts.• Ask questions about coverage, etc.• Some but not all of you will do fine without using the te xts.Dan Grossman CSE341 Winter 2008, Lecture 1 4'&$%Homeworks• Approximately weekly: with exams, probably 7 total• Doing the homework involves:1. Understanding the concepts being addressed2. Writing code demonstrating understanding of the concepts3. Testing your code to ensure you understand4. “Playing around” with variations, incorrect answers, etc .You turn in only (2), but focusing on (2) makes the home workharderChallenge Problems: Poor use of your time grade-wise, but greatotherwiseAssignments will be done individually.Dan Grossman CSE341 Winter 2008, Lecture 1 5'&$%Academic IntegrityRead every word of the course policy very carefully.Always explain any unconventional action on your part.Promoting and enforcing academic integrity has been a personal focusof mine for 14 years now:• I trust you complete ly• I have no sympathy for trust violations, nor should youHonest work is the most important feature of a university.Dan Grossman CSE341 Winter 2008, Lecture 1 6'&$%Exams• Midterm: Friday 8 February, in class• Final: Wednesday 19 March, 8:30–10:20Same concepts, but very different format from homework.• More conce ptual (but write code too)• Will post old examsDan Grossman CSE341 Winter 2008, Lecture 1 7'&$%Now where were we?Programming languages:• Essential concepts relevant in any language• Specific examples “in natural setting” using ML, Scheme, andRuby (where a concept m ost “s hines”)• Focus on “functional languages” because they are simpler, verypowerful, and teach good practice s– Often a great way to think, even if “stuck” in Java or C– Languages/concepts increasingly important to the “real world”First half of course uses ML:• Gives us time to build know ledge before “starting over”• But need to get comfortable with the basics as soon as possible• “Let go of Java” for now (we will return to it)Dan Grossman CSE341 Winter 2008, Lecture 1 8'&$%A strange environmentThe ML part of the course uses:• The emacs editor• A read-eval-print loop for evaluating programs• Available on Windows and UNIX in the lab, and remotely viaUNIXWe have prepared “getting started” materials, but leave plenty of timefor the content of homework 1.• Read the materials• Then ask questions fast (wasted hours are wasted hours)Adjusting to new environments is a “CS life skill”Dan Grossman CSE341 Winter 2008, Lecture 1 9'&$%Before we dive in, part 1We’ll return to the c ourse goals and “why learn something other thanC/C++/Java/Perl” at the end of next week.(There are many great reasons, too important for the first day.)Dan Grossman CSE341 Winter 2008, Lecture 1 10'&$%Before we dive in, part 2Scheduling note:• Unfortunately, Ben and I need to be out of town from Wednesdayafternoon until Sunday (this week only).• We will have lecture; Prof. Alan Borning will cover Friday.– (Has taught 341 ≥ 8 times.)• We w ill not have section this week.– Use the time to “get started” in the lab.• I’ll be in the time zone and should be fairly responsive to email.Dan Grossman CSE341 Winter 2008, Lecture 1 11'&$%ML, from the beginning• A program is a sequence of bindings• One kind of binding is a variable bindingval x = e ; (semicolon optional in a file)• A program is evaluated by evaluating the bindings in order• A variable binding is evaluated by:– Evaluating the expression in the environment created by theprevious bindings. This produces a value.– Extending the (top-level) environment to bind the variable tothe value.Much easier to understand with an example...Dan Grossman CSE341 Winter 2008, Lecture 1 12'&$%That was a lot at once• Values so far: integers, true, false, ()• Non-value expressions s o far: addition, subtraction, less than,conditionals• Types: every expression has a type. So far, int, bool, unit• The read-eval-print loop:– Enter a sequence of bindings. For each, it tells you the valueand type of the new binding– If you just enter e;, then that is t he same as val it = e;– use "foo.sml" enters the bindings from a file, and then bindsit to (), which has ty pe unit– Expressions that don’t type-check lead to (bad) error messagesand no change to the environmentDan Grossman CSE341 Winter 2008, Lecture 1 13'&$%Parts worth repeatingOur very simple program demonstrates many critical languageconcepts:• Expressions have a syntax (written form)– E.g.: A constant integer is written as a digit-sequence– E.g.: Addition express ion is writte n e1 + e2• Expressions have types given their context– E.g.: In any context, an integer has type int– E.g.: If e1 and e2 have type int in the current context, thene1+e2 has type int• Expressions ev aluate to values given their environment– E.g.: In any environment, an integer evaluates to itself– E.g.: If e1 and e2 evaluate to c1 and c2 in the currentenvironment, then e1+e2 evaluates to the sum of c1 and c2Dan Grossman CSE341 Winter 2008, Lecture 1 14'&$%More expression


View Full Document

UW CSE 341 - Course Introduction

Documents in this Course
Macros

Macros

6 pages

Macros

Macros

6 pages

Macros

Macros

3 pages

Mutation

Mutation

10 pages

Macros

Macros

17 pages

Racket

Racket

25 pages

Scheme

Scheme

9 pages

Macros

Macros

6 pages

Load more
Download Course Introduction
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Course Introduction and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Course Introduction 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?