levo

Programming

Translation: compilers, interpreters and assemblers

  • 3 things to know
  • AS Unit 1

Overview

Two advantages of a compiler over an interpreter and two advantages of an interpreter over a compiler.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Why is an interpreted program especially slow inside a loop?

Key term

What is bytecode, and why is it used?

Key term

Why must source code be translated before a computer can run it?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Why must source code be translated before a computer can run it?

    Model answer

    A processor can execute only binary machine code instructions, so source code written in a high-level language must first be converted into that form by a translator.

  2. 2

    What is a compiler?

    Model answer

    A compiler is a translator that converts an entire high-level source program into machine code in one operation, producing an executable file before the program is run.

  3. 3

    What is an interpreter?

    Model answer

    An interpreter is a translator that takes one statement of source code at a time, converts it and immediately executes it, repeating this for every statement as the program runs.

  4. 4

    What is an assembler?

    Model answer

    An assembler is a translator that converts assembly language into machine code, with each assembly instruction normally producing one machine code instruction.

  5. 5

    State two advantages of a compiler over an interpreter.

    Model answer

    A compiled program runs faster because the translation has already been done, and the finished executable can be given to a user and run without the translator or the source code being present.

  6. 6

    State two advantages of an interpreter over a compiler.

    Model answer

    An interpreter reports a fault the moment it reaches the offending statement, which suits testing, and a small change can be tried straight away without the whole program being retranslated.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Systems Analysis and Development Approaches
Design, Development and Testing
Implementation and System Security
Programming

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A check requires a value.
presencerangeformat

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

ANormal data is 12, which should be accepted.
BBoundary data is 1 and 50, which should be accepted.
C0 and 51, just outside the limits, should be rejected.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

One byte is made up of 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Programming, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.