cs 655: programming languages

32
CS 655: Programming Languages David Evans Office 236A, 982-2218 [email protected] http:// www.cs.virginia.edu/ ~evans University of Virginia Computer Science Lecture 1: Wherefore CS655? The use of <???> cripples the mind; its teaching should, therefore, be regarded as a criminal offence. Edsger W.Dijkstra, 1975

Upload: tamarr

Post on 08-Jan-2016

35 views

Category:

Documents


1 download

DESCRIPTION

CS 655: Programming Languages. Lecture 1:Wherefore CS655?. The use of cripples the mind; its teaching should, therefore, be regarded as a criminal offence. Edsger W.Dijkstra, 1975. David Evans Office 236A, 982-2218 [email protected] http://www.cs.virginia.edu/~evans. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 655: Programming Languages

CS 655: Programming Languages

David EvansOffice 236A, [email protected]://www.cs.virginia.edu/~evans

University of VirginiaComputer Science

Lecture 1:Wherefore CS655?

The use of <???> cripples the mind; its teaching should, therefore, be regarded as a criminal offence.

Edsger W.Dijkstra, 1975

Page 2: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 2

Menu

• Course Logistics: details on Syllabus• Goals for the Course• Course Overview, Programming Language

Design

Don’t leave until I take your picture!

Send registration email by tomorrow

Position Paper 1 due Monday.

Page 3: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 3

Resources• Staff:

– Instructor: David Evans [email protected] Hours (?): Monday 1:30-2:30,Thursdays after class

– TA: John Haskins, [email protected]

• Email: [email protected]• Web: http://www.cs.virginia.edu/~cs655

Page 4: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 4

Assignments• Assigned Readings • Position Papers (6 or 7)• Problem Sets (4)

– Technical questions, short answers, not much coding

• Project– Work in groups (2-4, solo projects only in unusual

circumstances)– List of ideas (projects/ideas.html)– Start thinking about this now – request teammates on

registration survey

• Oral Final Exam

Page 5: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 5

Position Papers

• Not book reports• Be provocative and interesting

– Should make claims reasonable people could disagree with

– Support your claims with technical arguments

• Writing clearly matters, writing clearly matters• Not longer than the Declaration of

Independence (see ~cs655/papers/paper-template.html)

Page 6: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 6

Position Papers Gradinggrade 0 { grade.value = 0 }

| modifiers { grade.value = modifiers.value }

modifiers { modifiers.value = 1 }

| + modifiers { modifiersL.value = modifiersR.value * 2 }

| - modifiers {modifiersL.value = modifiersR.value * 1/2 }

• Hard to get + (few per assignment), really hard to get ++ (few per term), etc.

• If unhappy with grade, can submit 1 page response. Grade can go up or down as a result.

Page 7: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 7

Position Papers Logistics

• Use HTML template• Turn in by emailing URL and copy of

contents to [email protected]

• Pay attention to weird due times:

First Position Paper is due Monday at 11:59pm.

Page 8: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 8

How to get an A in CS655

• “Easy” way: Convince an established language designer to make a substantive change to a programming language

• “Hard” wayCourse Project (30%) Position papers (30%)

Exam (20%) Problem Sets (20%)

Class Participation (0%, but important)

Page 9: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 9

Honor Code, Schmonor Code

• Learn from your fellow students – they are your best resource!

• Everything you turn in should be your own• Write down who you discussed assignments

with, all external sources you used• Be honest – you know what cheating is and

isn’t

Page 10: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 10

LogisticsQuestions

Next: My Goals for the Course

Page 11: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 11

Goal #1When you need to invent a language (and most of you will at some point in your career) you will design it, not just make it up.

Page 12: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 12

What’s the difference?

Designed Just Made Up

Examples Esperanto, CLU English, C++

Properties Predictable Unpredictable

Ways to do something

One Many

Users ~1M, 2.5 ~1B, ~1M

Moral? A bigger army beats good design every time

But, good designs can influence people with armies

Page 13: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 13

Goal #2When you design your language, you will have sufficient knowledge of other languages not to repeat their mistakes, and solid enough theory background to describe your language well.

Page 14: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 14

Goal #3You will become better at programming and building systems. You will think more clearly and maybe even write better.

A language that doesn't affect the way you think about programming, is not worth knowing.

Alan Perlis

Page 15: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 15

