Introduction to Programming Language CS105 Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation:

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Computers Are Your Future
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
2 We need programming languages to communicate with a computer. The two broad classifications of programming languages are: Low-level and High- level.
Programming Creating programs that run on your PC
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
The Analytical Engine Module 6 Program Translation.
Computers Are Your Future © 2006 Prentice Hall, Inc.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computers: Tools for an Information Age
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
Compiled by Benjamin Muganzi 3.2 Functions and Purposes of Translators Computing 9691 Paper 3 1.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
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.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
Introduction to Computer Programming itc-314
Chapter 17 Programming Tools The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
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.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Evolution and History of Programming Languages. Machine languages Assembly languages Higher-level languages To build programs, people use languages that.
Evolution and History of Programming Languages. Software Programming Language.
The Teacher Computing Computer Languages [Computing]
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
3/5/2009Computer software1 Introduction Computer System Hardware Software HW Kernel/OS API Application Programs SW.
Evolution and History of Programming Languages 1.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
Computer Programming Languages HOW COMPUTERS WORK èCIRCUITS èBINARY DIGIT èBIT (0 OR 1) èBYTE - 8 BITS èASCII.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
5.0 PROGRAMMING Duration: 10 weeks Prepared by Ong Lay Peng Copyright © 2007.
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
CONCEPTS OF PROGRAMMING LANGUAGES
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.
Slide 8-1 Chapter 8 Terms Programming Languages Introduction to Information Systems Judith C. Simon.
Introduction to Computer Programming itc-314 Lecture 04.
Programming Languages and the Programming Process lesson 28.
Introduction to Programming Languages © 2005 Prentice Hall, Inc. CXC IT Unit 2: Intro. to Programming.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Software Engineering Algorithms, Compilers, & Lifecycle.
Computer Software 1.
 Human language : commonly used to express feeling and understand what other people expression.  Computer language : are a languages by which a user.
Evolution and History of Programming Languages
Why don’t programmers have to program in machine code?
Introduction to programming
CSCI-235 Micro-Computer Applications
Computer Programming.
Programming Concepts and Languages
Assembler, Compiler, Interpreter
CS105 Introduction to Computer Concepts Intro to programming
Assembler, Compiler, Interpreter
Chapter 1 Introduction.
1.3.7 High- and low-level languages and their translators
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

Introduction to Programming Language CS105

Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation: High-level language Fourth-generation (Fifth-generation)

1GL: Machine language –A set of primitive instructions built into every computer –The instructions are in the form of binary code

2GL: Assembly language –Low-level programming language to represent machine-language instructions E.g.: ADDF3 R1, R2, R3 –Assembly code need to be converted into machine code by using an assembler –Assembly program is platform dependent Combination of mnemonic and machine instruction

3GL: High-level language –English-like and easy to learn and program. –E.g.: Area = 5 * 5 * ; –COBOL, FORTRAN, BASIC, Pascal, Ada, C, Visual Basic, Delphi, C++, C#, Java –Source program is compiled into machine code by a compiler and linked to supporting library code by a linker to form an executable file.

4GL / 5GL 3GL offered greater power to the programmer, while 4GL open up the development environment to a wider population. (Applications Development Without Programmers) Database query languages: SQL… Data manipulation, analysis, and reporting languages: MATLAB, SPSS…

Category (3GL) Windows Application –C, C++, Java, Visual Basic, C# Web Application –Server Side PHP, JSP (Java), ASP.NET (Visual Basic, C#), … –Client Side JaveScript, VBScript

The Binary Machine A modern computer can run programs written in JavaScript, Pascal, Visual Basic, Visual C++, etc. However, computers can only understand one language: the machine language it is not easy to use. The machine language of a Sun workstation is different from a PC (or other platform), however, they can run the same C++ program.

Two types of Translators (3GL to 1GL) Interpreter: –translate and run the source code one line at a time. Easy to write and easy to find the errors in the program, but running very slow. JavaScript, VBScript, PHP, … Compiler: –translates the source code once and for all, producing a complete machine language program. Very fast, but when the program fails, difficult to show the programmer where are the errors. –C, C++, Java, C#, and so on.

Implement a Language Generally, the action of any translating program can be divided into three phases –Scanning –Parsing –Code generation

Implement a Language - Scanning Scanning process: a long string of characters is broken into tokens. Example: sum = a + b is broken into 5 tokens sum, =, a, +, b A token is the smallest meaningful unit of information.

Implement a Language - Parsing Parsing: the string of tokens is transformed into a syntactic structure. What happens in a compiler or interpreter is that the list of tokens is converted to a parse tree in memory via a complicated algorithm. = sum+ a b

Parsing a complicated equation