05 May 2022

Computing Systems - The Enduring Concepts For Programmers

4:56 minute read

As programmers, it is essential to understand the system that our applications are running in. In order to do this, we have to acquire a deeper understanding of the enduring concepts underlying all computing systems.

Doing this will allow us to:

  • Become better programmers
  • Write programs that make better use of the capabilities provided by the operating system, hardware and systems software
  • Write programs that run faster, be it on today’s hardware, or hardware of the future
  • Write programs that avoid flaws and that make our software more secure
  • That behaves correctly

To achieve this goal, I have prepared a series of articles that will take you on a journey where we will go through these enduring concepts. We will look at a fairly basic application written in the C programming language and begin our study of systems by tracing the life of this hello world program. As we go through this program, we will introduce the key concepts, terminology and components that come into play during its lifetime.

Fig 1: hello.c

Information is Bits + Context

Our hello application starts its life in a code editor and is saved to disk as a source file. The source code is a sequence of bits, each bit having a value of 0 or 1, organized as a chunk of 8 bits that is called a byte. Each byte represents some text character in our source code.

Fig 2: source code is a sequence of bits

The source code in Fig 2 brings to fore a fundamental idea: All information in a system, be it a file, a program in memory, user data in memory like data in a key-value store, or data moving across a network are just a sequence of bytes, and the meaning of these sequence of bytes can change depending on the context. Much like how a person, can be a driver, a cook, or a horseback ride for a jolly baby depending on the context.

Fig3: All of information is a sequence of bytes

All information in a system — Including disk files, programs stored in memory, user data stored in memory, and data transfered across a network — Is represented as a bunch of bytes.

All information in a system — Including disk files, programs stored in memory, user data stored in memory, and data transferred across a network — Is represented as a bunch of bytes. All information in a computing system can have multiple representations depending on the context. For example, an operating system can recognize many types of files. Text files, Image files, Video files, Application binaries and many more. At the most basic level, files are just organized sequences of bytes stored in some medium, be it random access memory on your Personal Computer or some solid-state drive in a data centre. These organized sequences of bytes that make up your file can also represent things like numbers (integers, floats), characters or even machine instructions, it all depends on the context.

Fig 4: The same sequence of bytes representing different things at a level higher than binary.

To drive this point even further, systems like computers, mobile phones and other devices use the ASCII (American Standards Code for Information Interchange) character encoding standard for electronic communication. The text you see on these devices is represented using this encoding standard, which is also a sequence of bytes that depending on the context can mean different characters or numbers. For example, in ASCII, the same sequence of bytes that represent the character A can represent 65 in decimal, 41 in hexadecimal, 101 in octal and 01000001 in binary.

So this means, that as programmers it is essential that we understand the machine representations of numbers because they are not the same as integers and real numbers. They are but finite approximations that can behave in unexpected ways.

In the next article, we will continue our journey of the enduring concepts behind computing systems by looking at how programs are translated by other programs into different forms.

If you believe that understanding these fundamental concepts is essential, feel free to share with your network of friends and acquintances. I would highly appreciate it.