Programming Languages



Similar documents
Lecture 1: Introduction

CSCI 3136 Principles of Programming Languages

CSE 307: Principles of Programming Languages

n Introduction n Art of programming language design n Programming language spectrum n Why study programming languages? n Overview of compilation

Principles of Programming Languages Topic: Introduction Professor Louis Steinberg

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

What is a programming language?

Programming Languages

CSC Software II: Principles of Programming Languages

CSCE 314 Programming Languages

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

1/20/2016 INTRODUCTION

CSE 130 Programming Language Principles & Paradigms

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

Fall 2012 Q530. Programming for Cognitive Science

Announcements FORTRAN ALGOL COBOL. Simula & Smalltalk. Programming Languages

Semester Review. CSC 301, Fall 2015

Image credits:

Evolution of the Major Programming Languages

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

Asogwa Tochukwu Chijindu Department of Computer Engineering, Enugu State University of Science and Technology(ESUT), Enugu, Nigeria.

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Fundamentals of Programming Languages

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

CS 40 Computing for the Web

Language Processing Systems

How To Teach C++ Data Structure Programming

McGraw-Hill The McGraw-Hill Companies, Inc.,

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction

How To Understand Programming Languages And Programming Languages

Computer Science. Requirements for the Major (updated 11/13/03)

CS 51 Intro to CS. Art Lee. September 2, 2014

Introduction to Python

02-201: Programming for Scientists

CS Standards Crosswalk: CSTA K-12 Computer Science Standards and Oracle Java Programming (2014)

Syllabus for CS 134 Java Programming

Division of Mathematical Sciences

Course Goal CMSC 330: Organization of Programming Languages. Studying Programming Languages. All Languages Are (Kind of) Equivalent.

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.

Object-Oriented Software Specification in Programming Language Design and Implementation

Chapter 13: Program Development and Programming Languages

