1.2.2 Applications Generation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/43

flashcard set

Earn XP

Description and Tags

Translators, utilities, open and & closed source software, linkers, loaders and libraries

Last updated 4:31 PM on 3/24/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

44 Terms

1
New cards

Translator

Piece of software that converts a computer program into a form that can be executed by the processor

2
New cards

Types of translator

  • Interpreter

  • Compiler

  • Assembler

3
New cards

Describe how interpreters translate code

  • Translates and executess each line of source code one by one. For each line:

    • Checks syntax, and if theres an error it is reported and the program halts

    • If no errors found, the line of code is converted to its machine code equivelent and is executed

    • If a runtime error occurs, the program crashes

4
New cards

Advantages of interpreters

  • Line-by-line approach allows quick identification and correction of each error as it occurs, without having to translate the whole program each time.

    • This makes interpreters very useful during developement of a program

  • More portable - the same source code (or byte code) can be executed on a range of platforms as long as the right interpreter is available.

    • This makes them useful when the platform on which a program will run is unkown (e.g. for websites using JS)

5
New cards

Disadvantages of interpreters

  • Every time the program is run it must be translated again. This means it will run more slowly than an executable file produced by compilation.

  • Requires interpreter to be installed on the computer for the program to run

6
New cards

Compilers

  • Translates code all at once

  • Produce an executable file, but does not execute the code

  • Executable file produced is machine code suitable for a specific instruction set architecture

  • A list of errors reported at end of compilation process (if there are any)

7
New cards

Advantages of compilers

  • Once successfully compiled, the executable file wont need to be tranlated again (unless the code is changed)

    • Code can be run without a translator being present

    • Executes more quickly than interpreted code once compiled

  • Provides protection of source code - useful for closed source software where you don’t want the source code to be publicly accessible

8
New cards

Disadvantages of compilers

  • Errors are reported at the end of the compilation process

    • Any erros require the program to be corrected and recompiled until no errors are present

  • Produces machine code for a specific instruction set architecture

9
New cards

Stages of compilation (first to last)

  • Lexical analysis

  • Syntax analysis

  • Code generation

  • Code optimisation

10
New cards

What happens in lexical analysis

  • Non-program elements (e.g. comments & whitespace) are removed

  • Reserved words / keywords are tokenized

  • Identifier names are added to a symbol table - this allows the compiler to keep track of all the identifiers that have been declared in the program

11
New cards

What happens in syntax analysis

  • Checks code tokens follow the grammatical rules of the language

  • An abstract syntax tree is created

    • Can be used to check no code tokens are missing

  • Checks code tokens are in correct order

  • If a syntax error is found it is added to a list of erros and will be reported at the end of compilation. Error diagnostics will be given with the list.

  • Adds detail to the symbol table - e.g. data type or scope of variable

  • Semantic analysis occurs - highlights certain types of logic errors in the program (e.g. list index is out of range)

12
New cards

Abstract syntax tree

  • Maps the structure of the program

  • Used to check syntax is correct

  • Dependant on syntax so is different for each programming language

13
New cards

Code generation

The abstract syntax tree is used to create object code

14
New cards

Object code

  • Binary represeentation of source code

  • Executable file before linked libraries have been included

15
New cards

Code optimisation

  • Occurs throughout compilation process, but especially in the code generation stage

  • May identify redundant or repeated code

  • Can remove and rearrange code as necessary

16
New cards

What is the purpose of code optimisation?

  • To make the program run faster/ code is more efficient

  • To make the program use fewer resources/less memory

17
New cards

What are assemblers?

  • Translaters that produce executable code from assembly

  • Assembly code is platform specifc and as such the assemblers are as well

18
New cards

Describe how assemblers translate code

  • Code is translated on a one basis - each line of assembly code is equivelent to one line of machine code

  • Comments in the assembly program are removed

  • Symbolic references are replaced with actual addresses

19
New cards

Linkers

Piece of code the links programs to software libraries to create a single executable file

20
New cards

