Preliminaries. 1. Preliminaries 1.1 Administration. 1.2 Motivation 1.3 Hello, World!

Similar documents
Programming Languages (CS )

CSCI 3136 Principles of Programming Languages

CS : Programming Languages

Concepts in Programming Languages

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

Com S 541. Programming Languages I

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

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

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

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2015 Euiseong Seo

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

Seminar in Programming Languages

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

CSc 372 Comparative Programming Languages

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

Programming Languages 1. Introduction. Oscar Nierstrasz

Programming Languages 2nd edition Tucker and Noonan"

Programming Languages, Summary CSC419; Odelia Schwartz

! Broaden your language horizons. ! Study how languages are implemented. ! Study how languages are described / specified

What is a programming language?

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

Anders Møller Michael Schwartzbach Erik Ernst Hans Hüttel

CSE341: Programming Languages Lecture 26 Course Victory Lap. Dan Grossman Spring 2016

Introduction. COMP 524: Programming Language Concepts Björn B. Brandenburg. The University of North Carolina at Chapel Hill

CS 6371: Advanced Programming Languages

CS2303 C14 Systems Programming Concepts. Bob Kinicki

Programming Languages (CS )

CS 242. Fundamentals. Reading: See last slide

Introduction to Computer Science I

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

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CSCI 565 Compiler Design and Implementation Spring 2014

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

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

IA010: Principles of Programming Languages

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

CS A331 Programming Language Concepts

Today. An Animated Introduction to Programming. Prerequisites. Computer programming

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

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

Low-Level Languages. Computer Programs and Programming Languages

CS Compiler Construction West Virginia fall semester 2014 August 18, 2014 syllabus 1.0

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE : Fall 2017

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Announcements Tues., Aug and 2. to call them ( ) ! For next time, read Learning Computing with Robots, chs.

CSE 504: Compiler Design

COMP 201: Principles of Programming

Programming Languages


cmpt 440/821 Advanced Topics in Programming Languages

Concepts of Programming Languages

Programming for Engineers in Python

Introduction. A. Bellaachia Page: 1

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE 130 : Fall 2013

Programming Languages

Compiler Construction

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

Lecture 1: Introduction. 23. August, 2010

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Introduction to Nate Foster Spring 2018

Programming (Econometrics)

MIDTERM EXAMINATION - CS130 - Spring 2005

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

(0) introduction to the course. how to learn a programming language. (0) course structure

COSE212: Programming Languages. Lecture 0 Course Overview

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

Compiler Design Spring 2018

CS Exam #1-100 points Spring 2011

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

understanding recursive data types, recursive functions to compute over them, and structural induction to prove things about them

CS 3304 Comparative Languages. Lecture 1: Introduction

Programming (ERIM) Lecture 1: Introduction to programming paradigms and typing systems. Tommi Tervonen

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE 130 : Fall 2014

CS 415 Midterm Exam Spring 2002

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Programmiersprachen (Programming Languages)


Topic 1: Introduction

What is programming? Elements of Programming Languages. From machine code to programming languages. What is a programming language?

G COURSE PLAN ASSISTANT PROFESSOR Regulation: R13 FACULTY DETAILS: Department::

Artificial Intelligence Lecture 1

Compulsory course in Computer Science

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

CS 314 Principles of Programming Languages

Welcome to Introduction to Computer Science I

Discovering Computers 2008

CS 102 Lecture 1. Syllabus, history, intro

SOFTWARE ARCHITECTURE 6. LISP

CS 3813/718 Fall Python Programming. Professor Liang Huang.

Language Translation, History. CS152. Chris Pollett. Sep. 3, 2008.

CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall Office hours:

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

COSC 2P90 Programming Languages & Object-Orientation

PLAGIARISM. Administrivia. Compilers. CS143 11:00-12:15TT B03 Gates. Text. Staff. Instructor. TAs. Office hours, contact info on 143 web site

Lecture 1: Course Introduction

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Philadelphia University Faculty of Information Technology Department of Computer Science --- Semester, 2007/2008. Course Syllabus

COURSE DESCRIPTION FORM. Level Credits Periods/ Week Prerequisites

Transcription:

Section 1 Preliminaries 1. Preliminaries 1.1 Administration 1.2 Motivation 1.3 Hello, World!

1.1. Administration Where are we? 1. Preliminaries 1.1. Administration 1. Preliminaries 1.1 Administration 1.2 Motivation 1.3 Hello, World! J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 1.1

Instructors 1.1. Administration Prof. Yossi Gil: Office hours: http://yogi.youcanbook.me Mail: mailto:yogi@cs.technion.ac.il Dr. Sara Porat: Office hours: Wednesday 14:30 15:30; Taub 717 Mail: mailto:porat@cs.technion.ac.il J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 1/11

Teaching assistants 1.1. Administration Mr. Jenya Moroshko (TA in charge): Mail: mailto:mjenya@cs.technion.ac.il Mr. Matan Peled: Mail: mailto:mip@cs.technion.ac.il Mr. Snir Cohen: Mail: mailto:snirc@tx.technion.ac.il J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 2/11