Lesson 06: Basics of Software Development (W02D2

Datavetenskapligt Program (kandidat) Computer Science Programme (master)

CSCI E 98: Managed Environments for the Execution of Programs

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Welcome to Introduction to Computers and Programming Course using Python

Programming. Languages & Frameworks. Hans- Pe(er Halvorsen, M.Sc. h(p://home.hit.no/~hansha/?page=sodware_development

Programming in Python. Basic information. Teaching. Administration Organisation Contents of the Course. Jarkko Toivonen. Overview of Python

COS 301 Programming Languages

1.1 WHAT IS A PROGRAMMING LANGUAGE?

Computer Programming. Course Details An Introduction to Computational Tools. Prof. Mauro Gaspari:

Functional Programming

CSC230 Getting Starting in C. Tyler Bletsch

CS 106 Introduction to Computer Science I

Programming Language Concepts for Software Developers

School of Computer Science

Special Topics in Computer Science

Programming Languages

Principles of Software Construction: Objects, Design, and Concurrency. Course Introduction. toad. toad Fall School of Computer Science

MICHIGAN TEST FOR TEACHER CERTIFICATION (MTTC) TEST OBJECTIVES FIELD 050: COMPUTER SCIENCE

COURSE TITLE COURSE DESCRIPTION

Chapter 12 Programming Concepts and Languages

CSE532 Theory of Database Systems Course Information. CSE 532, Theory of Database Systems Stony Brook University

Lecture 9. Semantic Analysis Scoping and Symbol Table

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

Artificial Intelligence. Class: 3 rd

Compiler and Language Processing Tools

Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz

6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang

THE ROLE OF PROGRAMMING PARADIGMS IN THE FIRST PROGRAMMING COURSES. 1. Introduction

Chapter 13: Program Development and Programming Languages

LONG BEACH CITY COLLEGE MEMORANDUM

Programming Language Pragmatics

Concepts of Programming Languages: A Unified Approach. Karl Abrahamson

BCS Higher Education Qualifications. Professional Graduate Diploma in IT. Programming Paradigms Syllabus

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Compiler I: Syntax Analysis Human Thought

Introduction to Software Paradigms & Procedural Programming Paradigm

General Introduction

Department of Computer Science

History of Programming Languages

Degrees Major in Computer Science Minor in Computer Science Major in Software Engineering

Understanding Programming Languages

Chapter 6: Programming Languages

Assessment for Master s Degree Program Fall Spring 2011 Computer Science Dept. Texas A&M University - Commerce

Computer and Information Sciences

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved.

DIRECT PH.D. (POST B.S.) IN COMPUTER SCIENCE PROGRAM

Languages september 12, 2015 Éric Lévénez < FORTRAN III end-1958 FORTRAN II FORTRAN I october 1956

Chapter 15 Functional Programming Languages

Fundamentals of Computer Programming CS 101 (3 Units)

How To Get A Computer Science Degree

Peter Mileff PhD SOFTWARE ENGINEERING. The Basics of Software Engineering. University of Miskolc Department of Information Technology

Structure of Presentation. The Role of Programming in Informatics Curricula. Concepts of Informatics 2. Concepts of Informatics 1

Transcription:

Programming Languages Qing Yi Course web site: www.cs.utsa.edu/~qingyi/cs3723 cs3723 1

A little about myself Qing Yi Ph.D. Rice University, USA. Assistant Professor, Department of Computer Science Office: SB 4.01.30 Office hours: MW, 12-1pm; by appointment Phone : 458-5671 Research Interests Programming Language and compiler technology Program analysis&optimization for high-performance computing. Code generation and verification of software. cs3723 2

Class Objective Programming techniques Know how to write programs in different paradigms Know how to translate between different languages Concepts in programming languages Know the concepts of typical programming languages Understand how to implement programming languages (the structures of compilers and interpreters) Understand trade-offs in programming language design Appreciate diversity of ideas Critical thinking Be prepared for new problem-solving paradigms cs3723 3

General Information Textbook: Concepts in Programming Languages by John Mitchell, Cambridge University Press Reference books The Little Schemer by Daniel P. Friedman and Matthias Felleisen, the MIT Press. Elements of ML Programming, 2nd Edition (ML97) by Jerey D. Ullman, Prentice-Hall. C++ Programming Language by Bjarne Stroustrup, Addison Wesley. Prerequisites: know how to use a general purpose language Grading Midterm and final exams: 55% Homework and projects: 25% (roughly 2.5% per homework) Late submissions are accepted with penalty until solution is given Recitations and class participation: 15% (roughly 1% per recitation, 0.5% per class participation) Problem solving: 5% (challenging projects posted periodically) Extra credit projects: TBA cs3723 4

Programming Paradigms Functional programming Lisp, Scheme, ML, Haskell, Express evaluation of expressions and functions Emphasize expressiveness and flexibility Mostly interpreted and used for project prototyping Imperative programming Fortran, C, Pascal, Algol, Express side-effects of statements and subroutines Emphasize machine efficiency Compiler optimizations (Fortran), efficient mapping to machine (C) Object-oriented programming Simula, C++, Java, smalltalk, Emphasize abstraction and modular program organization Logic and concurrent programming Will not be covered in this class cs3723 5

Organization of class materials Functions and Foundations Functional programming in Lisp/Scheme Language syntax: compilers and interpreters Language semantics: Lambda calculus Programming language concepts and implementation Programming in ML Types and type inference Scopes and memory management Structural control, exceptions, and continuations Concepts in object-oriented languages C++ and Java programming Modules and abstractions Classes and inheritance Subtyping and virtual functions ----------- final exam (comprehensive) --------- cs3723 6

How to pass (or fail) this class? 1. You must work on and submit all homework assignments 2. You must attend classes/recitations and submit recitation exercises They prepare you to be ready for the homework assignments and exams 3. Go to my office hours (or schedule an appointment with me) if you received less than 60% from a homework It means you didn t understand --- figure it out before it s too late. 4. Study before exams Even if you think you understand everything, you may not remember them cs3723 7

Languages in common use System software and high-performance computing (e.g., weather prediction, realistic games) C/C++, Fortran Internet and embedded systems Java, C#, Ruby, Php, Javascript, xml System administration Python, Perl, bsh, csh Others (non-general purpose languages) Postscript (the printer language), latex (text processing), What languages do you know? What paradigms do they belong? Check out which languages are popular http://langpop.com/ cs3723 8

The Role of Programming Languages Natural languages Interfaces for expressing information ideas, knowledge, commands, questions, Facilitate communication between people Different natural languages English, Chinese, French, German, Programming languages Interfaces for expressing data and algorithms Instructing machines what to do Facilitate communication between computers and programmers Different programming languages FORTRAN, Pascal, C, C++, Java, Lisp, Scheme, ML, cs3723 9

Levels of Programming Languages Two ways to implement a language: compilation vs. interpretation. Program input... c = a * a; b = c + b;. High-level (human-level) programming languages..0 000001 010111 100101 0.. Low-level (machine-level) programming languages Program output Some languages are higher level than others, why? (Readability, programmability, maintainability) cs3723 10

Benefits of high-level languages Developer productivity Higher level mechanisms for Describing relations between data Expressing algorithms and computations Error checking and reporting capability Machine independence Portable programs and libraries Maintainability of programs Readable notations High level description of algorithms Modular organization of projects X Machine efficiency Extra cost of compilation / interpretation cs3723 11

Implementing programming languages Compilation Program input... c = a * a; b = c + b;. Source code Compiler..0 000001 010111 100101 0.. Target code Program output Translation (compile) time Run time cs3723 12

Implementing programming languages Interpretation Program input... c = a * a; b = c + b;. Source code Interpreter Abstract machine Program output Run time cs3723 13

Compilers vs. Interpreters Source Program Tokens Lexical Analyzer Syntax Analyzer Program input Parse tree / Abstract syntax tree Attributed AST Semantic Analyzer Intermediate Code Generator Code Optimizer Results interpreters compilers Code Generator Target Program cs3723 14

Compilers and Interpreters Efficiency vs. Flexibility Compilers Translation time is separate from run time Compiled code can run many times Heavy weight optimizations are affordable Can pre-examine programs for errors X Static analysis has limited capability X Cannot change programs on the fly Interpreters Translation time is included in run time X Re-interpret every expression at run time X Cannot afford heavy-weight optimizations X Discover errors only when they occur at run time Have full knowledge of program behavior Can dynamically change program behavior cs3723 15

The Power of Programming languages A function f is computable if for every input x P(x) halts; and If f(x) is defined, P(x) outputs f(x) Some functions are not computable The halting problem Given a program P that requires exactly one string input and given a string x, determine whether P halts on input x Terminology: partial recursive functions Recursive functions that may be partially defined (undefined for some input values) Error termination: division by zero (3/0 has no value) Non-termination: f(x) = if x=0 then 1 else f(x-2) All programming languages are Turing complete All express the class of partial recursive functions Programming language implementation Can report error due to undefined basic operations Cannot report error if program will not terminate cs3723 16

Which problems can you solve to perfection via programming? Automatic translation from English to French A semantic query interface for the web Automatic translation from C++ to Java A grade query interface for a university student database cs3723 17

The choice of Programming languages The language toolset Most successful languages are designed for a specific type of applications What does your application need? Symbolic evaluation, systems programming, numerical computation, Programming efficiency vs. machine efficiency What languages would you choose To build an embedded OS for MP3 players? A driver for your sound card? A database management system? A robot controller? A web server? cs3723 18

Some history--- Languages that led the way Fortran --- the first high-level programming language Led by John Backus around 1954-1956 Designed for numerical computations Introduced variables, arrays, and subroutines Lisp Led by John McCarthy in late 1950s Designed for symbolic computation in artificial intelligence Introduced higher-order functions and garbage collection Descendents include Scheme, ML, Haskell, Algol Led by a committee of designers of Fortran and Lisp in late 1950s Introduced type system and data structure Descendents include Pascal, Modula, C, C++ Simula Led by Kristen Nygaard and Ole-Johan Dahl arround 1961-1967 Designed for simulation Introduced data-abstraction and object-oriented design Descendents include C++, Java, smalltalk cs3723 19

A New Language By You? Research in languages and compilers Two focuses: programming productivity and machine efficiency How to express high-level programming concepts (e.g., data structures and algorithms) and translate them into efficient machine implementations? How to extract the most performance from machines? Examples How to express parallel programming effectively and efficiently? How to automatically verify correctness of your programs? How to automate design and implementation? Thinking about graduate programs? You can consider UTSA and other universities cs3723 20