Goal #4Some of you will do projects that lead to conference papers or thesis topics. All of you will be able to understand nearly all PLDI papers and many POPL papers.

Page 16: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 16

Goal #5

FUN!

Page 17: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 17

Disclaimer

• Sorry, no refunds if not all goals are satisfied.

• Tell me your goals on the survey.

Page 18: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 18

Course Overview

• What is a programming language?

• What makes a language important?

• Design Tradeoffs

• Contents of the course

Page 19: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 19

What is a language?Webster:

A systematic means of communicating ideas or feelings by the use of conventionalized signs, sounds, gestures, or marks having understood meanings.

Nerdy Linguist’s Definition:

A description of pairs (S, M), where S stands for sound, or any kind of surface forms, and M stands for meaning. A theory of language must specify the properties of S and M, and how they are related.

Page 20: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 20

What is a Programming Language?• Bruce MacLellan’s definition:

A language that is intended for the expression of computer programs and that is capable of expressing any computer program.

• Ravi Sethi’s definition: Notations used for specifying, organizing, and reasoning about computations.

• Liberal definition:A language (according to the nerdy linguist’s definition) intended to be read and written by humans and processed by machines

Page 21: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 21

What makes a PL important?

Page 22: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 22

Amazon.com sales rank for best-selling book related to language(30 November 1999)

Java

Basic

C C+

+

Tcl

CO

BO

L

Eiffel

Pascal

Ad

a

Lisp

FO

RT

RA

N

HT

ML

100

1000

10000

100000

No books in print:Algol60, CLU, Simula

Lots of People Learn It

Page 23: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 23

Monster.com job listings in Virginia matching language(30 November 1999)

C++

Java

Basic

HTM

L

CO

BO

L Ada

Tcl

FO

RTR

AN

Pascal

1

10

100

1000

You Can Get a Job

No job listings:Algol60, CLU, Simula

Page 24: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 24

Changes How Programmers ThinkInfluences other Languages

• FORTRAN - use a high level language

• Algol60 - program in a structured way

• Simula - use classes

• CLU - use data abstraction

• FP - program without state

Page 25: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 25

Language Design as EngineeringSafety PerformanceJava, CLU FORTRAN, BLISS, C

Ease of Use Ease/size of ImplementationBASIC, CLU Forth, C

Orthogonality Safety, SimplicityAlgol68 Pascal

Simplicity Expressiveness Scheme Common LISP

Page 26: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 26

Example: Is assignment an expression?

• Wulf (BLISS): Of course, everything is

• Richie (C): Yes, why not

• Wirth (Pascal): No, only math-like things are expressions

Who’s right?What were their design tradeoffs?

Page 27: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 27

Language Design as Art

• Aesthetics matter • Readability is usually more important

than Writability– CLU vs. APL

• Intuitive meaning more important than formal semantics– But formal semantics necessary to make

sure we agree on intuitive meaning

Page 28: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 28

Language as Art: Example

HELLO: PROCEDURE OPTIONS (MAIN);

FLAG = 0; LOOP: DO WHILE (FLAG = 0); PUT SKIP DATA

('HELLO WORLD!'); END LOOP; END HELLO;

start_up = proc()

outstream:stream := primary_output()

for s:string in get_hello_world() do

stream$putl(outstream,s)

end

end

get_hello_world = iter() yields(string)

while (true) do yield ("Hello, World!") end

end

Page 29: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 29

Interaction of Art & EngineeringExample: C

void test (int x) {while (x = 1) {

printf (“I’m an imbecile!”); x = x + 1;

}}

Art: use = for assignment (not :=)Engineering: make assignments expressions,

no Boolean type, weak types, etc.

Page 30: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 30

Structure of the Course• Balance between:

– History: analyze programming languages according to design principles

– Theory: tools for analyzing and describing what programs mean

– Research: look at current research and discuss open problems

• Class as good as you make it:– Come to lecture prepared to discuss

readings

Page 31: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 31

Course Overview

• This course is not– A humanities course (though at times it

may seem like one)– A theory course (though at times it may

seem like one)– A “ripping on C++” course (though at times

it may seem like one)

• It is really about design

Page 32: CS 655: Programming Languages

20 Jan 2000 CS 655: Lecture 1 32

Charge

• Don’t leave until I take your picture

• Think about projects and teams

• Send me your registration survey by tomorrow

• Turn in position paper by Monday midnight - be bold!

• Next time: Intro to Semantics