Computer Anatomy:

A computer is a machine that stores data, interacts with devices, and executes programs– composed of two components. The first is hardware, the physical parts of a computer. This can further be broken down into the physical computer and its peripheral devices. Now, you may be wondering– what are peripheral devices?

Peripheral devices are external devices that add onto a computer’s functionality without being a part of the computer’s core functions. It’s essentially a supplement. Usually, these devices handle input and output processes– so they’re known as I/O devices.

A few examples:

OutputInput
ScannersPrinters
MonitorsMice
SpeakersMicrophone

Software is the instructions and data stored on the computer that are necessary for its operations. A computer program tells a computer the sequence of steps it need to fulfill a certain objective or task.

Languages

When it comes to programming languages, you’ll find that most of them are broadly classified into two categories:

  • High-level languages
  • Low-level languages.

High-level languages are the programming languages we all love. Languages like Python, Java, Javascript, Swift, etc. After all, their syntax is more aligned with our language– making it easier for us to code and debug. In exchange, we have to run our code through a compiler for the computer to understand our instructions.

A compiler is a program that translates high-level languages to a low-level language. Now, you’re probably thinking something along the lines of:

“Why do we use compilers when we could just code with a low-level language?”

The neat part of low-level languages is how easy it is for the computers to read it. As a result, they can execute instructions faster and overall be more efficient– even if its by a few seconds. After all, running your code through a compiler takes time. What doesn’t make neat, is how hard it is for humans to read it.

Let’s take Python– a high-level-language and Assembly– a low-level-language as an example. Here is what I would have to write if I wanted to print “Hello World!”

PythonAssembly
print(“Hello, world!“)section .data message db “Hello, world!”, 10 length equ $ - message section .text global _start _start: mov rax, 1 ; sys_write mov rdi, 1 ; stdout mov rsi, message ; address of message mov rdx, length ; length of message syscall mov rax, 60 ; sys_exit xor rdi, rdi ; exit code 0 syscall

See the difference? What’s even worse is that Assembly relies on your CPU’s instruction set architecture (ISA)– essentially a dictionary to define itself. So depending on that ISA, you instructions could very well mean different things.

The reason why we first learn with C++ is due to it being a middle ground when it comes to languages. It has the capabilities of both language types, so if you understand it– you’ll have an easier time transferring those skills into other languages.

Rolling High to Low: Languages Edition

Earlier, I dabbled a bit on how a high-level language gets compiled. But, I want to expand on that. When you compile a