1.1. Administration Course material Offical web site http://webcourse.cs.technion.ac.il/234319 where you will find: Printouts of slides in a variety of formats A couple of Hebrew monographs Some lecture notes taken by students Past exams And the usual: grades, current assignment information & FAQs, periodical announcements, J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 3/11

1.Preliminaries 1.1. Administration Resources managed by students Facebook group https://www.facebook.com/groups/programming.languages/ Indexed Q&A site https://safot.net/ J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 4/11

Text books 1.1. Administration Main text book Programming Language Concepts and Paradigms, David A. Watt. Prentice Hall, 1990. But also English Wikipedia 1 and Google search. For further, in depth, reading: Advanced Programming Language Design, Raphael Finkel. MIT Press, 1996. Programming Languages: Concepts and Constructs (2nd Ed), Ravi Sethi. Addison-Wesley, 1996. 1 Hebrew Wikipedia is essentially rubbish J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 5/11

1.1. Administration Bibliography for tutorials Programming languages taught: Pascal, ML, Prolog Introduction to Pascal, by Jim Welsh and John Elder. Prentice Hall, 1979. ML for the Working Programmer, Lawrence. C. Paulson. Cambridge University Press, 1991. Prolog Programming for Artificial Intelligence, by Ivan Bratko. Addison-Wesley. Programming in Prolog, by W. F. Clocksin and C. S. Mellish. Springer-Verlag, 1984. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 6/11

1.1. Administration Regulations Full document http://goo.gl/b6s4sr Highlights Midterm exam none Prerequisites enforced Co-requisites enforced Homework grades crucial Old homework grades cannot be transferred Appeals considered favorably treated seriously must be in writing must be signed by student no grades negotiation discussing appeals or grades with staff voids all appeal rights J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 7/11

1.1. Administration Grade components Assignments (grade denoted by A, 0 A 100) Every 2 3 weeks Mandatory Typically includes both programming (and mini-research problems) Teams of two students each (strict!) Matching services provided by teaching assistants Exam (grade denoted by E, 0 E 100) Guaranteed to include at least one homework assignment Guaranteed to include at least one past exam question Typically includes 8 12 questions J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 8/11

Final grade 1.1. Administration Denoted by F, 0 F 100: round(e) if E 1.5 A E round(e) if E 50 F = round(e + A E) if 50 < E A round(e E A) otherwise (1.1) J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 9/11

Syllabus 1.Preliminaries 1.1. Administration Concepts values, types and expressions typing systems storage commands sequencers function abstractions Programming paradigms Imperative C, C++, Pascal, Java, AWK, Go, Functional ML, Haskell, Lisp Declarative Prolog J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 10/11

1.1. Administration At the end of the course you ll know What distinguishes different PLs from one another A variety of mechanisms in familiar and less familiar PLs Programming in the functional language ML Some basic concepts from Pascal, Prolog and other PLs Main skills: Quickly learn a new PL Evaluate PLs Use any PL more cleverly Search in Google J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.1: p. 11/11

1.2. Motivation Where are we? 1. Preliminaries 1.2. Motivation 1. Preliminaries 1.1 Administration 1.2 Motivation 1.3 Hello, World! J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 1.2

1.2. Motivation Concrete reasons to study PLs? Fun Professional skills ML is neat Prolog is elegant There is more to it than C, C++, Java Enhance thinking flexibility Over 2,000 different languages out there Common concepts and shared paradigms Framework for comparative study of PLs Useful for other courses: OOP Compilation Software Engineering Semantics of PLs Memory Management J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 1/13

1.2. Motivation Discovering you speak prose «Par ma foi! il y a plus de quarante ans que je dis de la prose sans que j en susse rien, et je vous suis le plus obligé du monde de m avoir appris cela.» The pleasure to discover that you have been speaking prose all your life without knowing it; or, more generally, learning, something new about old things. So, yes, the course will be telling you new stuff about old stuff and we will practice some new modes of thought J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 2/13

1.2. Motivation New modes of thought New And also, Programming languages mechanisms much beyond the if and while Programming techniques Paradigms of thought Directions for your minds Get ready to Object Oriented Programming and other advanced courses. 2 Hone web-search skills. 3 2 the instructor of the Object Oriendted Programming course paid me to mention this 3 Google paid me to include this in the topic of our course J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 3/13

1.2. Motivation But also many practical benefits Main objective learn, understand, and evaluate any new programming language J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 4/13

1.2. Motivation Or, at least, understand the terminology/jargon of the trade: What kind of a beast is JavaScript? Imperative, With prototypes (object-based, but not object-oriented), Functions are first-class entities, Has lambda functions, With closures, Is weakly typed, Has dynamic typing, Has static scoping, and a must-know for any modern website developer! By the end of these course, many of these terms will be covered in depth. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 5/13

1.2. Motivation Not for the faint of heart No mathematical interest. This is not yet another technical course: Many soft definitions Much reliance on common sense No theorems, proofs, lemmas, or integration by parts No easy grades for mathematical genuises No computational interest. The expressive power of all programming mechanisms and computational devices is basically the same The Church-Turing hypothesis The DOS batch language and Java are equivalent The Commodore 64 and the latest 8-core CPUs are equivalent No algorithmic interest. You don t discover new fascinating algorithms using better programming languages. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 6/13

