School of Computer & Information Engineering,

Slides:



Advertisements
Similar presentations
Copyright © 2005 Elsevier Imperative languages Group languages as –imperative von Neumann(Fortran, Pascal, Basic, C) object-oriented(Smalltalk, Eiffel,
Advertisements

Chapter 1: Preliminaries
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Programming Languages Structure
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
Organization of Programming Languages (CSE452)
Chapter 1 :: Introduction
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Copyright © 2005 Elsevier Chapter 1 :: Introduction Programming Language Pragmatics Michael L. Scott.
CS 355 – Programming Languages
CS 326 Programming Languages, Concepts and Implementation
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Chapter 1. Introduction.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
1 Programming Languages Tevfik Koşar Lecture - II January 19 th, 2006.
Programming History. Who was the first programmer?
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Concepts of Programming Languages Lecturer: Dr. Emad Nabil Lecture # 2.
Chapter 1 :: Introduction Programming Language Pragmatics, Fourth Edition Michael L. Scott Copyright © 2016 Elsevier.
Chapter 1. Introduction.
Concepts of Programming Languages
Chapter 1 Preliminaries.
Why study programming languages?
CS 3304 Comparative Languages
CSCI 3200: Programming Languages
CS 3304 Comparative Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
PROGRAMMING LANGUAGES
Programming Language Hierarchy, Phases of a Java Program
CS 326 Programming Languages, Concepts and Implementation
CSCI-235 Micro-Computer Applications
CS 3304 Comparative Languages
CS 3304 Comparative Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Introduction.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 1 Preliminaries.
Programming Language Design
Chapter 1 Preliminaries.
COP4020 Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
CMP 131 Introduction to Computer Programming
Chapter 1 Preliminaries.
and Program Development
Von Neumann Architecture
Principles of Programming Languages
Overview of Programming Paradigms
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
CSCI 3200: Programming Languages
Chapter 1 Preliminaries.
Presentation transcript:

School of Computer & Information Engineering, Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering, Sangji University Kwangman Ko (kkman@sangji.ac.kr)

Reading 1, P40. Reading 2, P40

1. Introduction, P41 Why are there so many programming languages? evolution - we've learned better ways of doing things over time socio-economic factors: proprietary interests, commercial advantage orientation toward special purposes orientation toward special hardware diverse ideas about what is pleasant to use

Introduction What makes a language successful? , PP42-43. easy to learn(BASIC, Pascal, LOGO, Scheme) easy to express things, easy use once fluent, "powerful” C, Common Lisp, APL, Algol-68, Perl, … easy to implement (BASIC, Forth) possible to compile to very good (fast/small) code (Fortran) backing of a powerful sponsor (COBOL, PL/1, Ada, Visual Basic) wide dissemination at minimal cost (Pascal, Turing, Java)

1.2 Program Language Spectrum, PP45-46. Classified into families based on Model of Computation Declarative Programming Language focused on WHAT the computer is to do. More higher level, tune with the programmer’s point of view. Imperative Programming Language focused on HOW the computer should do it. dominate, mainly for performance reasons

Declarative programming language Functional Scheme, ML, pure Lisp, FP, … logic, constraint-based: Prolog, VisiCalc, RPG, … Imperative programming language von Neumann: Fortran, Pascal, Basic, C, … object-oriented: Smalltalk, Eiffel, C++, … scripting languages: Perl, Python, JavaScript, PHP, …

1.3 Why study programming languages?, P47~ Help you choose a language. for systems programming C vs. Modula-3 vs. C++ for numerical computations Fortran vs. APL vs. Ada for embedded systems Ada vs. Modula-2 for symbolic data manipulation Common Lisp vs. Scheme vs. ML for networked PC programs Java vs. C/CORBA

Reading, P48. Understand OBSCURE features: Choose among alternative ways to express things understand implementation costs Make good use of debuggers, assemblers, linkers, and related tools Simulate useful features in languages that lack them

1.4 Compilation vs. Interpretation not opposites not a clear-cut distinction Input Data Compiler Target Program Source Program Outputs Source Program Interpreter Outputs Input Data

Compilation vs. Interpretation Pure Compilation translates the high-level source program into an equivalent target program(typically in machine language). COMPILER 원시 프로그램 Frontend 중간코드 Backend 목적 프로그램

Pure Interpretation Reading, P51. stays around for the execution of the program the locus of control during execution Reading, P51. Interpretation Greater flexibility Better diagnostics (error messages) Compilation Better performance

Most language implementations, ☞ P 51. a mixture of both compilation and interpretation compilation or simple pre-processing, followed by interpretation source program translator intermediate program Virtual Machine (interpreter) Input Data Output

translator Virtual Machine (interpreter) Java compiler source program translator intermediate program Virtual Machine (interpreter) Input Data Output Test.java Java compiler (javac Test.java ) Test.class Java interpreter (java Test.class)

Preprocessor Removes comments and white space Groups characters into tokens (keywords, identifiers, numbers, symbols) Expands abbreviations in the style of a macro assembler Identifies higher-level syntactic structures (loops, subroutines)

Library of Routines and Linking Reading, P52. Compiler uses a linker program to merge the appropriate library of subroutines (e.g., math functions such as sin, cos, log, etc.) into the final program: source program compiler Incomplete machine program Library Routines LINKER machine program

Post-compilation Assembly Facilitates debugging (assembly language easier for people to read) Isolates the compiler from changes in the format of machine language files (only assembler must be changed, is shared by many compilers)

The C Preprocessor (conditional compilation) Preprocessor deletes portions of code, which allows several versions of a program to be built from the same source

Source-to-Source Translation (C++) C++ implementations based on the early AT&T compiler generated an intermediate program in C, instead of an assembly language:

Bootstrapping

Dynamic and Just-in-Time(JIT) Compilation Reading, P56. In some cases a programming system may deliberately delay compilation until the last possible moment. The Java language definition defines a machine-independent intermediate form known as byte code. Byte code is the standard format for distribution of Java programs. The main C# compiler produces .NET Common Intermediate Language (CIL), which is then translated into machine code immediately prior to execution.

Compilation vs. Interpretation Tools

1.5 Programming Environments

1.6 An Overview of Compilation, PP59-60.