1.2.2 Applications Generation Flashcards
What are the two types of software?
Applications and systems
What is an application?
A program that can be run on a computer, allowing the user to carry out specific tasks.
Give examples of applications software
Word processing, spreadsheets, web browsers.
Give examples of systems software.
Library programs, utility programs, operating system, drivers
What are utilities?
System software with a specific purpose, usually related to maintenance.
(EG: Optimising computer performance, backing up files)
Provide examples of utilities
Compression, Disk defragmentation, antivirus, automatic updating, backup
Disk defragmentation
Rearranges contents of the hard drive so they can be accessed faster, thus improving performance.
Define open source software
- Can be used by anyone without a license
- Distributed with the source code.
Define closed source
Requires the user to hold an appropriate license to use it. Source code cannot be accessed as the company owns the copyright license.
Pros: Open source
Pros
- Can be modified and improved by anyone
- Technical support from online community
- Can be modified and sold on
Pros: Closed Source
Pros
- Thorough, regular and well tested updates.
- Company owning software provides expert support and user manuals.
- High levels of security as developed professionally.
Cons: Open source
Cons
- Support available online may be insufficient or incorrect. No user manuals.
- Lower security, as it may have not been developed in a controlled environment.
Cons: Closed source
Cons
- License restricts how many people can use the software at once.
- Users cannot modify and improve software themselves
What three things must user consider when deciding between open source or closed source?
- Relevance to task
- Costs (implementation, maintenance, license)
- Functionality (ease of use, features available)
What is a translator?
A program that converts high level source code into low level object code.
What are the three types of translator?
Compiler, Interpreter, Assembler
What does a Compiler do?
Compilers translate high level code into machine code all at once, after carrying out a number of checks and reporting back any errors.
What is compiled code specific to?
A particular processor type and operating system.
Compiler Disadvantages
- The initial compilation process is longer than using an interpreter or an assembler
- If changes need to be made, the whole program must be recompiled.
- Once code has been compiled, it can only be executed on certain devices.
Compiler Advantages
- Once code has been compiled, it can be run without a translator being present
Interpreter
Interpreters translate and execute code line-by-line. They stop and produce an error if a line contains an error.
Interpreter Disadvantages
- Code must be translated each time it is executed.
- Interpreted code requires an interpreter in order to run on different devices.
Interpreter Advantages
- Useful for testing sections of code and pinpointing errors
- Interpreted code is more portable. As long as the right interpreter is available, code can be executed on a range of platforms
What do assemblers do?
Translate assembly code into machine code. Code is translated on almost a one-to-one basis.
What are the four stages of compilation?
Lexical analysis, Syntax analysis, code generation and optimisation.
Syntax Analysis
1) Tokens are checked against the grammar and rules of the programming language. Any tokens that break the rules are flagged up as syntax errors, and added to a list of errors.
2) An abstract syntax tree is produced, which represents the source code in the form of a tree.
3) Semantic analysis is carried out, where logic mistakes within the program are detected.
What are examples of syntax errors?
Incomplete set of brackets, undeclared variable type
What are examples of semantic errors?
Multiple declaration, undeclared identifiers.
Lexical Analysis
1) Whitespace and comments are removed from code.
2) The remaining code is analysed for keywords and names of variables and constants. These are replaced with tokens.
3) Information about the token associated with each keyword or identifier is stored in a symbol table.
Code Generation
The abstract syntax tree produced in the syntax analysis stage is used to produce machine code.
Optimisation
1) Redundant parts of code are detected and removed.
2) Repeated sections of code may be grouped and replaced with a more efficient piece of code that produces the same result.
What is the danger involved with the optimisation stage?
Excessive optimisation may alter the way in which the program behaves.
What is a linker?
A piece of software which links external modules and libraries included within the code.
What are the two types of linker?
Static and Dynamic
Static Linker
Modules and libraries are added directly into the main file, increasing the file size.
Dynamic Linker
Addresses of modules and libraries are included in the file where they are referenced. When the program runs, the loader retrieves the program at the specified address so it can be executed.
Advantage of dynamic linker
- Files remain small
- External updates feed through to the main file, meaning theres no need to rewrite the code.
What are loaders provided by? What do they do?
Programs provided by the operating system.
When a file is executed, it retrieves the library or subroutine from the given memory location.
What are libraries?
Pre-compiled programs which can be incorporated within other programs using either static or dynamic linking.
What are advantages of libraries?
- They are ready to use and error free, which saves development time.
- They can be reused within multiple programs.
What do libraries often provide? Why is this useful?
A specialised range of functions.
These functions would require a lot of time and effort to develop, saving programmers from having to ‘reinvent the wheel’.
What benefit does the optimisation stage provide?
Code is faster to execute.
Benefit of using static linker
It allows you to use a specific version of a library, as updates to modules and libraries externally dont affect the program.