Welcome to Programming Languages!

Slides:



Advertisements
Similar presentations
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Advertisements

you admittance to the “show”.
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
The Analytical Engine Module 6 Program Translation.
Programming Languages Structure
CSI Fall 2002 Dr. William A. Maniatty Assistant Prof. Dept. of Computer Science University At Albany Programming Languages and Systems Concepts Fall.
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
Presented by Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
CS 355 – Programming Languages
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
Programming Languages and Design Lecture 1 Introduction to Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern University,
Chapter 1. Introduction.
CS 363 Comparative Programming Languages
By Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion (Algol,
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Chapter 1. Introduction.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Programming Languages 2nd edition Tucker and Noonan
Why don’t programmers have to program in machine code?
Component 1.6.
Compiler Design (40-414) Main Text Book:
Concepts of Programming Languages
Introduction to programming languages, Algorithms & flowcharts
Welcome to Software Engineering!
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Concepts of Programming Languages
Why study programming languages?
CSCI 3200: Programming Languages
Lecture 1 Introduction Richard Gesick.
CS 3304 Comparative Languages
Chapter 1 Preliminaries.
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
CS 3304 Comparative Languages
Programming Language Design Concepts
Chapter 1 Reasons to study concepts of PLs Programming Domains
Problem Solving Using C: Orientation & Lecture 1
课程名 编译原理 Compiling Techniques
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
Programming Languages
Chapter 1 Preliminaries.
Evolution of programming languages
Chapter 1 Preliminaries.
Introduction to programming languages, Algorithms & flowcharts
Problem Solving.
Problem Solving Using C: Orientation & Lecture 1
Programming Language Design
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
COP4020 Programming Languages
Chapter 1 Preliminaries.
Programming Languages 2nd edition Tucker and Noonan
Chapter 1 Preliminaries.
Problem Solving Using C: Orientation & Lecture 1
Principles of Programming Languages
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design.
Chapter 1 Preliminaries.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
School of Computer & Information Engineering,
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
CSCI 3200: Programming Languages
Chapter 1 Preliminaries.
Presentation transcript:

Welcome to Programming Languages! http://flic.kr/p/eGNyq

Why take Programming Languages? Make me a better ________________

Why take Programming Languages? Make be a better creator of PLs Design PLs Implement PLs Make me a better user of PLs Write better code Choose right PL for job

Deep questions What makes a good PL design? What types of PL designs are there? How do you implement a PL?

Can you guess what this is? It’s a program! Machine language – x86 (Pentium) Expressed as hex Calculates greatest common divisor (GCD) It’s a program! It calculates the greatest common divisor (GCD) of two integers. Can you guess what language? It’s machine language (expressed as hex) for the x86 (Pentium) instruction set.

What are the pros/cons of machine language? Close to machine Performance Unreadable Not portable More???

Can you guess what this is? Assembly language version of GCD program 1-to-1 mnemonic mapping to machine language

What are the pros/cons of assembly language? Pretty much same as machine language, but more human readable

Can you guess what this is? High-level language (C/C++) version of GCD

What are the pros/cons of high-level language? Pros: More comprehendible, scalable, and portable Cons: Farther from the machine (poorer performance)

But there are thousands( But there are thousands(?) of high-level langs – what makes one better than another? C/C++ Scheme/Lisp Prolog

What makes one lang better than another? Expressive power What computations can you express? Usability Learnability Ease of use (create/read/modify) Ease of implementation Performance Tool support Familiarity/expertise???

Deep questions What makes a good PL design? What types of PL designs are there? How do you implement a PL?

Declarative versus Imperative Say what to compute Programmers point of view Higher level Up and coming Say how to compute Implementers point of view Closer to machine Dominant

(Fuzzy) Categories of languages Declarative functional (Lisp/Scheme, ML, Haskell) dataflow (Id, Val) logic, constraint-based (Prolog, spreadsheets) template-based (XSLT) Imperative von Neumann (C, Ada, Fortran, …) scripting (Perl, Python, PHP, …) object-oriented (Smalltalk, Eiffel, Java, …)

Functional versus von Neuman Functional - Scheme/Lisp Recursive definition of functions, refining from more complex to simpler (no variables/state!) von Neumann - C/C++ Declaration and sequential modification of variables

Deep questions What makes a good PL design? What types of PL designs are there? How do you implement a PL?

Finish this dataflow diagram for assembly language ???

Finish this dataflow diagram for assembly language

Finish this dataflow diagram for high-level languages ???

Finish this dataflow diagram for high-level languages Don’t let the names confuse you. These are all translators

Architectural pattern Architectural pattern*: Translate through many intermediate representations * Called pipeline or pipes and filters architecture

But there’s another way! Can you explain this diagram?

Translators Versus Interpreters Translator: Program that reads “sentences” in one language and converts them to another See also compilers, assemblers Interpreter: Program that reads sentences in some language and “executes” them May or may not be interactive

What language uses this translator/interpreter hybrid architecture? aka Compiler aka Interpreter Why, Java, of course

How do you read/analyze/process code? … What happens in here?

Two big concerns Syntax: The form in which sentences are expressed What syntactic elements do parts of the source map to? Is the source syntactically valid? Semantics: The meaning of the sentences What semantic elements do parts of the source map to? Is the source semantically valid?

What to do first?

Split input into bite-size tokens C/C++ token examples: What next?

Map tokens to syntactic elements C/C++ parse tree example: What next?

Represent program in terms of semantic elements AST example What next?

And all the rest… And all the rest…

Fortunately, there are tools to help you! Compiler Compilers aka Compiler Generators aka Parser Generators aka… Examples: Lex/Yacc Flex/Bison ANTLR

Course Goals Learn to create your own language translators/interpreters Using ANTLR Survey issues and features in PL design Try programming in sampling of different languages

Course Structure Three parts (4-5 weeks each) Follows structure of PLP book Each ends in an exam Homeworks throughout (~7) Readings + quizzes throughout

Grading 51% exams (3 x 17%) 39% homeworks and quizzes 10% participation

Some key policies No cheating! I use plagiarism detection system! Participate! (lest you lose a participation point) Be here at beginning of class, stay until the end Pop quizzes at beginning of class common Be engaged! Expect seating chart Bring laptops, but…

http://www.cbc.ca/news/technology/story/2013/08/14/technology-laptop-grades.html

Let’s tour the course web pages…

What’s next? Take Java proficiency instrument Do Homework 0 In class today Do Homework 0 Due Tuesday by 2:40