1. 2. 2 Applications Generation Flashcards
Nature of applications (Application Vs System Software)
- Software categorised as application or system software
- Application software designed to be used by end-user to perform specific task
- Requires systems software to run, Word and Web Browsers examples of Applications
- System software, low-level software, responsible for running computer system smoothly
- Interacts with hardware, provides platform for application software to run
- User does not directly interact with system software
- Ensures high performance for the user, OS and Device drivers’ examples of system software
Utilities
- Software that performs specific task, usually related to upkeep of the system
- Compression, files compressed and decompressed, easier to transmit over internet
- Disk Defragmentation, when HDD read/write times slow down
- File fragmented (stored different parts of HDD), defrag rearranges HDD, contents accessed faster improved performance
- Antivirus detects potential threats, alerts user to take action (remove threat)
- Automatic update, OS kept up to date, tackles bugs and security flaws, ensure system less vulnerable to malware and hacking threats
- Backup, auto creates routine copies of specific files selected by user, how often also specified by user
- If accident where to occur (power failure), files can be recovered
Open Vs Closed Source
- Source code is written by programmer, refers to object code before it has been complied
- Open Source (Source code available to public), Closed Source (Source code not available)
- User chooses open or closed depending on suitability of software to task they will be using it for
- User must consider cost (implementation, maintenance, staff, license) and functionality (features, ease of use)
Open Source
- Used by anyone without a license, distributed with source code
- Can be modified and improved by anyone
- Technical support from online community
- Can be modified and sold on
- Support available online could be insufficient, incorrect, no user manuals
- Lower security, not be developed in controlled environment
Closed Source
- Requires user to have appropriate license to use it, cannot access source code, company has copyright licence
- Regular and well tested updates
- Expert support from company, user manuals
- High levels of security, developed professionally
- License restricts amount of people that can use software at once
- User cannot modify/improve software themselves
Translators
- Translator, program that converts high-level source code into low-level object code, ready to be executed by computer
- Types of translators, compiler, interpreter and assembler
Compiler
- Translates high-level code into machine code at once, after checks done, errors reported
- Initial compilation longer than other translators, if changes need to be made whole program needs to be recompiled
- Code can only be executed on certain devices once it has been compiled into machine code
- Specific to processor type and OS, code can run without presence of translator
Interpreter
- Translates high-level code into machine code line by line
- Stops and produces an error if error in line
- Slower than running compiled code, must be translated each time it is used with interpreter
- Useful for testing sections of code, pinpointing errors, save time compared to compiling whole program
- Requires an interpreter to run on different devices can be executed on range of platforms with correct interpreter
Assembler
- Assembly code, low level language, platform specific (instructions used dependent on instruction set of processors)
- An instruction set is the complete set of all instructions in machine code that can be recognised and executed by the CPU
- Assembler translates assembly code into machine code, one line assembly equivalent one line machine code
Stages of compilation
When compiler used, high level code goes through 4 stages before its turned into object code that is ready to be executed, Lexical Analysis, Syntax Analysis, Code Generation, Optimisation
Stages of compilation
When compiler used, high level code goes through 4 stages before its turned into object code that is ready to be executed, Lexical Analysis, Syntax Analysis, Code Generation, Optimisation
Lexical Analysis
- White space and comments are removed
- Remaining code analysed for keywords / names of variables and constants, replaced with tokens
- Information on tokens associated with the keyword or identifier is stored in the symbol table
Syntax Analysis
- Tokens are analysed against the grammar and rules of the programming language
- Anything that breaks these rules is flagged as a syntax error that is added to a list of errors
- Examples of syntax errors include undeclared variable type or an incomplete set of brackets
- Abstract syntax tree is produced represents the source code in the form of a tree
- Further detail about the identifiers added to symbol table
- Semantic analysis carried out where logic mistakes within the program are detected
- Examples of semantic errors- multiple declarations, undeclared identifiers
Code Generation
- Abstract syntax tree used to produce machine code
Optimisation
- Aim is to make code faster to execute
- Can add time to overall time taken for compilation
- Redundant parts of code detected removed
- Repeated sections grouped and replaced with more efficient code that produces the same result
- Optimisation may alter how program behaves
Linkers, Loaders and Use of Libraries
Linkers and loaders allow us to use external pieces of code (subroutines and libraries) from outside sources.
Linkers
Software responsible for linking external modules and libraries included within the code.
Static Linking
- Modules and libraires directly added to main file
- Increase size of file
- Specific versions of library can be used because it is not affected by external updates
Dynamic Linking
- Addresses of modules and libraires included in file, referenced
- When the program is run, loader retrieves modules and libraires from specified address so it can be executed
- File remains small and external updates feed through to main file (no need to rewrite code)
Loaders
Programs provided by operating system, when a file is executed, loader retrieves library of subroutine from given memory location.
Libraries
- Pre-compiled programs which can be incorporated in other programs using static or dynamic linking.
- Ready to use and error free
- No need for developing and testing modules therefore time saving
- Can be reused for multiple programs
- Provide specialised range of functions which would otherwise require time and effort to develop
- Saves programmers from “reinventing the wheel”
- Examples of libraries include mathematical and graphical functions