CSCE 314 Programming Languages

Slides:



Advertisements
Similar presentations
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
Advertisements

Compiler Construction by Muhammad Bilal Zafar (AP)
Lecture 01 - Introduction Eran Yahav 1. 2 Who? Eran Yahav Taub 734 Tel: Monday 13:30-14:30
CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
Compilation 2007 The What and Why of Compilers Michael I. Schwartzbach BRICS, University of Aarhus.
Reference Book: Modern Compiler Design by Grune, Bal, Jacobs and Langendoen Wiley 2000.
Programming Languages Structure
CS 153: Concepts of Compiler Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
Compiler design Computer Science Rensselaer Polytechnic Lecture 1.
Code Generation Introduction. Compiler (scalac, gcc) Compiler (scalac, gcc) machine code (e.g. x86, arm, JVM) efficient to execute i=0 while (i < 10)
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Languages and tools. BY SA machine code.
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
1 CSCE Programming Languages Introduction and Course Administration Dr. Hyunyoung Lee 410B HR Bright
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
CS2303 C14 Systems Programming Concepts Bob Kinicki.
COP4020 Programming Languages
CS 153: Concepts of Compiler Design August 24 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Chapter 1. Introduction.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
1 October 1, October 1, 2015October 1, 2015October 1, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University Azusa.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
Java Programming Introduction & Concepts. Introduction to Java Developed at Sun Microsystems by James Gosling in 1991 Object Oriented Free Compiled and.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
February 25, ICE 1341 – Programming Languages (Lecture #1) In-Young Ko Programming Languages (ICE 1341) Lecture #1 Programming Languages (ICE 1341)
Principles of Programming Languages Asst. Prof. Dr. Ahmet Sayar Spring-2012 Kocaeli University Computer Engineering Department Introduction.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Programming Languages & Translators (CE 359) Fall 2013 Prof. Dr: Ahmed El Nahass Lecture 1 1 FACULTY OF ENGINEERING COMPUTER ENGINEERING Prof.Dr Ahmed.
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Introduction to computers and programming Instructor: Alex Iskold.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
Programming Languages
Programming Languages
Introduction to Compilers Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY.
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Language Implementation Overview John Keyser Spring 2016.
Review on Program Challenge CSc3210 Yuan Long.
Reading Exercise 0 Discussion. Imperative vs Declarative A.Prolog, SQL, Perl B.ML, Lisp, SQL C.C, Java,Smalltalk D.C#, Haskell, Spreadsheets E.C++, Eiffel,
Lecture 1 Overview Topics InstructionsReadings: January 9, 2006 CSCE 531 Compiler Construction.
Programming Languages CSCI-4430 & CSCI-6430, Spring Ana Milanova Lally Hall 314,
CSCE 343 – Programming Language Concepts Welcome!.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
COMP 3002: Compiler Construction Pat Morin School of Computer Science.
Open Source Compiler Construction (for the JVM)
Programming Language History and Evolution
Chapter 1. Introduction.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Basic Concepts: computer, program, programming …
Introduction to programming languages, Algorithms & flowcharts
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
Programming Language Design Concepts
Problem Solving Using C: Orientation & Lecture 1
Introduction to programming languages, Algorithms & flowcharts
Problem Solving.
Problem Solving Using C: Orientation & Lecture 1
CSCE 121 Introduction to Program Design and Concepts
Problem Solving Using C: Orientation & Lecture 1
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
CSCE 314: Programming Languages Dr. Dylan Shell
A Tour of Language Implementation
CSc 453 Interpreters & Interpretation
Presentation transcript:

CSCE 314 Programming Languages John Keyser Spring 2016

About the course (syllabus overview) Instructor John Keyser Office Hours Generally, MW 2:00-3:00 Today: 1:30-2:30 Monday 1/25: cancelled TA Mengyuan Chao Peer Teachers Other section (taught by Dylan Shell)

Course stuff Prerequisite: Textbooks Course webpage Piazza CSCE 221 Hutton: Programming in Haskell Arnold, Gosling, Holmes: The Java Programming Language Course webpage Will be up soon (today?) http://courses.cse.tamu.edu/keyser/csce314 Piazza Will be used for class discussions Get a head start – sign up now...

Grades Exams (60%): Assignments (40%): Midterm: 25% (just before Spring Break) Final: 35% (at time assigned) Final will be comprehensive, but weighted toward later material Expect exams to be open book (details will come later) Assignments (40%): Turn in via CSNet Late penalty: 10% first day, 20% second day, 100% thereafter

Collaboration Work should be your own The rest should be common sense… Make sure you acknowledge any outside help

Understanding programming languages! So, what’s the point of this course? Understanding programming languages!

The Big Picture Haskell sum [] = 0 sum (x:xs) = x + sum xs ??????????????????????? C a = 13 if (a>3) c=10 100100101101 101010010010 001010000111 ASSEMBLY mov rdx, 7 mov eax, 3 jmp eax

Purpose of Programming Languages To help PEOPLE communicate ideas To the computer To other people To their future selves Programming languages are designed to help people express ideas precisely and concisely. The more “natural” the language is the better people can express ideas Different languages do this in different ways

Abstraction Haskell, Prolog sum[1..100] More Abstract Scheme, Java mynum.add(5) C i++; Assembly Language iadd Less Abstract Machine Language 10010010010

History of programming languages 1940s: connecting wires to represent 0s and 1s 1950s: assemblers, FORTRAN, COBOL, LISP 1960s: ALGOL, BCPL(-> B -> C), SIMULA 1970s: Prolog, FP, ML, Miranda 1980s: Eiffel, C++ 1990s: Haskell, Java, Python 2000s: D, C#, Spec#, F#, X10, Fortress, Scala, Ruby 2010s: Agda, Coq, … The evolution has been and is toward higher levels of abstraction

Defining a Programming Language Syntax: Defines the set of valid programs Usually defined with the help of grammars and other conditions if-statement ::= if cond-expr then stmt else stmt | if cond-expr then stmt cond-expr ::= . . . stmt ::= . . . Semantics: Defines the meaning of programs Defined, e.g., as the effect of individual language constructs to the values of program variables if cond then true-part else false-part If cond evaluates to true, the meaning is that of true-part; if cond evaluates to false, the meaning is that of false-part.

Implementing a Programming Language Task is to undo abstraction. From the source: int i; i = 2; i = i + 7; to assembly (this is actually Java bytecode): iconst_2 // Put integer 2 on stack istore_1 // Store the top stack value at location 1 iload_1 // Put the value at location 1 on stack bipush 7 // Put the value 7 on the stack iadd // Add two top stack values together istore_1 // The sum, on top of stack, stored at location 1 to machine language: 00101001010110 01001010100101

Implementing a Programming Language – How to Undo the Abstraction Source program Optimizer I/O Type checker Code generator Machine code Lexer Parser Machine Bytecode JIT Interpreter Virtual machine I/O I/O

Compiling and Interpreting (1) Typically compiled languages: C, C++, Eiffel, FORTRAN Java, C# (compiled to bytecode) Typically interpreted languages: Python, Perl, Prolog, LISP Both compiled and interpreted: Haskell, ML, Scheme

Compiling and Interpreting (2) Borderline between interpretation and compilation not clear (not that important either) Same goes with machine code vs. byte code. Examples of modern compiling/interpreting/executing scenarios: C and C++ can be compiled to LLVM bytecode Java compiled to bytecode, bytecode interpreted by JVM, unless it is first JITted to native code, which can then be run on a virtual machine such as VMWare

Our Goal: To Understand Programming Languages! How languages are designed - how they help people express ideas Language constructs Abstraction mechanisms Efficiency considerations How languages work – how they become the code that runs Parsing Internal program representation Type checking Interpretation Formal verification – how we know that code will work

Learn ideas through examples Functional language: Haskell Object-oriented language: Java These languages are the means, not the goals

Next time More in-depth look at the “flowchart” of programs being processed Begin looking at Haskell, a functional programming language