High-level Languages.

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

Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Chapter 1 An Overview of Computers and Programming Languages.
Lecture 1: Overview of Computers & Programming
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
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.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
1 Chapter-01 Introduction to Computers and C++ Programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Chapter 1 An Overview of Computers and Programming Languages.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
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.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Exam Format  105 Total Points  25 Points Short Answer  20 Points Fill in the Blank  15 Points T/F  45 Points Multiple Choice  The above are approximations.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
 Programming - the process of creating computer programs.
Introduction Why are virtual machines interesting?
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CS 1308 Exam 2 Review. Exam Format 110 Total Points 24 Points Short Answer 28 Points Fill in the Blank 16 Points T/F 36 Points Multiple Choice The above.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Chapter 1 An Overview of Computers and Programming Languages.
The Big Picture. My Story  Wrote great programs  Didn’t understand how they worked.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Computer Software.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Software Engineering Algorithms, Compilers, & Lifecycle.
CSC235 Computer Organization & Assembly Language
Java Programming: From the Ground Up
Lecture 1b- Introduction
CMIT100 Chapter 14 - Programming.
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
Key Ideas from day 1 slides
Microprocessor and Assembly Language
Introduction to Computers and Java
Programming Concepts and Languages
Computer Software CS 107 Lecture 2 September 1, :53 PM.
Teaching Computing to GCSE
Teaching Computing to GCSE
High Level Programming Languages
Lesson Objectives Aims Key Words Compiler, interpreter, assembler
CS105 Introduction to Computer Concepts Intro to programming
CMP 131 Introduction to Computer Programming
Programming Languages
Principles of Programming Languages
Programming language translators
Presentation transcript:

High-level Languages

Assembly language benefits Hides details of hardware

Assembly language benefits Hides details of hardware Easier to remember instruction names

Assembly language benefits Hides details of hardware Easier to remember instruction names A tiny step closer to how humans think

Assembly language benefits Hides details of hardware Easier to remember instruction names A tiny step closer to how humans think Assembly language is a useful level of abstraction from the bare hardware

Assembly language benefits Hides details of hardware Easier to remember instruction names A tiny step closer to how humans think Assembly language is a useful level of abstraction from the bare hardware Assembly language programs must be "assembled" into machine language executables.

Assembly Language issues Still tied directly to the machine language instruction set

Assembly Language issues Still tied directly to the machine language instruction set Most machine language instructions do only a tiny amount of work

Assembly Language issues Still tied directly to the machine language instruction set Most machine language instructions do only a tiny amount of work Humans solve problems at a higher level, using much larger steps

Example For each value I read in from a file If the value is negative, then add it to the list of expenditures Otherwise add it to the list of income (This is pseudo-code, like the way we write textual storyboards)

High-level languages Def: a programming language that provides statements that are a closer match to the way humans solve problems than assembly language. Why can't we just write programs in English (or any other spoken language)?

Examples COBOL – business application language FORTRAN – scientific application language BASIC, Pascal – teaching languages Ada – designed and used for US military software Smalltalk – early object-oriented language C, C++ - systems/general purpose languages

Can a program in a high-level language be executed on a computer?

High-level language translation compiler – a program that translates a program written in a particular high level language into another form. What form should a compiler output?

Compiled languages High level languages that are translated into a machine language executable are called "compiled languages." Executables might be called "native code."

HLL correspondence to AL Benefit of HLL is being able to work in "bigger steps." One HLL statement might translate to many AL/ML instructions

HLL correspondence to AL Benefit of HLL is being able to work in "bigger steps." One HLL statement might translate to many AL/ML instructions Java statement sum = sum + value;

HLL correspondence to AL Benefit of HLL is being able to work in "bigger steps." One HLL statement might translate to many AL/ML instructions Woody equivalent CopyFrom sum Add value CopyTo sum Java statement sum = sum + value;

Hierarchy of abstraction High-level lang. program Language closest to "how humans think." Input for compiler Compiler Assembly language program Assembler Machine language program

Hierarchy of abstraction High-level lang. program Translates programs from a specific HLL into a particular architecture's assembly language. Compiler Assembly language program Assembler Machine language program

Hierarchy of abstraction High-level lang. program Compiler Assembly language program "Human readable" form of a particular architecture's machine language. Input for assembler. Assembler Machine language program

Hierarchy of abstraction High-level lang. program Compiler Assembly language program Translates a particular architecture's assembly language into that archi- tecture's machine language. Assembler Machine language program

Hierarchy of abstraction High-level lang. program Compiler Assembly language program Assembler Machine language program Binary form executable version of program.

Interpreted Languages Interpreter – a program that can execute high-level language programs "directly," without first being translated to machine language. Code in the interpreter emulates the circuitry that understands how to carry out each machine language instruction. Some are "scripting" languages, used to stitch together existing executables to perform higher level tasks.

Examples TCL/TK Python Windows Batch files/Windows Scripting Host Perl PHP – web scripting language

Compiled vs. interpreted Compiled execution Hardware follows instruction cycle for each machine language instruction in the executable Interpreted execution Interpreter translates HLL statement, then imitates hardware to execute it.

Interpreted pros and cons

"Hybrid" languages Goal: High Level Language with platform-independent executable format, performance close to compiled languages. How?

Examples Java – originally intended for set-top TV/Video boxes, widely used on the web C# - Supported by MS .Net platform, their answer to Java

How it works Source program is compiled to an intermediate form – byte code Byte code is the assembly language for an imaginary architecture For each supported platform, write a "virtual machine" emulator that reads byte code and emulates its execution.

Java source program Java compiler Java byte code Java Virtual Machine Java Virtual Machine Java Virtual Machine Java Virtual Machine Wintel Hardware Sun Hardware IBM Hardware Mac Hardware

web request web request web request Web server Java Virtual Java Machine Applet Java Virtual Machine Applet Java Virtual Machine Applet web request web request web request HTML HTML Java Applet Java Applet Java Applet HTML Web server

"Just In Time" compilation JVMs actually compile each bytecode instruction to native code the first time it is used. Subsequent executions of that instruction are faster. Why would the same instruction be used again?

Computer Systems A computer system is the combination of hardware and operating system An operating system is the software that controls the overall operation of the computer, managing the processor, memory, files and attached devices

Computer System examples PC – MS Windows OS running on Intel CPU Mac – Mac OS running on IBM or Intel CPU Linux – Linux OS running on Intel CPU Unix – Unix OS running on various hardware platforms IBM – OS/400 running on IBM servers