Which Language is Linux Written In? A Sequel (Page 2 of 2)

Article by Tolga BALCI (23,398 pts ) , published May 31, 2009

Libraries and Utilities

On the previous page, we just scratched the surface of the kernel and Linux issue when we compared it to kernel32.dll. In fact, kernel, libraries and the common *NIX utilities are what make “Linux” the core of the operating system. Nobody can imagine a Linux distribution without stlibc, gcc etc.. And, also, nobody can imagine a working system without core utilities such as mkdir, chmod, chown, head, tail, chroot, uptime, users, etc.. These utilities are also written in C.

Package Managers and Configuration Programs

Package managers are the programs that control the application's install and uninstall processes, taking the dependencies into account. For example, in openSuSE and Fedora yum is the package manager and apt or dpkg fills that role in Debian based systems such as Ubuntu. Many of the package managers and configuration programs are written in C.

The graphical front-ends to the package managers and the configuration programs are completely different issues. As the baseline, we can consider them to be written in Python (GTK, QT, Tcl/Tk to follow in Graphical User Applications).

Window Managers and Desktop Environments

Considering that the majority of standard users use a desktop environment, we have to look at what that is first. A desktop environment is a graphical interface that is designed to assist the user with routine computer use. For example, a user can issue the command mv file_a /dir/file_a to move the file named file_a from the present working directory to another directory named /dir, or he can open up a file manager and then drag the file from the present directory to /dir and drop there. This is one of the functions of a desktop environment.

A desktop environment includes icons, windows, toolbars, folder views, wallpaper, etc.. Typically, a desktop environment is based on specific libraries and the libraries make the desktop environment consistent in look and feel. In the case of the top two desktop environments, Gnome uses Metacity and KDE uses KWin window managers. Both Metacity and KWin are developed in C, and thus require GCC to compile.

Graphical User Applications

This is where many programming languages come into play. You can write any application using any language you want including the graphical user interface. This includes C, Python, Java, Perl, and others. For that program to run in a graphical user interface, you can use the libraries for the desktop environment that you plan your program to run. Let’s give an example: you have written a program to watch user-defined tweets from Twitter. You can design a user interface that uses GTK libraries to make the program look native to the Gnome Dekstop Environment, but you may write the underlying code in Perl. Then you can go on further and define a user interface by using QT libraries if you want your program to look native to KDE. Or, if you want, you can write the interface by using Tcl/Tk libraries. Synaptic and Kynaptic can be good examples; both use the same underlying code but Synaptic uses GTK and Kynaptic uses QT.

Or if you want full control, you can go with the Java development environment and use the Java graphical libraries. There are many programs available – one of them is Datacrow, which I use to catalog my media and book collection.

Conclusion

In the answer to the question “what language is Linux written in” one must know that technically he is referring to the kernel, utilities and libraries. This is simple: C and Assembly (to some extent). But if one is referring to the whole Linux distribution, then the answer is “it depends” because we do not know if the user is referring to a particular application or any other system component.