Similar documents

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

San José State University College of Science/Department of Computer Science CS 152, Programming Language Paradigms, Section 03/04, Fall, 2018

Introduction to Security

CS152 Programming Language Paradigms Prof. Tom Austin, Fall Syntax & Semantics, and Language Design Criteria

CS/SE 153 Concepts of Compiler Design

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

last time in cs recitations. computer commands. today s topics.

CS 3304 Comparative Languages. Lecture 1: Introduction

CMPE 152 Compiler Design

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

CS/SE 153 Concepts of Compiler Design

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Course and Contact Information. Course Description. Course Objectives

CS Computer Science I

CMPE 152 Compiler Design

Com S 541. Programming Languages I

Welcome to CS 135 (Winter 2018)

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

Functional Programming Lecture 1: Introduction

CMPE 152 Compiler Design

CSC 111 Introduction to Computer Science (Section C)

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

CS 3110 Lecture 1 Course Overview

CS61A Lecture 1. Amir Kamil UC Berkeley January 23, 2013

CSE 114, Computer Science 1 Course Information. Spring 2017 Stony Brook University Instructor: Dr. Paul Fodor

Welcome to CS 135 (Fall 2018) Themes of the course. Lectures. cs135/

You must pass the final exam to pass the course.

Programming Languages 2nd edition Tucker and Noonan"

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

Class Structure. Prerequisites

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

TTh 9.25 AM AM Strain 322

CSci 4211: Data Communications and Computer Networks. Time: Monday and Wednesday 1 pm to 2:15 pm Location: Vincent Hall 16 Spring 2016, 3 Credits

WELCOME TO CS 16! Problem Solving with Computers-I

what is an algorithm? analysis of algorithms classic algorithm example: search

San José State University Computer Science Department CS49J, Section 3, Programming in Java, Fall 2015

San José State University Computer Science Department CS157A: Introduction to Database Management Systems Sections 5 and 6, Fall 2015

CSci 4211: Introduction to Computer Networks. Time: Monday and Wednesday 2:30 to 3:45 pm Location: Smith Hall 231 Fall 2018, 3 Credits

CS 170 Java Programming 1. Week 7: More on Logic

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Concepts of Programming Languages

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

CS 536. Class Meets. Introduction to Programming Languages and Compilers. Instructor. Key Dates. Teaching Assistant. Charles N. Fischer.

Introduction to Computer Systems

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

CS457/557 Functional Languages

Administration Computers Software Algorithms Programming Languages

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Computer Science II Data Structures

Introduction to Data Structures

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

CSC Operating Systems Fall Lecture - I Introduction. Tevfik Ko!ar. Louisiana State University. August 25 th, Contact Information

Homework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017

Course and Contact Information. Course Description. Course Objectives

CS 4349 Lecture August 21st, 2017

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CS 242. Fundamentals. Reading: See last slide

San José State University College of Science/Department of Computer Science CS152, Programming Paradigms, Sections 3 & 4, Fall Semester, 2016

Chapter 6 Control Flow. June 9, 2015

printf( Please enter another number: ); scanf( %d, &num2);

Introduction to Nate Foster Spring 2018

Principles of Programming Languages. Lecture Outline

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current

Modules, Structs, Hashes, and Operational Semantics

Programming Language Concepts, cs2104 Lecture 01 ( )

CS1 Lecture 3 Jan. 18, 2019

by the evening of Tuesday, Feb 6

Functional Languages. Hwansoo Han

Part (04) Introduction to Programming

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COSE212: Programming Languages. Lecture 0 Course Overview

CS 314 Principles of Programming Languages

San José State University College of Science/Department of Computer Science CS152, Programming Paradigms, Sections 1 & 2, Fall Semester, 2017

CS 140 Programming with Objects

Chapter 4C Homework Functions III Individual Assignment 30 Points Questions 6 Points Script 24 Points

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

This exam is worth 30 points, or 18.75% of your total course grade. The exam contains

ENGR 105: Introduction to Scientific Computing. Dr. Graham. E. Wabiszewski

CSSE 304 Assignment #13 (interpreter milestone #1) Updated for Fall, 2018

CPSC 213. Introduction to Computer Systems. About the Course. Course Policies. Reading. Introduction. Unit 0

CS Exam #1-100 points Spring 2011

Welcome (back) to CS1007!

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

Languages and Compilers

CS61A Discussion Notes: Week 11: The Metacircular Evaluator By Greg Krimer, with slight modifications by Phoebus Chen (using notes from Todd Segal)

San José State University Department of Computer Science CS-174, Server-side Web Programming, Section 2, Spring 2018

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

Announcements. 1. Forms to return today after class:

CPSC 213. Introduction to Computer Systems. Introduction. Unit 0

Principles of Compiler Construction ( )

