Languages

Cards (14)

  • High-level Language
    A programming language that is easy for humans to understand
  • Low-level Language
    A programming language that is close to what a CPU would actually do and is written for specific hardware
  • High level must be compiled and interpreted into machine code before it can be run.
  • High-level language: Advantages
    • One instruction high-level code represents many instructions of machine code
    • The same code will work for many different machines and processors
    • Code is easy to read, understand and modify
  • High-level language: Disadvantages
    • Must be translated before a computer is able to understand it
    • You don't have much control over what the CPU actually does so programs will be less memory efficient and slower
  • Low-level language: Advantages
    • Commands in machine code can be executed directly without the need for a translator
    • You control exactly what the CPU does and how it uses memory so programs will be more memory efficient and faster
  • Low-level language: Disadvantages
    • One instruction of assembly code usually only represents one instruction of machine code
    • Usually written for one type of machine processor and won't work on any others
    • The programmer needs to know about the internal structure of the CPU and how it manages memory
    • Code is difficult to read, understand and modify
  • Computers only understand instructions given to them as machine code, so high level languages need to be translated before the computer is able to execute the instructions.
  • 2 Types of Translators:
    • Compiler
    • Interpreter
  • Translators: Compiler
    • Translate all of the source code at the same time and creates one executable file
    • Only needed once to create the executable file
    • Returns a list of errors for the entire program once compiling is complete
    • Once compiled the program runs quickly but compiling can take a long time
  • Translators: Interpreter
    • Translates and runs the source code one instruction at a time, but doesn't create an executable file
    • Needed every time you want to run the program
    • The interpreter will return the first error it finds and then stop- this is useful for debugging
    • Programs will run more slowly because the code is being translated as the program is running
  • The type of translator will depend on which programming language and IDE you're using.
  • Examples of high-level languages:
    • Python
    • Java
    • C++
  • Examples of low-level languages:
    • machine code
    • assembly languages