1.2. Motivation Possible approaches Define and compare paradigms of PLs Present formal approaches to syntax and semantics Present ways of implementing and analyzing programs in various PLs Show the concepts that must be dealt with by any PL, and the possible variety in treatment J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 7/13

1.2. Motivation Problem To teach you PL theory, we need to draw examples from different PLs. Right now, most of you know 2.5 languages (C, C++, Unix shell scripts). Examples in these slides come from (alphabetically): Ada, Algol, AWK, C, C++, C #, Eiffel, Fortran, Haskell, Java, ML, Lazy-ML, Lisp, Pascal, Prolog, Python, SQL, and probably a few more I forgot. Can you please learn all these for next week? Recitations are here to help. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 8/13

1.2. Motivation Who needs PLs? Computers native tongue is machine language Programmers need higher level languages, because: They can t write machine language correctly They can t read machine language fluently They can t express their ideas in machine language efficiently Life is too short to program in machine language. A formal language is not only a man-machine interface, but also a person-to-person language! Conclusion: PLs are a compromise between the needs of humans and the needs of machines J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 9/13

1.2. Motivation What is a PL? A linguistic tool with formal syntax and semantics A consciously designed artifact that can be implemented on computers A conceptual universe for thinking about programming (Alan Perlis, 1969) J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 10/13

1.2. Motivation Language processors A system for processing a language: Compiler Interpreter Syntax directed editor Program checker Program verifier Studied in other courses: Compilation Program verification Software engineering To know the semantics of a language (the function a program encodes) one can ignore its implementation J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 11/13

1.2. Motivation Relations to other fields in computer science Databases and Information Retrieval Query languages - languages for manipulating databases. Human-Computer Interaction PLs are designed to be written and read by humans Operating Systems Input-Output support. Storage management. Shells are in fact PLs. Computer Architecture PL design is influenced by architecture and vice versa. Instructions sets are PLs. Hardware design languages. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 12/13

1.2. Motivation Closely related topics Automata and Formal Languages, Computability Provide the foundation for much of the underlying theory. Compilation The technology of processing PLs. Software engineering The process of building software systems. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.2: p. 13/13

1.3. Hello, World! Where are we? 1. Preliminaries 1.3. Hello, World! 1. Preliminaries 1.1 Administration 1.2 Motivation 1.3 Hello, World! J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 1.3

1.3. Hello, World! How many ways to say Hello, World? The following slides present examples of some of the most popular computer program Hello, World in various programming languages See how many you can recognize? More exmaples: http://www.latech.edu/~acm/helloworld.shtml http://99-bottles-of-beer.ls-la.net/ J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 1/??

1.3. Hello, World! Assembly 8086 (for MS DOS).model small.stack 100h.data.helloMessage db 'Hello, World',0dh,0ah,'$'.code main proc mov ax,@data 8086 mov ds,ax + MSDOS mov ah,9 mov dx,ofsett hellomessage int 21h mov ax,4c00h int 21h main endp end main J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 2/??

Fortran 1.3. Hello, World! c c Hello, world. c PROGRAM HELLO Fortran WRITE(*,10) 10 FORMAT('Hello, world') END J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 3/??

PL/I 1.Preliminaries 1.3. Hello, World! /* HELLO PL/I WORD PROGRAM TO OUTPUT HELLO WORLD */ HELLO: PROCEDURE OPTIONS (MAIN); PUT SKIP DATA('HELLO, WORLD'); END HELLO; J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 4/??

Ada 1.Preliminaries 1.3. Hello, World! with i_o; use Ada i_o; procedure hello is begin put ("Hello, World"); end hello; J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 5/??

Prolog 1.3. Hello, World! hello :- printstring("hello, World"). printstring([]). printstring([h T]) Prolog :- put(h), printstring(t). J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 6/??

Snobol 4 1.3. Hello, World! OUTPUT = 'Hello, World' END Snobol 4 J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 7/??

1.3. Hello, World! The Chef PL Lots of food for one person Hello World Souffle. Ingredients. 72 g haricot beans 101 eggs 108 g lard 111 cups oil 32 zucchinis 119 ml water 114 g red salmon 100 g dijon mustard 33 potatoes Method. Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the mixing bowl into the baking dish. Serves 1. J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 8/??

Lisp 1.Preliminaries 1.3. Hello, World! ( DEFUN HELLO-WORLD ( ) (PRINT Lisp (LIST 'HELLO 'WORLD) ) ) J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 9/??

Smalltalk 1.3. Hello, World! Transcript Smalltalk show: 'Hello, World'; cr J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 10/??

PostScript 1.3. Hello, World! %!PS 1.00000 0.99083 scale /Courier findfont 12 scalefont setfont 0 0 translate /row 769 def 85 {/col PostScript 18 def 6 {col row moveto (Hello, World) show /col col 90 add def} repeat /row row 9 sub def} repeat showpage save restore J. Gil (Technion IIT ) CS 234319: Programming Languages March 16, 2015 Section 1.3: p. 11/??