Machine, Assembly & High-Level Programming Languages
Introduction to Programming Languages
This section introduces the concept of programming languages and the importance of abstraction. It also provides an overview of the different types of programming languages.
Types of Programming Languages
- Machine code is the least abstracted language, consisting only of binary code that represents what is happening in a computer.
- Assembly code is a low-level language that uses mnemonics to represent operations and has a one-to-one relationship with machine code.
- High-level languages like C, Java, and Python are more abstracted than assembly code and have varying levels of abstraction within them.
- Python is a very high-level language that does not require variable declaration, while Java requires data type specification. C allows for memory management.
Machine Code
- Machine code is specific to a processor or family of processors and cannot be run on other computers without translation.
- Programs written in other languages must be translated into machine code before they can be executed on a computer.
- Instruction sets define what each instruction does in machine code and vary between processors.
- Assembly language uses words instead of binary code but still has a one-to-one relationship with machine code. It also varies between processors.
Conclusion
Programming languages range from low-level machine code to high-level languages like Python. Abstraction plays an important role in making programming easier by allowing programmers to work at higher levels of complexity.
Low-Level vs High-Level Languages
This section discusses the differences between low-level and high-level programming languages.
Low-Level Languages
- Hexadecimal is used to represent machine code in low-level languages.
- Low-level languages are hardware-specific and require a translator to bridge the gap between human-readable code and machine code.
- Less abstract low-level languages require less work at runtime, making them faster but less user-friendly.
High-Level Languages
- High-level programming languages are more like ordinary languages and easier to use than low-level languages.
- High-level programming languages are portable, meaning they can be executed on many computers without writing hardware-specific code.
- More abstract high-level programming languages leave more work to be done at runtime, making them slower but allowing for more user optimizations.