Types of software
Systems software
Applications software
System software purpose
To control hardware and run applications
Examples of systems software
Operating system
Utility software
Libraries
Translators
Types of application software
General purpose
Special purpose
Bespoke software
Bespoke software
Custom created for a specific user and mostly used by businesses rather than individuals
Open source software
Anyone can access the source code
Licensed but free to use
Anyone can modify the software and sell it as long as the product is also open source
Freeqare
Software that is free for anyone to use but the source code is not available
Proprietary software
No access to source code
Users must pay copyright owner for license to use
May be restrictions on use depending on license
Factors affecting choice of applications
Functionality
Hardware compatibility
Availability
Cost
Reliability
Reputation
Assembler
Translates assembly language into machine code
Hardware specific
Compiler
Translates a whole program written in high level language into machine code
Interpreter
Translates program line by line into machine code
Positives of compilers
Program can be run many times without the need to recompile
Faster to execute
Executable code does not require an interpreter to run
Compiled code cannot be easily read and copied by others
Positives of interpreters
Source code can be run on any machine with the interpreter
If a small error is found, no need to recompile the entire program
Bytecode
Intermediary step between source code and machine code, this is then interpreted by a bytecode interpreter
Stages of compilation
Lexical analysis
Syntax analysis
Semantic analysis
Code generation
Lexical analysis
Whitespace and comments removed
Keywords, contents and identifiers replaced with tokens
Lexer will build a symbol table for run-time memory addresses of identifiers
Syntax analysis
Stream of tokens split into phrases
Phrases are parsed against the rules of the language
Error recorded if phrase is not valid
Syntax rules can be drawn as a syntax diagram
Semantic analysis
Checks for valid syntax that is not a valid program
Code generation
Compiler generates machine code
Code optimisation is also performed
Code optimisation
Removes redundant instructions
Replaces inefficient code with more efficient code
Libraries
Pre-written and pre-compiled functions
Programmers can write their own libraries
Linker
Puts appropriate memory addresses in place so that the program can call and return from a library function
Loader
Copies program and any linked subroutines into main memory to run