Welcome to CS 115 (Winter 2019)

CS 113: Introduction to

(Provisional) Lecture 08: List recursion and recursive diagrams 10:00 AM, Sep 22, 2017

CSE : Python Programming

Transcription:

http://xkcd.com/224/

CS 152: Programming Language Paradigms Prof. Tom Austin San José State University

What are some programming languages?

Taken from http://pypl.github.io/pypl.html January 2016

Why are there so many?

Different domains

Different design choices Flexibility Type safety Performance Build time Concurrency

Which language is better?

Good language features Simplicity Readability Learn-ability Safety Machine independence Efficiency

These goals almost always conflict

Conflict: Type Systems Stop "bad" programs but... restrict the programmer

Why do we make you take a programming languages course? You might use one of these languages. Perhaps one of these languages is the language of the future (whatever that means). You might see similar languages in your job. Somebody made us take one, so now we want to make you suffer too. But most of all

We want to warp your minds.

Course goal: change the way that you think about programming. That will make you a better Java programmer.

The "Blub" paradox Why do I need higher order functions? My language doesn't have them, and it works just fine!!!

"As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down [Blub programmers are] satisfied with whatever language they happen to use, because it dictates the way they think about programs." --Paul Graham http://www.paulgraham.com/avg.html

So what kind of abstractions do different languages give us?

Data Abstractions Representation of common data values Variables to represent memory locations. Structures: arrays, text files, etc. Organizational units: APIs packages classes

Control Abstractions "Syntactic sugar" x+=10 => x=x+10 Branch instructions if statements while loops

A little history WWII: programming meant plugboards

Von Neumann (late 1940s) created a permanently hardwired general purpose instruction set. A small, machine language program

Assembly (1950s) Translates mnemonic symbols to machine instructions. Not a higher level just easier for humans to read. mov ax, 1234h mov bx, ax

Higher-level languages Fortran (1950s): Algebraic notation, floating point math Algol (1960): Machine independence (via compiler) Control structures: loops, procedures, if statements Formal specification

Does a formal specification matter?

Languages we will cover (subject to change)

Administrative Details Green sheet: http://www.cs.sjsu.edu/~austin/cs152-fall16/ Greensheet.html. Homework submitted through Canvas: https://sjsu.instructure.com/ Academic integrity policy: http://info.sjsu.edu/static/catalog/integrity.html

Schedule The class schedule is available through Canvas Late homeworks will not be accepted Check the schedule before every class Check the schedule before every class And finally, CHECK THE SCHEDULE BEFORE EVERY CLASS.

Prerequisites CS 151 or CMPE 135, grade C- or better Show me proof If you don't, I will drop you.

Resources Dorai Sitaram "Teach Yourself Scheme in Fixnum Days". http://ds26gte.github.io/tyscheme/ Other references TBD.

Grading 30% -- Homework assignments (individual work) 20% -- Class project (team work) 20% -- Midterm 20% -- Final 10% -- Participation (labs and drills)

Participation: Labs & Drills Complete/incomplete No feedback given (usually) I will look at them If you have questions, ask me

Homework Done individually. You may discuss the assignment with others. Do your own work!

How to fail yourself and your friend If two of you turn in similar assignments: you both get a 0

Project Work in groups of up to four people. Goal: Build an interpreter. Use Java and ANTLR

Office hours MacQuarrie Hall room 216 Mondays, noon-1pm Thursdays, 11am-noon

Racket/ Scheme

What is Scheme? A functional language Describe what things are, not how to do them. More mathematical compared to imperative langs. A dialect of Lisp (List Processing) (Famously) minimal language Racket is a dialect of Scheme

Symbolic Expressions (s-expressions) The single datatype in Scheme. Includes: Primitive types: booleans, numbers, characters, and symbols. Compound data types: strings, vectors, pairs, and of course LISTS!!!

A bit of scheming Sample list: '(1 2 3 4) The quote declares this list as data First argument is assumed to be a function Rest of the list are its arguments (* 4 3 2 1) car: gets the first element of the list cdr: gets the tail of the list.

$ racket Welcome to Racket v6.0.1. > '(1 2 3 4) '(1 2 3 4) > (car '(1 2 3 4)) 1 > (cdr '(1 2 3 4)) '(2 3 4) > (+ 1 (* 2 4) (- 5 1)) 13 > Quote indicates list is data First element is assumed to be a function

Before next class Install Racket from http://racket-lang.org/ Read chapters 1-2 of Teach Yourself Scheme. Read Paul Graham's "Beating the Averages" article. http://www.paulgraham.com/avg.html

First homework due September 8th This assignment is designed to get you up and running with Racket. Available in Canvas. If you don't have access to Canvas, see http://www.cs.sjsu.edu/~austin/cs152- fall16/hw/hw1/ instead. Get started now!