2. What is a Compiler
A program that translates
(or compiles) a high-level
language into a low-level
language.
3. What is a
Low-Level Language?
A low-level language is lower (or
closer) to the CPU and hardware;
Uses primitive instructions
(binary code) that a machine can
understand, but is more difficult for
humans to read or write.
4. Low-Level Language
Examples are Machine code
(closest to hardware – binary code)
Assembly Language – slightly less
cryptic.
5. High-Level Language
A high-level language uses language
that humans can read, understand and
write more easily. Code is compose in a
text/code editor or IDE.
6. High-Level Language
Examples of popular high-level
programming languages today are:
C, C++, Java, & Python
FORTRAN was first
high-level language.
7. Compiling High-Level Source
Code into Machine Code
High-level language source code,
written by programmers (using C
or C++) needs to be compiled into
executable machine code.
A compiler program will translate the
source code into executable binary
code (all at one time).
8. Compiling High-Level Source
Code into Machine Code
Programs which need to use a lot of
computer resources, and need to be as
efficient as possible, are often written
in a compiled language like C.
C in many ways is a lower-level than
Python. For example, a C programmer
needs to handle a lot more memory
management than a Python programmer.
9. Compiling High-Level Source
Code into Machine Code
Compiled code is fast and efficient
But is platform dependent –
meaning it must be compiled
for a particular Operating System
or CPU.
10. Interpreted
High-Level Source Code
Languages like Java and Python are
interpreted line by line by an
interpreter before being translated
into code that the CPU can use.
This takes longer (is slower), but
allows the language to run on
multiple Operating Systems.
11. Interpreted Languages
Java and Python source code are
first compiled (translated) into
bytecode which is then executed by
a virtual machine – Java Virtual
Machine or Python Virtual Machine.
Virtual means it emulates the CPU
or hardware in a sense.
15. Sources:
Python Concepts - What is a Python Compiler and
Python Virtual Machine?
(Moondra YouTube Channel)
Inside Python: What is bytecode and pyc files?
(Indian Pythonista YouTube Channel)
https://python-textbok.readthedocs.io/