Presentation is loading. Please wait.

Presentation is loading. Please wait.

High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.

Similar presentations


Presentation on theme: "High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level."— Presentation transcript:

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 languages. Higher level languages are also easier to read and can typically sometimes work on many different computer operating systems. Some examples of higher level languages are Java, Visual Basic, COBOL, BASIC, C++, and Pascal to name only a few. Lower level languages are typically assembly languages that are machine specific.

2 Typically, in low level languages, you write 1 instruction, and it generates 1 machine instruction. low level languages are typically assembly language High level languages, you write 1 instruction, and it generates a series of machine instructions. In a high level language, you think about the problem, and write instructions to solve it. In a low level language, you think of the problem, and you have to write the instructions to have the computer solve your problem.

3 In general, it requires more skill to be able to do the same problem in a low level language than in a high level language. AND, if there is a problem with a program, it's usually far more easy to fix a high level language program than a low level language program. A processor operates using binary codes, which are difficult for programmers to use in programming. Therefore, a low level language, such as assembly, is one where the text instructions are essentially translated 1:1 into binary.

4 In a high level language, like C or Pascal, each instruction represents several assembly instructions and must be translated into assembly and the assembly then is translated into binary.

5 COMPILER A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

6 CS 540 Spring 2009 GMU6 What is a compiler? A program that reads a program written in one language and translates it into another language. Source language Target language Traditionally, compilers go from high-level languages to low-level languages.

7 Fall 2009“Advanced Compiler Techniques” What is a Compiler? A program that translates a program in one language to another language – The essential interface between applications & architectures Typically lowers the level of abstraction – analyzes and reasons about the program & architecture We expect the program to be optimized, i.e., better than the original – ideally exploiting architectural strengths and hiding weaknesses

8 Interpreter An interpreter is program that translates the higher level language code into equivalent machine level code and the execution is done line by line. An interpreter translates high-level instructions into an intermediate form, which it then executes. IN Contrast a compiler translates high level instructions directly into machine language. Compiled program generally run fast than interpreted programs.

9 The advantage of interpreter is that it does not need to go through the compilation stage during which machine instruction genrates.

10 Fall 2009“Advanced Compiler Techniques” Compiler vs. Interpreter Compilers: Translate a source (human-writable) program to an executable (machine-readable) program Interpreters: Convert a source program and execute it at the same time.

11 Fall 2009“Advanced Compiler Techniques” Compiler vs. Interpreter (2/5) Ideal concept: Compiler Executable Source codeExecutable Input dataOutput data Interpreter Source code Input data Output data

12 Fall 2009“Advanced Compiler Techniques” Compiler vs. Interpreter (3/5) Most languages are usually thought of as using either one or the other: – Compilers: FORTRAN, COBOL, C, C++, Pascal, PL/1 – Interpreters: Lisp, scheme, BASIC, APL, Perl, Python, Smalltalk BUT: not always implemented this way – Virtual Machines (e.g., Java) – Linking of executables at runtime – JIT (Just-in-time) compiling

13 Fall 2009“Advanced Compiler Techniques” Compiler vs. Interpreter (4/5) Actually, no sharp boundary between them. General situation is a combo: Translator Virtual machine Source code Intermed. code Input Data Output

14 Fall 2009“Advanced Compiler Techniques” Compiler vs. Interpreter (5/5) Compiler Pros – Less space – Fast execution Cons – Slow processing Partly Solved (Separate compilation) – Debugging Improved thru IDEs Interpreter Pros – Easy debugging – Fast Development Cons – Not for large projects Exceptions: Perl, Python – Requires more space – Slower execution Interpreter in memory all the time

15 Assembler An assembler is a program that translates symbolic code (assembly language) into executable object code.

16 16 Language Levels High Level Language Assembler Language Machine Language Micro - programming Hardware „Firmware“ Normally deepest free accessible Level

17 Chap 2 Role of Assembler Source Program Assembler Object Code Loader Executable Code Linker

18 Characteristics of good Algorithm An algorithm is written in simple English and is not a formal document. An algorithm must: - be lucid, precise and unambiguous - give the correct solution in all cases - eventually end 1) Finiteness: - an algorithm terminates after a finite numbers of steps. 2) Definiteness: - each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion. 3) Input:- an algorithm accepts zero or more inputs 4) Output:- it produces at least one output. 5) Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.


Download ppt "High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level."

Similar presentations


Ads by Google