drilix.com

Freedom, Community & Sustainability

What is the “source code” and how can it be open?

October 3, 2011 -- William
Last modified on August 2016

Since the large adoption of computers in our everyday lives, the “source code” is everyday more a part of our daily reality. From the mysterious symbols depicted in the Matrix (...and there's even a movie called “Source Code”),  to the actual Open Source software we use, we can see references to this “code” everywhere. In fact, even this page you are reading right now has a source code! To view it, right click on the page and select “view source” (it might not be there depending on your browser and it certainly doesn't look as cool as in the Matrix :-) ). But what is this source code and how can this code be open (or closed)?

Let's start by a short explanation of the differences between machine-language and human language. The human language that we speak and write is composed of a dozen letters that correspond to sounds that can be combined to form words and sentences (duh!). Computers talk through wires and use a very different language. They send electrical impulses that have a meaning to them. This communication has only two “letters”: on or off, signal or no signal, impulse or no impulse. This is called the binary numeral system. Everything we do on a computer is transformed in a series of zeros (no signal) and ones (signal).

For example:
The number 6 corresponds to 110 (one, one, zero) in the binary system.
The letter k in binary code becomes 01101011.
The sentence “Hello World” becomes “01001000 01100101 01101100 01101100 01101111 01010111 01101111 01110010 01101100 01100100”.

You realize that its very hard for a human to read machine-language but also very hard to make machines understand the human language! (although machines don't really understand anything, they just do what they are told) To close the gap between human and machine language we have invented programming languages. These programming languages are in-between human and machine language. They are useful to help humans write *something* that can easily be translated into binary code.

For example (this is not really in any programming language but it's very close to being one):


if (A < B & B < C){ return: A < C; }

This looks like a typical instruction in a programming language. It means, in plain English, “If A is smaller than B and B is smaller than C then A is smaller than C”. These instructions, written in a programming language, are processed by an interpreter or a compiler and transformed in a series of zeros and ones that the machine can execute.

Now, here comes the interesting part (finally!)

The point is that, once a program is compiled in binary code, there's no way back into a programming or human readable language! (The process of transforming binary code into a programming language is called "reverse engineering" and it is a very fastidious task).

The so called “source code” is nothing more than the original, human readable set of instructions, written in a programming language by a programmer. This programmer has the choice to provide a compiled version of his work (binary file) or to provide the source code (text file written in a programming language). With a compiled version, people can run the program but nobody knows how the programmer made it work. With the source code, other programmers can read the instructions, understand how the program works and eventually modify it.

We say that the source code is open when it is available for anybody to read. We say that the source code is closed when it is not available.

Free and Open Source Software are always provided with their source code. The idea is that, if others can understand how the software works, they can help to develop it. Proprietary software developers, on the other hand, do not reveal the source code of their software so nobody can really know what the software does. This is the big difference between FOSS and proprietary software.

Read also:
The binary numeral system (Wikipedia)
The binary alphabet

Add new comment