The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.

Slides:



Advertisements
Similar presentations
GCSE Computing Lesson 5.
Advertisements

compilers and interpreters
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
Systems Software.
Introducing Programming a general discussion. What is a Program? Sets of instructions that get the computer to do something Programs may be a few lines.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Computers: Tools for an Information Age
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
Compiled by Benjamin Muganzi 3.2 Functions and Purposes of Translators Computing 9691 Paper 3 1.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
1 Chapter-01 Introduction to Computers and C++ Programming.
Software – Applications software and programming languages
Systems Software & Operating systems
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Standard Grade Computing SYSTEM SOFTWARE CHAPTER 19.
Slide 1 Standard Grade Computing Studies Systems Software.
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
Programming Language Rico Yu. Levels of Programming Languages 1.Low level languages 2.High level languages.
Algorithms and Programming
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Software – Applications software and programming languages.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
PROGRAMMING LANGUAGES
I Power Higher Computing Software Development Development Languages and Environments.
Intermediate 2 Computing Unit 2 - Software Development Topic 2 - Software Development Languages and Environments.
1 3. Computing System Fundamentals 3.1 Language Translators.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
1.4 Representation of data in computer systems Instructions.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Compilers and Interpreters. HARDWARE Machine LanguageAssembly Language High Level Language C++ Visual Basic JAVA Humans.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Compilers and Interpreters
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
Programming Languages
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Evolution and History of Programming Languages
Computer Systems Nat 5 Computing Science
Why don’t programmers have to program in machine code?
Component 1.6.
Programming Languages
Introduction to programming
Operating System Interface between a user and the computer hardware
Programming Language Hierarchy, Phases of a Java Program
Sections Basic Concepts of Programming
CSCI-235 Micro-Computer Applications
Computer Systems Nat 5 Computing Science
A451 Theory – 7 Programming 7A, B - Algorithms.
Teaching Computing to GCSE
TRANSLATORS AND IDEs Key Revision Points.
Translators & Facilities of Languages
Introduction to Computer Programming
ICT Programming Lesson 1:
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
1.3.7 High- and low-level languages and their translators
Programming language translators
Presentation transcript:

The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages

Learning Objectives Describe, with the aid of examples, the characteristics of high level languages. Explain the need for translators. Describe the difference between interpretation and compilation.

Machine Code Computers work and understand only machine code. Simple instructions represented by a binary pattern in the computer. Programming in machine code takes a long time and is prone to errors. Each instruction contains a code for the operation to be carried out and a binary representation of the value to be manipulated/address of the value to be manipulated e.g e.g – where 0100 means “Jump” and 0101 is the address to jump to.

High - Level Languages ( HLL) Similar to human languages and developed for specific applications. FORTRAN (FORmula TRANslation) developed for science and engineering programs and uses formulae in the same way as would scientists and engineers. FORTRAN (FORmula TRANslation) developed for science and engineering programs and uses formulae in the same way as would scientists and engineers. COBOL (Common Business Oriented Language) was developed for business applications. COBOL (Common Business Oriented Language) was developed for business applications. Much easier for humans to program in HLL but as computers only understand machine code, programs written in HLLs need to be translated into machine code before they can be executed.

Compiler Equivalent to “Publishing” a program in VB – see presentation “”. Equivalent to “Publishing” a program in VB – see presentation “1 Variables/Identifiers”.1 Variables/Identifiers Translate high-level languages into machine code. The machine code version can be loaded into the machine and run without any further help as it is complete in itself. The high-level language version of the program is called the source code and the resulting machine code program is called the object code.

Disadvantages Of Compilers Use a lot of computer resources. Has to be loaded in the computer's memory at the same time as the source code and there has to be sufficient memory to hold the object code. Has to be sufficient memory for working storage while the translation is taking place. Errors in the original program are difficult to pin- point.

Interpreters Equivalent to “Playing (Ctrl + F5 / Play) ” a program in VB – see presentation “”. Equivalent to “Playing (Ctrl + F5 / Play) ” a program in VB – see presentation “1 Variables/Identifiers”.1 Variables/Identifiers Take each instruction in turn and translates it into machine code. Executes the translated instruction before the next instruction is translated.

Interpreters Advantages: Need less memory than compilers (useful in early computers which had limited power and memory). Need less memory than compilers (useful in early computers which had limited power and memory). Continual compilation of whole code is wasteful / time consuming during testing particularly if very minor changes have been made. Continual compilation of whole code is wasteful / time consuming during testing particularly if very minor changes have been made. During testing translator diagnostics will be more complete as error messages will be produced in relation to the HLL being used and not the machine code. During testing translator diagnostics will be more complete as error messages will be produced in relation to the HLL being used and not the machine code. As each error message is produced on the line where the error was encountered, it is easier to identify / isolate the instruction which is causing the problem. As each error message is produced on the line where the error was encountered, it is easier to identify / isolate the instruction which is causing the problem. Individual segments can be run without needing compile the whole program. Individual segments can be run without needing compile the whole program.

Interpreters Disadvantages: Slow execution compared to that of a compiled program because: Slow execution compared to that of a compiled program because: The original program has to be translated every time it is executed. Instructions inside a loop have to be translated each time the loop is entered.

Interpreters & Compilers Many high-level languages use both. Programmers use the interpreter during program development and, when the program is fully working, use a compiler to translate it into machine code. This machine code version can then be distributed to users who do not have access to the original code.

Plenary Why does a program, written in a high level language, need to be translated before it can be run on a computer?

Plenary Computers only understand binary. HLL is written in language close to human language. Translator needed to turn one into the other.

Plenary Describe the difference between interpretation and compilation.

Plenary Interpreter translates line of code and then runs it. Compiler translates entire program before run. Compiler creates an object code. Interpreter retains source code. Compiler must be present for translation. Interpreter must be present for run.