1.2.2 Flashcards

Applications generation (29 cards)

1
Q

Application software

A
  • Used by an end user to perform a specific task.
  • e.g. word processor or web browser
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Systems software

A
  • Manages computer resources to maintain performance
  • e.g. operating system or device driver.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Utility Software

A
  • Has a specific function to maintain OS performance
  • e.g. backup or compression software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Open source

A
  • Provided along with the source code.
  • No license required to use.

The program’s source code is freely available to view/edit by anyone. Open source software is made by many people and distributed under licenses that comply with the Open Source Definition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Closed source

A
  • Needs a license to use.
  • Source code is not available.
  • Protected by Copyright

A program that legally remains the property of the organisation, group, or individual who created it. The organisation that owns the rights to the product usually does not release the source code, and may insist that only those who have purchased a special license key can use it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Open source advantages

A
  • The source code can be compiled to work on different platforms eg Windows, macOS.
  • Potentially a community of developers continuously improving the source code
  • Potentially a community of users to learn from
  • Can modify the source code to adapt to your needs rather than starting from scratch (saves time and money)
  • Could be copied and sold for profit since source code is available
  • Potentially less vulnerabilities as lots of people can view the source code (but do they and are they sufficiently knowledgeable?)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Open source disadvantages

A
  • Risk of abandonment eg community decides not to maintain the code
  • Potentially less support compared to closed source
  • Not always well supported or documented.
  • Variable quality code.
  • Less secure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Closed source advantages

A
  • Usually professional support comes with the software
  • Potentially a product that has been more robustly developed and tested
  • More secure.
  • Regular updates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Closed source disadvantages

A
  • Usually a financial cost
  • Cannot modify to meet your needs
  • Fixes to proprietary code rely on vendor rather than community so potentially slower.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Assemblers

A
  • Assembly code is platform specific, low level code.
  • Translates assembly code to machine code.
  • 1 line of assembly code = 1 line of machine code.
  • Takes each assembly code instruction (comments are ignored) and checks syntax. Any errors are reported.
  • Assuming no errors, the assembler looks up mnemonic opcodes in a static opcode table to find the operation code (eg in LMC add is 1)
  • Gives memory addresses to labels (labels are symbolic representations of addresses, the dynamic symbol table maps labels to memory addresses - see right)
  • Converts instructions to machine code (1s and 0s)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Interpreters

A
  • Translates and executes code line by line.
  • Will error if a line contains an error.
  • Slower to run than compiled code.
  • Code is platform independent.
  • Useful for testing.
  • Takes source code line by line and analyses it.
  • If an error is encountered, interpreter stops and indicates position of the error
  • If there are no errors the line is run. The interpreter executes the machine code equivalent of the instruction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compilers

A
  • Translates code all in one go.
  • Compilation process is longer.
  • Produces platform specific code.
  • Complied code can be run without a translator
  • Scans entire source code a number of times performing different checks (see Compilation lesson for more details)
  • If all checks are fine eg no syntax errors, the whole source code is translated into either executable machine code which can be saved and run whenever required OR intermediate code (between high level and machine code)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Interpreter pros

A
  • A program can quickly start running without the time spent to compile it (useful for program development where code is frequently being edited).
  • Code can run on any hardware architecture on which the interpreter runs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Interpreter cons

A
  • Usually much slower than compiled program to run. For example, interpreter must translate the same statements within a loop over and over again.
  • Interpreter is needed each time the code is run
  • Can be harder to debug. For example if your code has multiple errors, the program stops running on the first error and doesn’t provide any reporting on further errors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Compiled pros

A
  • The executable can be saved on disk and run whenever required without the need to recompile
  • Compiled code typically executes faster than interpreted code (see below left)
  • The executable can be distributed and run without needing the compiler
  • Executable code is secure in that it is very difficult to reverse engineer (therefore good for programs that will be sold and closed source)
  • Information on all errors immediately at compilation rather than having to execute the line (good if you have a very long program and the error is right at the end!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Compiled cons

A
  • No code executed until everything is compiled with no errors.
  • Any change/error requires code to be recompiled
  • Object code is platform specific so it will not work on all platforms
  • Needs to store a potentially large executable in memory.
17
Q

What are the stages of compilation?

A

Lexical analysis
Syntax analysis
Code generation
Optimisation

18
Q

Lexical Analysis

A
  • Irrelevant white space and comments removed
  • Allocate tokens to lexemes
  • Symbol table created. Identifiers are added to symbol table
  • Purpose is to determine the meaning of individual words in the source code.
19
Q

Syntax Analysis

A
  • Tokens are checked against rules of the language, error raised if rule is broken
  • Check meaning (semantics) for logic errors e.g. int can’t be assigned to string
  • Symbol table updated eg data type, scope
  • Purpose is to discover syntax errors in the tokenized program.
20
Q

Code Generation

A
  • Create object code
21
Q

Code Optimisation

A
  • Optimise object code
  • Code is rewritten so that it runs faster and requires less resources (less memory and less processing time) while still producing the exact same effect as was intended.
22
Q

Libraries

A
  • Libraries allow you to include code written by other developers (or yourself) into your projects. They facilitate reusable code components.
  • Libraries can be supplied as source code or compiled code.
  • If the library is source code, it is merged during compilation
  • If the library code is already compiled, it is linked.
23
Q

Static Linking

A

The executable contains the libraries merged into it

24
Q

Dynamic linking

A

The libraries that are contained in separate files.
The dynamic linker part of operating system finds the files and combines them with your executable code when the program is loaded.

25
The loader
- All operating systems (apart from embedded systems) have a subsystem called a loader. - The loader will take a compiled program and load it into memory ready to execute. If the program isn't compiled for that OS, the loader is unlikely to succeed. - Loaders do the following (not an exhaustive list...): - Validation (check permissions required to run the program, check memory requirements to ensure , etc.) - Copying the program from the hard disk/solid state drive into main memory - Initializing registers (e.g. set program counter to entry point)
26
Static linking pros
- You guarantee the library is combined with the executable code. - Your code will be more reliable! - You can control exactly which version.
27
Static linking cons
- The file size will be bigger as many programs might contain redundant copies of the same library. - The libraries might also be out of date.
28
Dynamic linking pros
- The executable program itself as it does not have the libraries merged into it so saving disk space. Multiple programs can share a single copy of the library. - The operating system can maintain the latest versions of all the libraries as part of its regular updates.
29
Dynamic linking cons
- If you've not got the dynamic library, the program can't run! You might need to ship copies of the libraries with your code just in case. - Known on the Windows platform as "DLL Hell", an incompatible updated library will break executables that depended on the behavior of the previous version of the library if the newer version is not backward compatible.