DOC PREVIEW
UW CSE 341 - Lecture 1— 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 GrossmanSpring 2008Lecture 1— Course IntroductionDan Grossman CSE341 Spring 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 April 10)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/08spDan Grossman CSE341 Spring 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 “essay versions” of lectures available.• 1 section (Matthew Kehrt)– Essential material on tools, style, examples, language-features,...• Office hours (Jeff Prouty, Matthew, me)– Use themDan Grossman CSE341 Spring 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.• Do not cover the key concepts much if at all.Will try to post lecture summaries for most lectures — no promises socome to class.Dan Grossman CSE341 Spring 2008, Lecture 1 4'&$%Homeworks• Approximately weekly: with exams, 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 homeworkharderChallenge Problems: Low points/difficulty ratioAssignments will be done individually.Dan Grossman CSE341 Spring 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 completely• I have no sympathy for trust violations, nor should youHonest work is the most important feature of a university.Dan Grossman CSE341 Spring 2008, Lecture 1 6'&$%Exams• Midterm: Wednesday 30 April, in class• Final: Wednesday 11 June, 8:30–10:20Same concepts, but very different format from homework.• More conceptual (but write code too)• Will post old examsDan Grossman CSE341 Spring 2008, Lecture 1 7'&$%Morning• If you can get here at 9:35, you can get here at 9:28.• The first 5 minutes are often the most important.• If arriving late or missing class is a good use of your time, thenI’m doing something wrong.Dan Grossman CSE341 Spring 2008, Lecture 1 8'&$%Now where were we?Programming languages:• Essential concepts relevant in any language• Specific examples “in natural setting” using ML, Scheme, andRuby (where a concept most “shines”)• Focus on “functional languages” because they are simpler, verypowerful, and teach good practices– 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 knowledge 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 Spring 2008, Lecture 1 9'&$%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 Spring 2008, Lecture 1 10'&$%Before we dive in, part 1We’ll return to the course 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 Spring 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 Spring 2008, Lecture 1 12'&$%That was a lot at once• Values so far: integers, true, false, ()• Non-value expressions so 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 the same as val it = e;– use "foo.sml" enters the bindings from a file, and then bindsit to (), which has type unit– Expressions that don’t type-check lead to (bad) error messagesand no change to the environmentDan Grossman CSE341 Spring 2008, Lecture 1 13'&$%Parts worth repe atingOur 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 expression is written 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 evaluate 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 Spring 2008, Lecture 1 14'&$%More expression formsWhat are the syntax-rules, typing-rules, and evaluation-rules for:• variables• less-than comparisons• conditional expressionsDan Grossman CSE341 Spring 2008, Lecture 1 15'&$%Lots more to doWe


View Full Document

UW CSE 341 - Lecture 1— 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 Lecture 1— 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 Lecture 1— 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 Lecture 1— 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?