Programming Language อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากร.

Slides:



Advertisements
Similar presentations
An Introduction to Programming General Concepts. What is a program? A program is an algorithm expressed in a programming language. programming language.
Advertisements

Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Principles of programming languages 1: Introduction (with a simple language) Isao Sasano Department of Information Science and Engineering.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
Overview of Programming Paradigms
The Analytical Engine Module 6 Program Translation.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Reasons to study concepts of PL
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Programming Languages Structure
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
CS 331, Principles of Programming Languages Introduction.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
1 Chapter-01 Introduction to Computers and C++ Programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
High-Level Programming Languages: C++
The Role of Programming Languages Chapter 1: Programming Languages: Concepts and Constructs by Ravi Sethi.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Chapter 1. Introduction.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
CS101 Introduction to Computing Lecture Programming Languages.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Principles of Programming Languages Asst. Prof. Dr. Ahmet Sayar Spring-2012 Kocaeli University Computer Engineering Department Introduction.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Visual C++ Programming: Concepts and Projects
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CS 331, Principles of Programming Languages Chapter 1.
COMPILER CONSTRUCTION WEEK-1 THE ROLE OF PROGRAMMING LANGUAGE.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Programming Languages
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Introduction to Computer Programming using Fortran 77.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Programming Languages
Programming Language Hierarchy, Phases of a Java Program
Information Science and Engineering
Lecture 1: Introduction to JAVA
课程名 编译原理 Compiling Techniques
Developing Applications
Principles of Programming Languages
An Introduction to Programming
The Role of Programming Languages
Presentation transcript:

Programming Language อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากร

What are PLs? A tool for instructing machine A way for communicating A notation of algorithms How to expressing concepts A mean for controlling computerized devices

Over View Machine language is unintelligible Assembly Language is low level Benefits of Higher-level Language A Role for Programming Languages Programming Paradigms Imperative Programming Imperative Programming Object-Oriented Programming Object-Oriented Programming Logic Programming Logic Programming Functional Programming Functional Programming

Machine Lauguage Native language of a computer Hard to understand for human Example 1.1 A code fragment of von Neumann machine is Its meaning is adding theh numbers in location 10 and 11 and stores the result in location 12.

Assembly Language A variant of Machine Language in which names and symbols take the place of the actual codes for machine operations, values, and storage locations, making individual instructions more readable. See Example 1.2 Reads a sequence of integers like Reads a sequence of integers like Remove the same value adjacent and write out Remove the same value adjacent and write out

A random-access machine RAM:random-access machine It is consisted of 4 main components A memory : sequence of locations 0,1,2 A memory : sequence of locations 0,1,2 A program : sequence of instructions A program : sequence of instructions An input file : a sequence of values consumed at a time by read instructions An input file : a sequence of values consumed at a time by read instructions An output file : a sequence of values consumed at a time by write instructions An output file : a sequence of values consumed at a time by write instructions

Example of RAM memory 1: M[0] := 0 2: read(M[1]) 3: If M[1] ≥ 0 then goto 5 4: goto 7 5: M[3] := M[0] – M[1] 6: if M[3] ≥ 0 then goto 16 7: writeln(M[1]) 8: read(M[2]) 9: M[3] := M[2] – M[1] 10: if M[3] ≥ 0 then goto 12 11: goto 14 12: M[3] := M[1] – M[2] 13: if M[3] ≥ 0 then goto 8 14: M[1] := M[2] + M[0] 15: goto 3 16: halt n -27 INPUT OUTPUT

Instruction set of a RAM M[l] := nPut integer n into location l. M[l] := M[j] + M[k]Put sum of values locations j & k into location l M[l] := M[j] - M[k]Put the difference of the values in j and k into l M[l] := M[M[j]]Let k = value in location j, In effect, M[l]=M[k] M[M[j]] := M[k]Let l = value in location i. In effect, M[l]=M[k] Read(M[l])Get next input value and put it into location l. Writeln(M[j])Produce value in location j as next output value Goto INext, execute instruction in location i if [j]≥0 If M[j] ≥ 0 then goto iNext, execute instruction in location i if M[j]≥0 HaltStop execution

Benefits of Higher-Level Language Readable familiar notations Machine independence Availability of program libraries Consistency checks during implementation that can detect errors

Example of High-Level Program New users and programs: many contributors do not know, and do not wish to learn, the instruction set of the machine Readability: more easily understood, repaired and modify. Portability: runs on several machines and whose expression in source code is except for a few modules, identical on each machine. In 1973,The Unix operating system kernel was rewritten in the programming language C.

Problems of Scale Programming Language can help in 2 ways. Readable Compact notation reduce the errors Human Error Factor Example: Due to a programming error, the rocket carrying Mariner I, an unmanned probe to the planet Venus, has to be destroyed 290 seconds after launch on July 22,1962. if not (in radar contact with the rocket) then do not correct its flight path

An evolutionary of earlier languages

Programmming Paradigms Imperative Programming Functional Programming Object-Oriented Programming Logic Programming

Imperative Programming Action oriented As a sequence of actions Original Language is Fortran Pascal and C are general-purpose imperative programming language

Functional Programming Originated with Lisp, a language designed in 1958 for applications in AI McCarthy et al [1965] explained Lisp as LISP is designed primitively for symbolic data processing. It has been used for symbolic calculations in differential and integral calculus, electrical circuit theory, mathematical logic, pame playing and other fields of AI

Object-Oriented Programming Simula’s origins in simulation. Kristen Nygaard and Ole-Johan Dahl [1961] Key concept is a class of objects C++ Smalltalk

Logic Programming Developed in 1972 for natural language processing in French by Alain Colmerauer and Philippe Roussel A specialized form of logical reasoning to answer such queries

Language Implementation Compiler Once translation is complete:target code run later time called runtime. Once translation is complete:target code run later time called runtime. Interpreter: directly run program (a) COMPILE (b) INTERPRET Application Level………. Language Level………… Machine Level………….. Source ProgramProgram Target Code Machine Interperter