Programming Languages and Translators

Slides:



Advertisements
Similar presentations
compilers and interpreters
Advertisements

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
COMP205 Comparative Programming Languages
Chapter 16 Programming and Languages: Telling the Computer What to Do.
What is Assembly Language? Introduction to the GNU/Linux assembler and linker for Intel Pentium processors.
Introduction to Programming End Show. Resource Team R.P Ranjan-Lecturer, SPICTEC, Galle. W.M.A.S. Wijesekara-Centre manager,CRC Hali-Ela H.P.U.S Indra.
1 Chapter-01 Introduction to Computers and C++ Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Programming Language Rico Yu. Levels of Programming Languages 1.Low level languages 2.High level languages.
Evolution of Programming Languages Generations of PLs.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Chapter 9 Programming Languages
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.
PROGRAMMING LANGUAGES
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Chapter 9 ProgrammingLanguages.  Describe the evolution of programming languages from machine language to high-level languages.  Understand how a program.
Machine Machine language is PL in which program instructions are written in strings of 0s and 1s.The computer circuitry is wired in a manner that it can.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
ICT PROGRAMMING INTRODUCTION. WHAT & WHY PROGRAMMING Programming is a process of developing computer programs Computer program is a set of instructions.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Game programming 1.
Introduction to Software
Computer Language
Evolution and History of Programming Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Component 1.6.
Assembler, Compiler, MIPS simulator
Visit for more Learning Resources
Topic: Programming Languages and their Evolution + Intro to Scratch
Why study programming languages?
Computer Programming (BCT 1113)
Introduction to programming
Operating System Interface between a user and the computer hardware
Programming Language Hierarchy, Phases of a Java Program
Evolution and History of Programming Languages
Sections Basic Concepts of Programming
CSCI-235 Micro-Computer Applications
Computer Programming.
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor and Assembly Language
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
课程名 编译原理 Compiling Techniques
Lecture 2 Introduction to Programming
Application Development Theory
Assembler, Compiler, Interpreter
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
High Level Programming Languages
CS105 Introduction to Computer Concepts Intro to programming
Low Level Programming Languages
Assembler, Compiler, Interpreter
Introduction to Computer Programming
Principles of Programming Languages
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Chapter 1 Introduction.
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

Programming Languages and Translators Ashima Wadhwa Assistant Professor (giBS)

LANGUAGE GENERATIONS Classification 1st Machine languages 2nd Assembly languages 3rd Procedural languages 4th Application languages (4GLs) 5th AI techniques, inference languages 6th Neural networks , others….

Programming Languages A computer program resides in primary memory where it is represented as a set of machine instructions which in turn are represented as sequences of binary digits. At any point in time the computer is said to be in a particular state. A central feature of the state is the instruction pointer which points to the next machine instruction to be executed. The execution sequence of a group of machine instructions is known as the flow of control.

EVOLUTION To write a program for a computer, we must use a computer language. A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax). Over the years, computer languages have evolved from machine language to high-level languages.

Machine languages In the earliest days of computers, the only programming languages available were machine languages. Each computer had its own machine language, which was made of streams of 0s and 1s.

A machine’s own language For understanding how computers work, we need familiarity with the computer’s own language (called “machine language”) It’s LOW-LEVEL language (very detailed) It is specific to a machine’s “architecture” It is a language “spoken” using voltages Humans represent it with zeros and ones

Example of machine-language Here’s what a program-fragment looks like: 10100001 10111100 10010011 00000100 00001000 00000011 00000101 11000000 10010011 00000100 00001000 10100011 11000000 10010100 00000100 00001000 It means: z = x + y;

Assembly languages The next evolution in programming came with the idea of replacing binary code for instruction and addresses with symbols or mnemonics. Because they used symbols, these languages were first known as symbolic languages. The set of these mnemonic languages were later referred to as assembly languages.

Hence assembly language There are two key ideas: -- mnemonic opcodes: we use abbreviations of English language words to denote operations -- symbolic addresses: we invent “meaningful” names for memory storage locations we need These make machine-language understandable to humans – if they know their machine’s design Let’s see our example-program, rewritten using actual “assembly language” for Intel’s Pentium

High-level languages Although assembly languages greatly improved programming efficiency, they still required programmers to concentrate on the hardware they were using. Working with symbolic languages was also very tedious, because each machine instruction had to be individually coded. The desire to improve programmer efficiency and to change the focus from the computer to the problem being solved led to the development of high-level languages. Over the years, various languages, most notably BASIC, COBOL, Pascal, Ada, C, C++ and Java, were developed.

High-Level Language Most programming nowdays is done using so-called “high-level” languages (such as FORTRAN, BASIC, COBOL, PASCAL, C, C++, JAVA, SCHEME, Lisp, ADA, etc.) These languages deliberately “hide” from a programmer many details concerning HOW his problem actually will be solved by the underlying computing machinery

The BASIC language Some languages allow programmers to forget about the computer completely! The language can express a computing problem with a few words of English, plus formulas familiar from high-school algebra EXAMPLE PROBLEM: Compute 4 plus 5

The example in BASIC LET X = 4 LET Y = 5 LET Z = X + Y PRINT X, “+”, Y, “=“, Z END Output: 4 + 5 = 9

The object-oriented paradigm The object-oriented paradigm deals with active objects instead of passive objects. We encounter many active objects in our daily life: a vehicle, an automatic door, a dishwasher and so on. The action to be performed on these objects are included in the object: the objects need only to receive the appropriate stimulus from outside to perform one of the actions. A file in an object-oriented paradigm can be packed with all the procedures—called methods in the object-oriented paradigm—to be performed by the file: printing, copying, deleting and so on. The program in this paradigm just sends the corresponding request to the object.

Some object-oriented languages Java

TRANSLATION Programs today are normally written in one of the high-level languages. To run the program on a computer, the program needs to be translated into the machine language of the computer on which it will run. The program in a high-level language is called the source program. The translated program in machine language is called the object program. Two methods are used for translation: compilation and interpretation.

Translation process Compilation and interpretation differ in that the first translates the whole source code before executing it, while the second translates and executes the source code a line at a time. Source code translation process

Translation process  lexical analysis is the process of converting a sequence of characters into a sequence of tokens, i.e. meaningful character strings. syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language.

ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language equivalents. Assigning machine addresses to symbolic labels.

Working of Assembler Programmer write a program using a sequence of assemble instructions. This sequence of assembler instructions, known as the source code/source program, then specified to the assembler program when that program is started. It translates a source code into machine language. The output of the assembler program is called the object code or object program.

Compilers Translates high-level language into low-level instructions High-level language: Source code Machine-level: Object code Changes, including bug fixes, require recompiling

Interpreters Translates source code instructions into machine language and executes it one statement at a time Disadvantages Longer to execute, particularly bad for loops Uses more memory Advantage Faster testing and code modification Examples of interpreted languages Java, BASIC, LISP

Queries?