Choose software by what the user needs to achieve. Then distinguish the program's purpose, its licence and the way its source is translated: these are separate questions.
Content owner: Michael Print · Written for A-Level learners · Checked against official specifications
The idea to start with
Applications carry out user tasks, such as analysing measurements or producing a report. Utilities support maintenance/management, such as backup, compression or malware scanning. Select features and constraints for the scenario.
A compiler translates source into target code; an interpreter executes through a runtime translation/evaluation process; an assembler translates assembly mnemonics into machine instructions. The compilation pipeline checks and transforms source before producing target code; linking and loading make the resulting program ready to execute.
OCR H446 · 1.2.2(a–f)
Before you start
Useful foundations
Programs, instructions and files
Operating-system services
By the end, you should be able to
Justify applications/utilities and licensing choices
Compare interpreters, compilers and assemblers
Follow lexical/syntax analysis, code generation and optimisation
Explain libraries, linking and loading
Justify an application, not just a category
A spreadsheet is useful for modest tabular data, formulas and quick scenario analysis. A database is better when related data, constraints, concurrent updates and structured queries dominate. Word processing supports a structured written report; presentation software supports a visual talk; graphics/CAD tools address image/design tasks.
A bespoke application may meet unusual workflows precisely but needs development, testing, support and maintenance.
State the required feature and its consequence: a database's referential integrity protects linked records; a spreadsheet's formulas support recalculation. Check compatibility, accessibility, training, licensing and support. An answer that a spreadsheet is easy to use supplies no reason tied to the task.
A utility such as backup software supports the system rather than directly authoring the user's report; an OS may include utilities without making every utility part of its kernel.
Open source and closed source
An open-source licence makes source available with rights to use, inspect, modify and redistribute subject to its terms. Merely letting someone read source does not necessarily grant those rights. Closed-source software ordinarily keeps source/control with its owner and grants more limited use through a licence.
Either model can charge money, receive support and contain defects.
Open source can permit audit/customisation and reduce dependence on a single supplier, but maintenance still needs expertise and licence compliance. Closed source can offer a supported integrated product, while restricting modification and creating vendor dependency.
Availability of skilled support, required features and the actual licence matter more than an assumption that one model is automatically secure, free of cost or legally unrestricted.
Three translator roles
A compiler translates a source program to another representation, commonly object/machine code or intermediate code. Compilation costs occur before that target is run; a native executable can run without recompiling its source. A different platform may require a new target build.
An interpreter executes source or intermediate instructions through a runtime, which can aid interactive development and portability but has runtime overhead. Implementations may combine compilation, interpretation and just-in-time compilation.
An assembler maps assembly-language mnemonics, labels and operands to the target machine's instruction encodings and resolves relevant addresses. Assembly instructions closely reflect the machine architecture. High-level statements may expand into many instructions, so an assembler is not simply a high-level compiler with a different name.
Runtime errors, such as division by zero for an input, can occur even after valid translation.
Compilation as a sequence of transformations
Semantic checking asks whether grammatically valid structures make sense: are names declared and types/operations compatible? It is useful depth alongside OCR’s four named stages, rather than a replacement for them.
Optimisation must preserve the specified observable behaviour. Changing a result to make code faster is invalid. A compiler may optimise at several points; the diagram is a teaching sequence rather than one universal physical order.
Source becomes checked target code
1
Lexical analysis → tokens
Group characters into identifiers, keywords, numbers and operators. Discard insignificant whitespace/comments and record identifiers in a symbol table. A malformed token is a lexical error.
2
Syntax analysis → structure
Check token order against the grammar and construct a representation such as a syntax tree. A missing operand or closing bracket is a structural error.
3
Code generation → target
Turn a checked representation into target instructions, intermediate code or object code.
4
Optimisation → lower cost
Preserve behaviour while reducing costs; for example, calculate a constant expression once or remove unreachable instructions.
Libraries, linkers and loaders
A library supplies reusable routines/types so developers can use tested functionality rather than reimplement it. APIs define how to call it. A linker combines separately compiled modules and required library code, resolving references between them and relocating addresses as needed.
A missing implementation can produce an unresolved-reference link error even when individual source files compiled.
Static linking includes needed library code in the executable; dynamic linking uses shared libraries at load/run time. Dynamic sharing can reduce duplication and permit updates, but compatible libraries must be available.
A loader places the executable and necessary data into memory, establishes required mappings/addresses and begins execution. The OS participates in loading and protection. Linking resolves a program's pieces; loading prepares an executable to run.
Worked example
Follow a small expression
In a hypothetical typed language, source total = price * (2 + 3) becomes tokens: identifier total; =; identifier price; *; (; integer 2; +; integer 3; ).
Syntax analysis groups the parenthesised addition as one operand of multiplication, then the assignment. Semantic checking requires an appropriate declaration/type for price and total.
Constant folding can replace (2 + 3) with 5. Target code loads price, multiplies by 5 and stores total. It must preserve the language's numerical semantics.
If a separate module calls a library routine, the linker resolves that reference. The loader prepares the executable in memory. Input-dependent failures remain possible at runtime.
Classify different failures
Example
Likely stage
Reason
Unrecognised character in a token
Lexical
Cannot form valid token
price * )
Syntax
Missing operand/invalid structure
Undeclared price
Semantic
Name has no valid declaration
Missing compiled library routine
Linking
Reference cannot be resolved
Worked example
Choose software for a club
For a single organiser comparing attendance forecasts, a spreadsheet supplies formulas and quick what-if calculations. For many staff updating members, payments and bookings, a relational database better supports related records and concurrency.
A backup utility should retain restorable copies independently of ordinary working files. Decide open/closed source by available expertise, licence terms, features and support, rather than assuming the free download is the cheapest supported option.
Original A-Level practice
4 original questions total 14 marks. Attempt each before opening the independently written indicative marking guidance.
Question 1
3 marks
Distinguish compiler, interpreter and assembler.
Show solution and marking guidance+
Indicative answer
1 mark: compiler translates source to target code before that target executes.
1 mark: interpreter evaluates/executes source or intermediate instructions through a runtime.
1 mark: assembler translates assembly mnemonics/operands to machine instruction encodings.
Question 2
4 marks
For result = count * (4 + 2), describe lexical analysis, syntax analysis, optimisation and code generation.
Show solution and marking guidance+
Indicative answer
1 mark: tokenise identifiers, operators, numbers and parentheses.
1 mark: check grammar and group the addition before multiplication/assignment.
1 mark: constant folding can replace 4 + 2 with 6 while preserving behaviour.
1 mark: emit target instructions to load count, multiply by 6 and store result.
Question 3
3 marks
Two source modules compile, but one calls a library routine absent from the final build. Identify the failure and distinguish the loader's role.
Show solution and marking guidance+
Indicative answer
1 mark: linking fails to resolve the routine/reference.
1 mark: the linker combines modules/libraries and resolves their references.
1 mark: the loader places/prepares an executable in memory and begins execution.
Question 4
4 marks
A charity has a developer but needs reliable support for customised records software. Evaluate open and closed source.
Show solution and marking guidance+
Indicative answer
1 mark: open source may permit inspection/modification for the custom workflow.
1 mark: the charity still needs maintenance expertise, licence compliance and support.
1 mark: closed source may offer vendor support but restrict modification/create dependency.
1 mark: justify a conditional decision using required features, available support and total maintenance cost. Either choice can be defensible.
Specification and references
This guide addresses OCR H446 1.2.2(a–f). Check your examination year and the complete specification for the assessment scope.
These are independently written explanations and practice questions. CompSciTutoring.co.uk is not affiliated with or endorsed by an examination board. The marking guidance is indicative; always check the syllabus for your examination year.