SLR 5 Flashcards

(46 cards)

1
Q

Define library

A

Ready compiled and tested programs that can be run when needed

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

Library features

A

Typically grouped together into software libraries
Most programming languages have extensive libraries of pre built functions

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

Library pros

A

Quick and easy to use and hook into your own code
Pre tested, so you can be relatively sure they are already free from errors
Pre compiled so they are typically optimised to run quickly

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

Library cons

A

Adding functionality or making specific tweaks can be difficult- or impossible
Sometimes you are “black boxed” from the actual implementation
Have to trust that the developers will continue to maintain the library

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

Linker responsibility

A

Linker is responsible for putting the appropriate machine addresses in all the external call and return instructions so all modules and external library routines are linked together correctly

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

Static linking

A

All the required code from the libraries is included directly in finished machine code- this can result in large executable program files

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

Dynamic linking

A

Compiled versions of the required libraries are stored on the host computer
Operating systems links required code from library as the program is running
While this cuts down on the size of compiled machine code, if dynamic libraries change, the program may stop because it tries to call a subroutine in the wrong way

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

Define loader

A

The part of the operating system that loads the executable program file into memory, ready to be run

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

Loader for dynamic linking

A

When using dynamic linking, it will also be responsible for loading the required libraries into memory

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

What are the stages of compilation

A

Stage 1: lexical analysis
Stage 2: syntax analysis
Stage 3: code generation
Stage 4: optimisation

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

What happens during lexical analysis

A

Lexer starts by converting lexemes in the source code into a series of tokens
As the leder reads the source code, it scans the code letter by letter
When it encounters a white space, operator symbol or special symbol it decides a word (lexeme) is complete
It then checks if the lexeme is valid using a predefined set of rules that allow every lexeme to be identified as a valid token

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

What happens during syntax analysis

A

It receives its inputs in the form of tokens from lexical analysers
It analyses the syntactical structure of the input, checking if in correct syntax of programming language
Does this by analysing the token stream against production rules to detect any errors in the code:
- checking for errors and reporting them
- building an abstract syntax tree
Lexer can’t tell if tokens valid by syntax analyser can
If the check fails, the syntax analyser can report the failure to user letting them know exact line and location of error
The abstract syntax tree is created from the input token streams

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

What happens during code generation and optimisation

A

Machine code is generated
Code optimisation (can increase compilation time for a program) attempts to reduce the execution time of the program by:
- spotting redundant instructions and producing object code that achieves the same effect as the source code
- removing subroutines that are never called
- removing variables and constants that are never referenced

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

Lexical analysis summary

A

Comments and white space removed, remaining code turned into a series of tokens, symbol table created

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

Syntax analysis summary

A

Abstract syntax tree is built from tokens produced in previous stages, errors generated if any tokens break the rules of the language

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

Code generation summary

A

Abstract code tree converted to object code, object code is the machine code produced before final step is run

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

Optimisation summary

A

Tweaks code so it will run quickly and use as little memory as possible

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

What is an assembler

A

Translates assembly language into machine code
Takes basic commands and operations from assembly code and converts them into binary code that can be recognised by a specific type of processor
One to one translation process from assembly into machine code

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

Pros of assembler

A

Programs written in machine language can be replaced with mnemonics, which are easier to remember
Memory efficient
Speed of execution is faster
Hardware oriented
Requires fewer instructions to accomplish the same result

20
Q

Cons of assembler

A

Lack of portability
Difficult to remember the syntax
Long programs written in such languages cannot be executed on small computers
It takes lots of time to code or write the program as it is more complex in nature

21
Q

What is a compiler

A

Translates source code from high level languages into object code then machine code then processed by the CPU
Whole program is translated into machine code before it is translated

22
Q

What is an interpreter

A

Translates source code from high level into machine code ready to be processed by CPU
Translated line by line as program is running

23
Q

Pros of compiler

A

No need for translation at run time
Code is usually optimised
Speed of execution is faster
Original source code is kept secret

24
Q

Cons of compiler

A

Designed for specific type of processor
Code needs to be recompiled when code is changed
Program will not run with syntax error

25
Pros of interpreter
Easy to write source code stops when syntax error No need to recompile when code changed Easy to try out commands when program has paused after finding an error
26
Cons of interpreter
Translation is required at run time Speed of execution is slower Source code is required Code is not optimised
27
Define hardware
All physical parts of a computer system and its related devices both internal or external
28
Define software
General term covering all computer programs. Most software fakes into broad categories like application, system and utility software
29
Types of utility software
File repair Backup Compression Device drivers Defragmentation Anti-malware File management
30
File repair (aims etc)
Files can become corrupt or damaged for a number of reasons File repair software attempts to correct these issues and restore the file to its original working state A file repair facility is often built into certain applications, as well as being a separate, dedicated software tool found in most operating systems
31
Backup
Backups can be set up to be manual, automatic or scheduled Full backup or incremental backup Backup to different media or an off site cloud system Backup software often comes with operating system but can be purchased separately
32
Data compression
Compression reduces the size of a file so it takes up less space and downloads faster over the internet Compressed files must be extracted before they can be read Depending on the algorithm data is either lost, reducing the quality of the file of represented in a different way using binary, retaining the original data in new compressed format
33
Defragmentation
Reorganised the files on a hard disk, putting fragments of files and free space back together This process reduces the movement of the read/ write head across the surface of the disk, which speeds up file access
34
Anti malware
Helps keep your computer and files safe from many types of malware like: viruses, trojans, worms, spyware Most operating systems come with malware protection already built in Also companies who specialise in dedicated anti-malware programs
35
Open source features
Users can modify and distribute the software Can be installed on any number of computers Support provided by the community May not be fully tested
36
Define open source
Can be used by anyone without a license and is distributed with the source code
37
Closed source features
Protected by the Copyright Design and Patents Act Users cannot modify the software Usually paid for and licensed per user or per computer Supported by developers who do not release source code Tested by developers prior to release, although it may run beta program
38
Define closed source
Requires the user to hold an appropriate license to use it. Users cannot access the source code as the company owns the copyright license.
39
Open source user pros
Software is free Wide community modification
40
Open source user cons
Can be poorly supported Some features might not be well tested
41
Open source creator pros
Gets their software out there to a wider community
42
Open source user cons
Little to no financial gain
43
Closed source user pros
Well supported, tested and professional built project
44
Closed source user cons
Cost or ongoing subscription fee
45
Closed source creator pros
They receive an income for their product
46
Closed source creator cons
Constant demand from community for more features and improvements Piracy issues