1.2.2 Applications Generation

The Nature of Applications

Hardware - Physical parts of a computer system and also related devices (keyboard ect.)

Software - General term covering all computer programs

Utilities

Software designed to keep computer safe, efficient and tools to manage files/applications

Examples:

  • Compression - allows for more space on storage, compress and decompressing files

  • Disk Defragmenters - Rearranges contents of the hard drive so they can be accessed faster

  • Anti-virus - detects potential threats to computer, alerts user and removes threats
    Utilities

  • Back up - Routinely creates copies of files specified by user

  • File Managers - Allows directories, folders and files and to created, moved, copied, deleted and renamed

  • Automatic Updates - Updates the OS, having the newest software means the system is less vulnerable

Open and Closed Source Software

Open source: source code can be accessed by anyone and used without a license

  • + Can be modified to fit needs
  • + Technical support from forums and community
  • - Low security
  • - Support online may not be sufficient
  • - Can be buggy

Close source: Need a license to use. Users cannot access source code

  • + Lots of tech support
  • + Secure
  • + Well tested with thorough updates
  • - Users cant access source code
  • - Costs money to use

Linkers, Loaders, Libraries

Linkers - piece of software that links external modules and libraries included within the code

  • Static Linker - Modules and libraries are added directly into the main file

    • increases size of the file
  • Dynamic Linker - Addresses of modules and libraries are included in the file, external module/ library updates automatically feed through to the main file

    • file size doesn’t change

Loaders - Program provided by the operating system

  • When a file with dynamically linked addresses is executed, the loader receives the library or module from the specified memory location

Libraries - Pre-compiled programs which can be incorporated within other programs

  • They are ready to use, error free
  • Can be used across multiple programs
  • Saves time developing and testing modules

Stages of compilation

Lexical Analysis

  • White space and comments are removed from the code
  • Keywords and names of variables and constants are replaced with tokens
  • Token information is stored in a symbol table

Syntax analysis

  • Tokens are analysed against the rules of the programming languages
    • tokens that break rules are marked as syntax errors
  • Abstract syntax tree is produced (a representation of the source code)
  • Semantic analysis done (logic mistakes within program are detected)

Code generation

  • Abstract syntax tree is used to produce machine code
  • Translators

Optimization

  • Searches through the code to make it more efficient:
  • Redundant parts of code are removed
  • Repeated sections of code are replaced with more efficient code