1/20/2016 INTRODUCTION



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

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

Image credits:

COS 301 Programming Languages

What is a programming language?

CSCI 3136 Principles of Programming Languages

CSE 130 Programming Language Principles & Paradigms

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

CSC Software II: Principles of Programming Languages

Evolution of the Major Programming Languages

Programming Languages

Chapter 12 Programming Concepts and Languages

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

Levels of Programming Languages. Gerald Penn CSC 324

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

Chapter 13: Program Development and Programming Languages

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

General Introduction

Programming Languages

Lecture 1: Introduction

Semester Review. CSC 301, Fall 2015

Programming Languages

1. Overview of the Java Language

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

The programming language C. sws1 1

Lesson 06: Basics of Software Development (W02D2

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

Chapter 6: Programming Languages

Compiler and Language Processing Tools

CSE 307: Principles of Programming Languages

CPU Organisation and Operation

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

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

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

How To Understand Programming Languages And Programming Languages

Copyright 2012 Pearson Education, Inc. Chapter 1 INTRODUCTION TO COMPUTING AND ENGINEERING PROBLEM SOLVING

02 B The Java Virtual Machine

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

An Easier Way for Cross-Platform Data Acquisition Application Development

High level code and machine code

Chapter 3.2 C++, Java, and Scripting Languages. The major programming languages used in game development.

Jonathan Worthington Scarborough Linux User Group

Programming Language Pragmatics

Semantic Analysis: Types and Type Checking

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler

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

COURSE CSE1010: COMPUTER SCIENCE 1. Prerequisite:

Course MS10975A Introduction to Programming. Length: 5 Days

Programming Language Inter-conversion

Object-Oriented Software Specification in Programming Language Design and Implementation

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

ABET General Outcomes. Student Learning Outcomes for BS in Computing

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

Glossary of Object Oriented Terms

OAMulator. Online One Address Machine emulator and OAMPL compiler.

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

How to make the computer understand? Lecture 15: Putting it all together. Example (Output assembly code) Example (input program) Anatomy of a Computer

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

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

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

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

Central Processing Unit (CPU)

Departamento de Investigación. LaST: Language Study Tool. Nº 143 Edgard Lindner y Enrique Molinari Coordinación: Graciela Matich

Computer Organization

Chapter 5 Names, Bindings, Type Checking, and Scopes

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

(Refer Slide Time: 00:01:16 min)

Chapter 13: Program Development and Programming Languages

Lecture 9. Semantic Analysis Scoping and Symbol Table

Software: Systems and. Application Software. Software and Hardware. Types of Software. Software can represent 75% or more of the total cost of an IS.

OKLAHOMA SUBJECT AREA TESTS (OSAT )

A Modular Approach to Teaching Mobile APPS Development

Cabrillo College Catalog

Parrot in a Nutshell. Dan Sugalski dan@sidhe.org. Parrot in a nutshell 1

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

The Design of the Inferno Virtual Machine. Introduction

System Structures. Services Interface Structure

USE OF PYTHON AS A SATELLITE OPERATIONS AND TESTING AUTOMATION LANGUAGE

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

The C Programming Language course syllabus associate level

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Division of Mathematical Sciences

Cross-Platform Mobile Apps Solution

Effective Java Programming. efficient software development

Web Pages. Static Web Pages SHTML

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

Programming Languages

Processor Architectures

Efficiency Considerations of PERL and Python in Distributed Processing

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

C++ Programming Language

CSC230 Getting Starting in C. Tyler Bletsch

COURSE CODE: CSC 411 Organization of Programming Languages

1.1 WHAT IS A PROGRAMMING LANGUAGE?

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Contents. Java - An Introduction. Java Milestones. Java and its Evolution

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Transcription:

INTRODUCTION 1

Programming languages have common concepts that are seen in all languages This course will discuss and illustrate these common concepts: Syntax Names Types Semantics Memory Management We will show them in the context of: Imperative Programming Object-Oriented Programming Functional Programming (maybe) Logic Programming (maybe) With some discussion of: Memory management Event Handling Concurrency A Brief History How and when and why did programming languages evolve? All processors, even the earliest ones, have a small set of instructions that can be performed A binary machine language, very close to the metal, that controls the machine VERY early on, the notion of a stored program (as compared to wired in or fed in with cards or tape) developed VERY early on, simple mnemonic languages were developed to make programming a little bit easier 2

Assembler Language Machine code has a series of possible operations and operands, represented by unique bit patterns Some mnemonic representation of the operations helps make things readable Symbolic names for resources like processor registers helps a lot. Symbolic names for memory locations helps even more Higher Levels of Language A higher level of abstraction Easier to read and write Easier to develop systems for more complex uses 3

What Is Common All Languages will have a syntax what is and is not valid in the language semantics what is the meaning of elements of the language names what are the rules for names for things in the language types what values can things in the language take on All Languages run on some sort of machine 4

The von Neumann Architecture The von Neumann Architecture Fetch-execute-cycle (on a von Neumann architecture computer) initialize the program counter repeat forever fetch the instruction pointed by the counter increment the counter decode the instruction execute the instruction end repeat 5

Von Neumann Bottleneck Connection speed between a computer s memory and its processor determines the speed of a computer Program instructions often can be executed much faster than the speed of the connection; the connection speed thus results in a bottleneck Known as the von Neumann bottleneck; it is the primary limiting factor in the speed of computers Computer Architecture Influences Languages Imperative languages, most dominant, because of von Neumann computers Data and programs stored in memory Memory is separate from CPU Instructions and data are piped from memory to CPU Basis for imperative languages Variables model memory cells Assignment statements model piping Iteration is efficient 6

Programming Methodologies over Time 1950s and early 1960s: Simple applications; worry about machine efficiency Late 1960s: People efficiency became important; readability, better control structures structured programming top-down design and step-wise refinement Late 1970s: Process-oriented to data-oriented data abstraction Middle 1980s: Object-oriented programming Data abstraction + inheritance + polymorphism Language Categories Imperative Central features are variables, assignment statements, and iteration Include languages that support object-oriented programming Include scripting languages Include the visual languages Examples: C, Java, Perl, JavaScript, Visual BASIC.NET, C++ Functional Main means of making computations is by applying functions to given parameters Examples: LISP, Scheme, ML, F# Logic Rule-based (rules are specified in no particular order) Example: Prolog Markup/programming hybrid Markup languages extended to support some programming Examples: JSTL, XSLT 7

Language Design Trade-Offs Reliability vs. cost of execution Example: Java demands all references to array elements be checked for proper indexing, which leads to increased execution costs Readability vs. writeability Example: APL provides many powerful operators (and a large number of new symbols), allowing complex computations to be written in a compact program but at the cost of poor readability Writeability (flexibility) vs. reliability Example: C++ pointers are powerful and very flexible but can be unreliable Implementation Methods Compilation Programs are translated into machine language; includes JIT systems Use: Large commercial applications Pure Interpretation Programs are interpreted by another program known as an interpreter Use: Small programs or when efficiency is not an issue Hybrid Implementation Systems A compromise between compilers and pure interpreters Use: Small and medium systems when efficiency is not the first concern 8

Compiling Compilation Translate high-level program (source language) into machine code (machine language) This is specific to the machine you are compiling for Compiling on one machine to run on another is called cross-compilation Slow translation, fast execution 9

Steps In Compile Inside a Compiler lexical analyzer converts characters in the source program into lexical units syntax analyzer transforms lexical units into parse trees which represent the syntactic structure of program Semantics analyzer enforces the semantic rules of the language Optimizer improves the code Code generator creates the output (assembler or byte code) 10

Pure Interpretation No translation Easier implementation of programs (run-time errors can easily and immediately be displayed) Slower execution (10 to 100 times slower than compiled programs) Often requires more space Now rare for traditional high-level languages Significant comeback with some Web scripting languages (e.g., JavaScript, PHP) Hybrid Implementation Systems A compromise between compilers and pure interpreters A high-level language program is translated to an intermediate language that allows easy interpretation Faster than pure interpretation Examples Perl programs are partially compiled to detect errors before interpretation Initial implementations of Java were hybrid; the intermediate form, byte code, provides portability to any machine that has a byte code interpreter and a run-time system (together, these are called Java Virtual Machine) 11

Just-in-Time Implementation Systems Initially translate programs to an intermediate language Then compile the intermediate language of the subprograms into machine code when they are called Machine code version is kept for subsequent calls JIT systems are widely used for Java programs.net languages are implemented with a JIT system In essence, JIT systems are delayed compilers Preprocessors Preprocessor macros (instructions) are commonly used to specify that code from another file is to be included A preprocessor processes a program immediately before the program is compiled to expand embedded preprocessor macros A well-known example: C preprocessor expands #include, #define, and similar macros 12

Programming Environments A collection of tools used in software development Every system has a compiler or interpreter and extra tools such as archivers (to make libraries) and debuggers Available compilers gcc and g++ clang MinGW Visual C/C++ Debuggers allow for breakpointing and single stepping through your program, examining the value of variables and the flow of the program Programming Environments Some environments provide smart editors with features like syntax coloring, coding help, templates Common ones Xcode Macintosh: iphone/ipad development, supports C, C++, Objective C, Swift Eclipse Android development, supports C, C++, Java, others Qt cross-platform: C, C++ Code::Blocks, C, C++ Microsoft Visual Studio.NET Used to build Web applications and non-web applications in any.net language NetBeans Related to Visual Studio.NET, except for applications in Java 13

14