how did the invention of high-level languages come about
-early computers were complex and instructions would have to be written in binary code
-this process was slow, taking days to program simple tasks
-over time, new generations of programming languages have enabled people to become faster and more efficient at writing programs as they resemble human language
what is a low level language
-a programming language that directly translates to machine code understood by the processor
-they allow direct control over hardware components such as memory and registers
-these languages are written for specific processors to ensure they embed the correct machine architecture
what generations are low level languages
first gen
second gen
what are first generation languages
machine code is a first generation language
instructions are directly executable by the processor
written in binary code
what are second generation languages
assembly-code is a second generation language
code is written using mnemonics, abbreviated text commands
using this language programmers can write human-readable programs that correspond almost exactly to machine code
advantages of low-level languages
-complete control over the system components
-occupy less memory and execute faster
-direct manipulation of hardware
disadvantages of low-level languages
-difficult to write and understand
-machine dependant
-more prone to errors
-knowledge of computer architecture is key to program efficiently
what is a high level programming language
-uses English-like statements to allow users to program with easy to use code
-high-level languages allow for clear debugging and once programs are created they are easier to maintain
-high level languages were needed due to the development of processor speeds and the increase in memory capacity
in a high level programming language, what does one instruction translate to
many machine code instructions
examples of high level languages
python
java
basic
C+
advantages of high level languages
easier to read and write
easier to debug
portable so can be used on any computer
one line of code can perform multiple commands
disadvantages of high level languages
user is not able to directly manipulate the hardware
needs to be translated to machine code before running
program may be less efficient
what is a translator
a program that translates program source code into machine code so it can be executed by a processor
low level languages such as assembly code are translated using an assembler
high level languages such as python are translated using a compiler or interpreter
what is a compiler
-translates high-level languages into machine code all in one go
-generally used when a program is finished and has been checked for syntax errors
-can be distributed without the need for translation software
advantages of compilers
speed of execution
optimises the code
original source code will not be seen
disadvantages of compliers
can be memory intensive
difficult to debug
changes mean it must be recompiled
designed solely for one specific processor
what is an interpreter
-translates high level languages into machine code one line at a time
-each line is executed after translation and if any errors are found, the process stops
-interpreters are generally used when a program is being written in the development stage
-interpreted code is more difficult to distribute as translation software is needed for it to run
advantages of an interpreter
-stops when it finds a specific syntax error in the code
-easier to debug
-requires less RAM to process the code
disadvantages of an interpreter
-slower execution
-every time the program is run it has to be translated
-executed as is, no optimisation
what is an IDE
a software designed to make writing high-level languages more efficient
how do IDE’s make the process of creating/maintaining code easier
editor
error diagnostics
run-time environment
translators
what is an editor
gives users an environment to write, edit and maintain high level code
what can editors provide
-basic code formatting tools (changing the font, size of the font et)
-coloured keywords (uses colour to make it easier to identify key words)
-code editing (auto-completion and auto-correction of code)