Year 10 · Computer Science · Summer 1
Software · Lesson 4 of 5
IDEs
Practical4.2 Types of programming language, translators and IDEs
Year 10 · Computer Science · Software · Lesson 4 of 5
You will learn to
- Identify each IDE feature in the editor we use in class.
- Describe the IDE features: code editor, run-time environment, translator, error diagnostics, auto-completion, auto-correction and prettyprint.
- Explain how one IDE feature helps a programmer, in a past-paper answer.
Year 10 · Computer Science · Software · Lesson 4 of 5
Success criteria
You have got it when you can say:
- I can point to each IDE feature on the screen and name it.
- I can describe three IDE features using the syllabus words.
- I can answer a past-paper IDE question and mark it with the scheme.
Year 10 · Computer Science · Software · Lesson 4 of 5
Retrieval starter
Questions from before. Write your answers, then show them.
- Last lesson
An IDE provides…
A The operating systemB Only the keyboardC An editor, a run button and a debugger
C. An editor, a run button and a debugger
- Last unit
DECLARE Marks : ARRAY[1:30] OF INTEGER makes…
A One numberB 30 stringsC 30 whole-number slots, numbered 1 to 30
C. 30 whole-number slots, numbered 1 to 30
- Earlier this year
Parity can…
A Detect two flipped bitsB Detect and fix any errorC Detect one flipped bit but not fix it
C. Detect one flipped bit but not fix it
Year 10 · Computer Science · Software · Lesson 4 of 5
Key words (1 of 4)
- System software
- Software that runs and manages the computer, such as the operating system and utilities.
- Device driver
- A small program that lets the OS communicate with one particular device.
- High-level language
- A programming language close to English, which works on many types of processor.
- Low-level language
- A language close to machine code, written for one type of processor.
Year 10 · Computer Science · Software · Lesson 4 of 5
Key words (2 of 4)
- Machine code
- Binary instructions that the processor can run directly.
- Assembly language
- A low-level language that uses mnemonics; each line matches one machine code instruction.
- Mnemonic
- A short, easy-to-remember code for a machine instruction, such as LDA or ADD.
- Assembler
- A translator that turns assembly language into machine code.
Year 10 · Computer Science · Software · Lesson 4 of 5
Key words (3 of 4)
- Compiler
- A translator that turns the whole high-level program into machine code at once and creates an executable file.
- Interpreter
- A translator that translates and runs a high-level program one line at a time.
- Executable file
- A file of machine code that can run on its own, without the source code or translator.
Year 10 · Computer Science · Software · Lesson 4 of 5
Key words (4 of 4)
- IDE
- Integrated development environment: one program with the tools to write, translate, run and debug code.
The explanation · step 1 of 7 · part 1 of 3
High-level and low-level languages
The processor only understands machine code: binary instructions such as `10110000 01100001`.
A low-level language is close to machine code. It is written for one type of processor. Machine code and assembly language are low-level.
A high-level language is close to English and maths. Python, Java and Visual Basic are high-level. One line of high-level code becomes many machine code instructions.
The explanation · step 1 of 7 · part 2 of 3
High-level and low-level languages (continued)
| High-level language | Low-level language | |
|---|---|---|
| Easy to read, write and debug? | Yes: uses English-like words | No: hard to read and follow |
| Runs on different processors? | Yes: portable (machine-independent) | No: written for one processor (machine-dependent) |
| Control of hardware | Little direct control | Direct control of memory and registers |
| Speed and memory | May be slower and use more memory | Can be very fast and compact |
| Needs translating? | Yes, by a compiler or interpreter | Assembly needs an assembler; machine code needs nothing |
| Typical use | Most apps, websites, games | Device drivers, embedded systems, very fast code |
The explanation · step 1 of 7 · part 3 of 3
High-level and low-level languages (continued)
High-level languages save programmers time and reduce mistakes. Low-level languages are used when every byte and every microsecond matters, for example in a washing machine's chip.
"Low-level" does not mean "worse". It means "close to the hardware".
The explanation · step 2 of 7 · part 1 of 3
Assembly language and mnemonics
Assembly language is a low-level language. Each instruction matches one machine code instruction.
Instead of binary, it uses short codes called mnemonics. A mnemonic is a few letters that are easy to remember, such as `LDA` for "load" or `ADD` for "add".
Assembly lets the programmer work directly with memory addresses and the accumulator (ACC) register.
The explanation · step 2 of 7 · part 2 of 3
Assembly language and mnemonics (continued)
LDA 20 // copy the number at memory address 20 into the ACC ADD 21 // add the number at address 21 to the ACC STO 22 // store the ACC into address 22 END // stop If address 20 holds 7 and address 21 holds 5: after LDA 20 ACC = 7 after ADD 21 ACC = 12 after STO 22 address 22 holds 12
# The same job in one high-level line c = a + b
The explanation · step 2 of 7 · part 3 of 3
Assembly language and mnemonics (continued)
Assembly is easier for humans than binary but still gives full control of the processor. That is why it is used for device drivers and small embedded systems.
The exact mnemonics change between processor types. In the exam, you will not need to learn a set; you need to know what a mnemonic is.
The explanation · step 3 of 7 · part 1 of 2
The assembler
The processor cannot run assembly language directly. It must be translated into machine code first.
An assembler is the translator for assembly language. It turns each mnemonic into its matching binary instruction.
Because one assembly line equals one machine code instruction, assembling is a simple one-to-one translation.
The explanation · step 3 of 7 · part 2 of 2
The assembler (continued)
Each processor has its own instruction set, so each needs its own assembler.
The explanation · step 4 of 7 · part 1 of 3
Translators for high-level languages: the compiler
A translator turns source code (the code a person writes) into machine code. There are three types: assembler, compiler and interpreter.
A compiler translates the whole program in one go, before it runs.
If there are errors, it lists all of them at the end in an error report. The program will not run until every error is fixed.
The explanation · step 4 of 7 · part 2 of 3
Translators for high-level languages: the compiler (continued)
When there are no errors, it produces an executable file (for example a `.exe`). This file can run again and again without the compiler and without the source code.
The explanation · step 4 of 7 · part 3 of 3
Translators for high-level languages: the compiler (continued)
Translation happens once, so the finished program runs fast. Keeping the source code hidden also protects the company's work from being copied.
The explanation · 3 more steps
More on the lesson page
The lesson page has the rest of the explanation, step by step:
- Translators for high-level languages: the interpreter
- Compiler or interpreter? Compare them
- The IDE: a programmer's toolbox
Year 10 · Computer Science · Software · Lesson 4 of 5
Quick quiz · 1 of 3
The bootloader…
- A Translates Python
- B Loads the operating system from storage into RAM at start-up
- C Prints documents
B. Loads the operating system from storage into RAM at start-up
It lives in ROM and runs first when the power comes on.
Year 10 · Computer Science · Software · Lesson 4 of 5
Quick quiz · 2 of 3
An interrupt is…
- A A loop that never ends
- B A type of virus
- C A signal that makes the CPU pause and deal with something
C. A signal that makes the CPU pause and deal with something
A key press or a printer out of paper. The CPU saves its place, handles it, carries on.
Year 10 · Computer Science · Software · Lesson 4 of 5
Quick quiz · 3 of 3
A compiler…
- A Translates one line at a time, every run
- B Translates the whole program once into machine code
- C Only checks spelling
B. Translates the whole program once into machine code
It produces an executable file. Errors are reported at the end.
Year 10 · Computer Science · Software · Lesson 4 of 5
Exit ticket
Answer on paper before you go. Then check.
An interpreter stops…
A Only after translating everythingB At the first error it meetsC Never
B. At the first error it meets It translates and runs line by line, so it stops where the error is.
Which is a low-level language?
A Assembly languageB JavaC Python
A. Assembly language Assembly is close to the chip. An assembler turns it into machine code.