Static linker

  • Combines code and libraries directly into one file. This increases the size of the file

  • External updates to libraries wont affect the program - this allows specific versions of a library to be used

21
New cards

Dynamic linker

  • Adds the addresses to libraries (and modules) where they are used in the executable file

  • Keeps the file size small and allows external updates to libraries to feed through to the main file

22
New cards

Why are linkers needed?

  • The user running the program will not necessarily have the library installed on their machine

  • Therefore the relevant code needs to be included within the final executable file

  • It is the job of the linker to combine this code.

23
New cards

Loaders

  • Provided by the operating system

  • When the program is executed, the loader:

    • Copies the executable code from secondary storage into main memory

    • Loads the required software libraries

24
New cards

(Software) Libraries

  • Sections of code written by other authors containing useful routines

  • Are often precompiled

25
New cards

Advantages of using libraries

  • Saves time as there is no need to rewrite code

  • Allows you to use the expertise of others to…

    • … complete tasks that require specialist knowledge

    • … abstract away complexity

  • If it’s from a reliable source, it has usually been thoroughly tested and therefore is efficient and reliable. This:

    • Makes debugging easier

    • Saves time

26
New cards

Disadvantages of libraries

  • May (significantly) increase size of compiled file if the library contains many routines that aren't being used.

  • Not written by the programmer so introduces uncertainty.

    • Programmer needs to spend time familiarising themselves with it

    • May require further testing

27
New cards

What is bytecode / intermediate code

  • Source code that has been compiled into low-level code designed to be run on a virtual machine (the interpreter).

  • It is partially compiled code

28
New cards

How is byte code / intermdediate code used

  • The source code is compiled into low-level ____

  • This can then be executed by any machine that has the suitable virtual machine (interpreter) installed on it

  • As such the ____ can be distributed as a ready to run program

29
New cards

Advantages of bytecode / intermediate code

  • Speeds up translation process

  • Executable on a wide range of platforms as long as suitble virtual machine (interpreter) is installed on the machine

30
New cards

Disadvantages of bytecode / intermediate code

  • Slower execution than fully compiled code

  • Less protection of source code than a fully compiled language

31
New cards

What are the differences between a compiler and an interpreter?

  • Compiler translates code all at once, whereas interpreter translates code line by line

  • Compiler produces executable file for reuse so doesn’t need to be translated everytime it is run. An interpreter needs to re-translate every time the program is run.

  • Compiler lists all errors at the end of compilation. Interpreter stops at the first error.

  • Compiled programs have the source code hidden. Interpreted programs have the source code visible.

32
New cards

Open source software

Software that:

  • Can be used by anyone without a license.

  • Is distributed with the source code.

33
New cards

Closed source software

Software that:

  • Requires the user to hold an appropriate license to use it.

  • Users cannot access the source code as the company owns the copyright license.

34
New cards

Advantages of open source

  • Can be modified and improved by anyone

  • Technical support from online community

  • Can be modified and sold on

35
New cards

Advantages of closed source software to a user

  • Thorough, regular and well-tested updates

  • Company owning software provides expert support and user manuals.

  • High levels of security as developed professionally.

36
New cards

Disadvantages of open source software

  • Support available online may be insufficient or incorrect.

  • No user manuals

  • Lower security as may not be developed in a controlled environment

37
New cards

Disadvantages of closed source software

  • License restricts how many people can use the software at once

  • Users cannot modify and improve software themselves

38
New cards

Utility (software)

Software that performs a specific task and is usually related to the upkeep of the system.

39
New cards

Examples of utility software

  • Disk Defragmentation

  • File management

  • Disk Drivers

  • System Clean-up

  • Anti-Virus/Malware

40
New cards

Purpose of disk defragmentation utility

To keep optimal r/w speed of the HDD

41
New cards

Purpose of file management utility

To allow easy access to file system

42
New cards

Purpose of disk driver utilities

To allow the use of new peripheral devices

43
New cards

Purpose of system clean-up utility

To keep computer system free of redundant files

44
New cards

Purpose of anti-virus/malware utility

To find and remove/quarantine viruses/malware