Download presentation
Presentation is loading. Please wait.
Published byGiles Parrish Modified over 6 years ago
1
High or Low Level Programming Language? Justify your decision.
Machine Java Python Scratch Assembly
2
High/Low Languages & Language Translators
4.5.1 4.5.2
3
Learning Objectives 4.5.1 Understand what is meant by high-level and low-level programming languages and assess their suitability for a particular task 4.5.2 Understand what is meant by a compiler and an interpreter Online worksheet for this lesson
4
High/Low Languages 4.5.1
5
Check Java Python Scratch Assembly Machine High Level Languages
Low Level Languages Machine
6
10 min Your Turn: Take Notes Watch this video about high and low level programming languages Take notes in a table like this: High Level Low Level Task 1: On class worksheet
7
Characteristics Check Scratch Python Java Assembly Machine
Works on many different microprocessors (machine independent) Commands look similar to English language Easier for humans to read/understand than assembly or machine code Scratch Easy and quick for humans to write and maintain code High Level Languages Python Java Needs to be translated to machine code Low Level Languages Each statement is exactly one instruction in machine code Use mnemonics (abbreviations) Only works on one type of microprocessor (machine dependent) Each instruction has an opcode and operands Assembly Needs to be translated to machine code Machine 0s and 1s only No translator needed Directly executable by machine Only works on one type of microprocessor (machine dependent) Difficult for humans to read
8
Your Turn: Justify Usage
5 min Your Turn: Justify Usage Why would you want to use each either a high or low level language? Task 2 on class worksheet We’ll check your answers with the next slide Task 2: On class worksheet
9
Why Use Each? Check Python Java Assembly Machine
May have built-in libraries of useful functions already written and tested. Commands look similar to English language, so it’s easy and quick for humans to write and maintain code Code can be written once and ported to many platforms (Windows, LINUX) High Level Languages Python Java Easy and quick for humans to write and maintain code Low Level Languages It’s a very good way to control hardware, like printers or graphics cards. Sometimes, it’s the only language available. For example, a new chip is invented. Sometimes, the function needed is not available in a high-level language. Can be used to speed up parts of high-level language programs. Each statement is exactly one instruction in machine code, so it’s very efficient. Assembly Machine Almost no one writes machine code now.
10
Questions? That finishes ‘high level and low level’ programming languages Any questions before moving on?
11
Language Translators 4.5.2
12
How does each get translated to machine code?
Scratch The translator is called an ‘interpreter’. Python High Level Languages Java The translator is called a ‘compiler’. Low Level Languages The translator is called an ‘assembler’. It translates from an assembly language to machine code. Assembly Machine No translation necessary. It’s already machine code.
13
Compiler vs Interpreter
10 min Compiler vs Interpreter Watch this video about high and low level programming languages Take notes on the worksheet We’ll check your answers with the next slide Interpreter Compiler Task 3: On class worksheet
14
Compiler vs Interpreter
Check Compiler vs Interpreter Interpreter Compiler One line of code is translated and executed at a time; one by one The interpreter is required for the whole time the program is running Runs slowly Can correct mistakes as you go along Must have interpreter to run code Very good for prototyping (mocking up) Python, Scratch Translates the whole list of instructions in one go Has some extra processing time in the beginning The compiler is not needed to execute the translated instructions Execution of translated code is very fast Cannot correct mistakes after translation Don’t need compiler to run resulting code Java, C, C++
15
Compilers, Interpreters, Assemblers
Assembly Java Python INTERPRETER Scratch COMPILER ASSEMBLER Low Level INTERPRETER High Level Machine Code
16
Plenary – Make a Choice 2 Assembly Language Interpreter
High Level Language Compiler Low Level Language Machine Language Needs no translation Uses mnemonics. Very efficient. Is not very easy for humans to read or write. Easy for humans to read and quick for humans to write. Has to be present for a program to run. Is not needed to run the translated program. 5 4 6 3 1
17
Homework Complete this lesson’s homework worksheet Due in 2 lessons
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.