BIT 1003 – Presentation 7. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.

Slides:



Advertisements
Similar presentations
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Advertisements

Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox.
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.
Module 10 Programming ___tell computers what to do
High-Level Programming Languages
Computers: Tools for an Information Age
Programming Languages Structure
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
COMP Computer Basics Yi Hong May 13, 2015.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
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.
BIT Presentation 6. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming Languages and Paradigms Object-Oriented Programming.
Computers Are Your Future Eleventh Edition
There are only 10 types of people in the world, those who understand binary and those who don't.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
High-Level Programming Languages: C++
Chapter 8 High-Level Programming Languages. 2 Compilers High-level language A language that provides a richer (more English like) set of instructions.
High-level Languages.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Chapter 1. Introduction.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
Introduction to C++ Programming Language
Java Programming, Second Edition Chapter One Creating Your First Java Program.
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,
The Teacher Computing Computer Languages [Computing]
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
What am I?. Translators Translators – Module Knowledge Areas Types of translators and their use Lexical analysis Syntax analysis Code generation and.
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Programming Languages
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
int k = Integer.MAX_VALUE; k++; int k = Integer.MAX_VALUE; k++; What happens when the following code executes? byte b = someFile.readByte(); b = (byte)(b.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Overview: Lecture 6: Dolores Zage. What is a program? n Operations that are to be applied to certain data in a certain sequence (definition holds for.
Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
Chapter 1: Introduction to Computers and Programming.
 By the end of this lecture, you should …  Understand the three pillars of Object- Oriented Programming: Inheritance, Encapsulation and Polymorphism.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
HIGH-LEVEL LANGUAGE PROGRAMMING PARADIGMS. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Chapter 1. Introduction.
Programming Languages 2nd edition Tucker and Noonan
Basic Concepts: computer, program, programming …
Why don’t programmers have to program in machine code?
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Why study programming languages?
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
CSCI-235 Micro-Computer Applications
Programming & S/W Development
Presentation transcript:

BIT 1003 – Presentation 7

Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES FUNCTIONAL LANGUAGES LANGUAGE DESIGN LANGUAGE SYNTAX AND SEMANTICS 2

COMPILERS AND INTERPRETERS Program (high-level) Machine code 3 COMPILER

VIRTUAL MACHINES 4 A virtual machine such as the Java JVM is a computer defined by software rather than hardware. A virtual machine runs programs like a real computer, but the virtual machine is really another program, a construction in software, that fetches, decodes, and executes the program’s instructions. The instructions are referred to as bytecode

PROCEDURAL PROGRAMMING For many new programmers, procedural programming is the natural paradigm. A program can often be conceived simply as a list of instructions to be executed in order; that is, a procedure to be followed by the computer. Procedural programming languages are also called imperative languages. 5

Example: calculation of standard deviation (sd) of an array of numbers 6 s:sample standard deviation :is the sample mean n:array dimension (number of scores in array) :array of numbers (scores) An equivalent formula often useful for computation is the following:

(cont.) pseudocode Set SUM and SUMSQUARES equal to 0.0 Set n = size of the array of scores Start with the first score, and continue until all the scores have been processed Set SUM = SUM + score Set SUMSQUARES = SUMSQUARES + score 2 End of loop Set MEAN = SUM/n Return the SquareRoot of (SUMSQUARES − n * MEAN 2 ) / (n − 1) 7

(cont.) java program for sd calc. 8

OBJECT-ORIENTED PROGRAMMING Object-oriented (OO) programming is a more recent development that provides approaches that further advance software reliability and reuse. That often allow the software to “fit” better with our understanding of the real world that our programs may be reacting to, or trying to control. 9

Object attributes (instance variables) methods 10

e.g. 11 car attributes color horsepower speed methods changeSpeed() park() refuel()

Properties of OOp encapsulation Programs wishing to use the code of an object can access that code only through public instance variables and public instance methods. inheritance it’s helpful to take advantage of the earlier code by creating a new class that inherits from the old, and simply adds the new features. polymorphism polymorphism means that the execution of a method of a given name may be different depending on the class of the object for which the method is invoked. 12

limousine object inherits attributes and methods of car object 13 car attributes color horsepower speed methods changeSpeed() park() refuel() limousine attributes cost beverages on board schedule methods currentCoord() path()

SCRIPTING LANGUAGES Today there is a large set of programming languages collectively referred to as scripting languages. The original idea of a “script” was a set of operating system commands placed in a file. When a user “executes” the script file, the set of commands in the file is executed in order. This notion of a script is still heavily used. Scripts are very useful for automating routine tasks which otherwise would require a person to sit at a keyboard and type the same commands again and again. 14

For text processing, for example, the languages awk, sed, and Perl are popular. Perl has also become popular for general-purpose programming, and the languages PHP, Ruby, and Python are other languages useful for larger applications. 15

lineNumberFile.pl 16

FUNCTIONAL LANGUAGES Functional languages represent computing as solving mathematical functions. A function takes one or more arguments, and returns a value. For example, an equation for a parabola is: for x=3 17

factorial calculation in C 19

SUMMARY The machine instruction sets themselves constituted the first generation programming languages. Assembly languages, using mnemonic character strings to represent machine instructions, made up the second generation of programming languages. Beginning with FORTRAN in 1954, third-generation languages allowed programmers to work at a higher level, 20

SUMMARY Programs can be compiled or interpreted. Compilers generate machine instructions that can run directly on the computer. Interpreters are programs that read and execute source code a line at a time. Java is an environment that uses both. 21

SUMMARY Some languages are described as imperative, and of these we discussed procedural, object-oriented, and scripting languages. Other languages are described as declarative, and of these we discussed functional languages. 22

REVIEW QUESTIONS: