Learn IT with Davo
  • Mr Davidson's Blog
  • Twitter
  • A Level CS - H446
    • A Level Exam Technique
    • Lessons
    • Unit 3 - Coursework Guidance
  • OLD GCSE CS - J276
    • All GCSE Questions
    • GCSE Exam Technique
    • Glossary of Terms
    • Unit 1 Revision >
      • 1.1 - Systems Architecture
      • 1.2 - Memory
      • 1.3 - Storage
      • 1.4 - Wired and Wireless Networks
      • 1.5 - Topologies, Protocols and Layers
      • 1.6 - System Security
      • 1.7 - Systems Software
      • 1.8 - Ethics and Law
    • Unit 2 Revision >
      • 2.1 - Computational Thinking
      • 2.1 - Searching and Sorting Algorithms
      • 2.1 and 2.2 - Writing Algorithms/Programming Techniques
      • 2.2 - SQL and Database Structure
      • 2.3. Robust Code
      • 2.4. Logic
      • 2.5. Translators and Facilities
      • 2.6. Data Representation
  • NEW GCSE CS - J277
    • Glossary of Terms
    • Exam Technique
  • GCSE Business - J204
    • Lessons >
      • Unit 1 - Business Activity, Marketing and People
      • Unit 2 - Operations, Finance and Influences
    • Exam Technique
  • Contact

2.5 - Translators and Facilities of Languages

In this section (click to jump):
  • Levels of Programming Language
    • Low - Machine Code
    • Low - Assembly
    • High Level
  • Translators:
    • Assemblers
    • Compilers
    • Interpreters
  • Tools and Features of an IDE
 

Levels of Language

Picture
"FISH!"
"Today's fish is Trout a la Creme, enjoy your meal."
"FISH!"
"Today's fish is Trout a la Creme, enjoy your meal."
"FISH!"
When computers first began to appear in homes we had grand ambitions for where our experiences with them would go. In the future, we were told, people and machines would interact with natural language - meaning we would literally speak to a device and it would simply understand what we want. This was especially true when it came to programming, the vision was always that we would eventually be able to simply describe a task to a computer and it would go away and make the program to solve our problem.

If that had happened by now, your unit 2 exam would be largely pointless.

Sadly, it hasn't happened yet and actually, looking forward we are many, many decades away from that becoming a possibility.

In your exam you'll need to be able to differentiate between the main types of language that programmers can use today. You'll also need to be able to explain what each is, how it's used and when it should be used. Which isn't all that difficult, Rodney.

Before we start you need to understand that:

Low level means that the language is close to (or is) something that the CPU can understand - i.e. Binary.

High level means a language that is easy for us to understand as it is closer to English. It's called high level because its closer to us and far away from what a computer can understand.

Picture
The different levels of programming language in an upside down triangle. Because why not?
 
Low Level - Machine Code

What is it?

Machine code is literally "the instruction set of the CPU, in binary." This means that:
  • Machine code is pure binary, nothing else
  • Each instruction has it's own unique binary code which relates to one instruction the CPU understands/has in its instruction set
  • It is the lowest of low level languages - you are literally speaking the CPU's language.

Why is it useful/good?
  • Nothing is faster than machine code because no translation is required
  • You have complete control over the code that is produced

What's not so great?
  • You are programming in binary! There is potential for lots of mistakes to be made
  • There are virtually no debugging tools and certainly no nice error messages to help you
  • It is incredibly difficult for most programmers to understand/make anything useful with
  • Time consuming - you need many, many machine code instructions to do something very, very simple
Picture
A bit of DOS source. Look at it! It's a thing of beauty I tell you... (I have issues.)
 
Low Level - Assembly Language

What is it?

When computers were first invented, code had to be written in machine code. There was no other choice. Very quickly the great Elder Beards realised that to get anywhere we needed a programming language that mere mortals could actually understand. Therefore assembly language was created:
  • Assembly language consists of three or four letter mnemonics. In less posh English, this means 3 or 4 letter abbreviations.
  • Each single mnemonic translates directly to a single machine code instruction.
  • Examples may look like STA, MOV, CMP and so on
  • If you really like the idea, go and have a look at the source code for MS DOS 1.25 over at GitHub. It's genuinely fascinating stuff (ok, maybe only to serial saddo's like me)

Why is it useful/good?
  • Fast, fast, fast! If you want your code to be as optimised as possible, you go with Assembly
  • Total control of your code - you know down to the clock cycle how long things will take to run and how it's been done.
  • Still necessary in some cases for things like device drivers or time critical code such as that found in control systems.

What's not so great?
  • It's still really quite difficult for most programmers to pick up and understand
  • A single mistake in code usually results in a system crash or instability at best
  • It is incredibly difficult for most programmers to understand/make anything useful with
  • Time consuming - you need many, many assembly language instructions to do something very, very simple
 
High Level - Lots of languages

What is it?

High level languages are simply any programming language which uses structured English for its commands. It doesn't mean you can write full sentences as code, but you can certainly understand it a lot more easily than Assembly or Machine Code!

Why is it useful/good?
  • High level languages are much, much easier for us to understand and use
  • We can create programs without having to worry about exactly how the machine/CPU works
  • Libraries - high level languages nearly always come with lots of pre-written, tested code that we can use - such as that which creates windows, handles mouse movement or does input and output for us

What's not so great?
  • Unless you're using C or C++ and writing in line Assembly, you have little control over the final machine code that will be produced
  • High level programs are always much larger in size 
  • High level programs are usually slower than Assembly/Machine Code programs
Picture
Chris Waddle!
 

Translators

Translators are simply the programs that are used to convert any programming language/code that is not already machine code. Translated (pun-o-rama-geddon) this means that unless you code in Machine Code, you WILL need a translator to turn your program into binary before your code can be executed.

There are three types of translator that we're interested in:
 

Assemblers

What does it do?

Quite simply, it turns Assembly Language programs into Machine Code.

What else should I know?
  • You only use an assembler for assembly language - nothing else. This sounds obvious but so many people make this mistake year after year it makes me cry.
  • An Assembler will usually contain a few tools to make a programmers life a bit easier such as support for labels, variable names, automatic memory allocation and so forth
 

Compilers

What does it do?

A compiler takes an entire high level program and turns it all at once into a big binary executable file.

What else should I know?
  • Compilers are seriously complex beasts that have the job of turning all your English key words into binary Machine Code that the CPU will understand
  • Compilers will automatically add in all the extra code that a program refers to such as libraries
  • Compiled code is "make once, run many" which means once it is compiled, you can run it repeatedly without the need to go through the compilation process (use this knowledge when comparing to interpreters!!)
  • Compiled code will only work on the system it was targeted at - meaning if you compile on Windows, it should work on all Windows machines - but it wouldn't run on a Mac.
  • Compiled code usually runs faster than interpreted code.
 

Interpreters

What does it do?

An interpreter takes a high level program and translates and executes the code line by line.

What else should I know?
  • Code which is written in an interpreted language will be translated every single time it is executed.
  • In order to run code, every single machine must first have the interpreter installed.
  • Specific interpreters must be created for each type of machine (i.e. PC, Mac)
  • There is a huge advantage to doing this - you can write your code once and run it on any platform either without modification or with very little modification (use this knowledge when comparing!!)
 

Features of an IDE

Picture
"Eeeee, when I were a lad, all this were VB6..."
IDE stands for "Integrated Development Environment." This is a posh way of saying "something we use to make programs."

We can Sherlock and Watson a bit more information from the name Integrated Development Environment:
  • IDE's are where software is created/where we write programs
  • An IDE may let you develop programs in more than one language
  • Integrated means that there are several tools in one place
  • Which tells us that to make a program, and have an easy life, we do need to make use of a number of utilities

In the exam, you will usually be asked to identify features of an IDE and to be able to discuss their purpose. To do this you need to know what they are and what each is/means.

An IDE will usually contain the following utilities that programmers use to make, debug and test their software:
  • A code editor (literally the place where you write code) which has some useful features:
    • Code completion - this is basically auto complete that attempts to guess what you are going to type/which key word you are going to use. This can be really useful when programming as you can use it to speed up your work or quickly identify variables, procedures or similar
    • Syntax highlighting - this is where the colour of code changes to indicate whether it is an object, method, variable or key word. It can also be used to highlight where errors are in the code.
  • A debugger (something that helps us to find errors in our code), that may have:
    • Breakpoints - these allow a programmer to run a program, but then the IDE will stop execution at a point specified. This enables the programmer to see what is going on at that point, perhaps to see the contents of variables or the result of a calculation. The program can usually be advanced line by line from a break point to help pinpoint an error.
    • Variable watch - this shows the contents of variables as  the program is running. This can help during testing/debugging.
    • Line by line execution - By running a program a line at a time, the programmer can usually quickly narrow down which line of code is casuing an error or giving strange results.
  • A compiler - see above for what compilation means - this is the bit which will create the final program that you can give to other people to run.
  • An interpreter - usually used for testing the software, perhaps during debugging.
  • Linkers/Loaders - These add in extra code used by a program such as libraries that have been referenced in the code.
Powered by Create your own unique website with customizable templates.
  • Mr Davidson's Blog
  • Twitter
  • A Level CS - H446
    • A Level Exam Technique
    • Lessons
    • Unit 3 - Coursework Guidance
  • OLD GCSE CS - J276
    • All GCSE Questions
    • GCSE Exam Technique
    • Glossary of Terms
    • Unit 1 Revision >
      • 1.1 - Systems Architecture
      • 1.2 - Memory
      • 1.3 - Storage
      • 1.4 - Wired and Wireless Networks
      • 1.5 - Topologies, Protocols and Layers
      • 1.6 - System Security
      • 1.7 - Systems Software
      • 1.8 - Ethics and Law
    • Unit 2 Revision >
      • 2.1 - Computational Thinking
      • 2.1 - Searching and Sorting Algorithms
      • 2.1 and 2.2 - Writing Algorithms/Programming Techniques
      • 2.2 - SQL and Database Structure
      • 2.3. Robust Code
      • 2.4. Logic
      • 2.5. Translators and Facilities
      • 2.6. Data Representation
  • NEW GCSE CS - J277
    • Glossary of Terms
    • Exam Technique
  • GCSE Business - J204
    • Lessons >
      • Unit 1 - Business Activity, Marketing and People
      • Unit 2 - Operations, Finance and Influences
    • Exam Technique
  • Contact