July 05, 2019

Linux vs. Forth


The most important classical operating system is Linux. It can be used for software programming and for running existing applications as well. Linux scales well from tiny microcontrollers up to mainframe computers. Additional the software has a open source license and gets updates constantly. Without any doubt, Linux is the most powerful operating system and ecosystem ever invented.
The only serious competitor to Linux is the Forth programming language. On the first look, the comparison is a bit complicated, because Forth is some kind of minimalistic esoteric programming language. It is not possible to download an iso image with a Forth operating system because such a software is not available. Let us go into the details:
Linux is created mostly with the c programming language. A programmer types in sourcecode which is converted into a binary file. The sourcecode is tracked in a version control system and this results into the ISO file which can be installed on the local harddrive. A typical Linux distribution like Fedora needs around 10 GB of free space on the harddrive and contains lots of software packages. In contrast, Forth is something which isn't invented yet. Forth is a theoretical framework which is based on stackmachine. Similar to the Turing machine it's a system of a computer. A concrete Forth system realizes this idea in software.
The difference between Linux and Forth is, that Linux is like a house which is already built. Today's Linux is the result of the collaborative work which results into written sourcecode from the past. In contrast, Forth is something which has no structure. It's equal to non-existing software. Can Forth be utilized as an operating system as well? Sure, if the programmer is able to create his own non-standardized operating system. The situation is comparable to a Commodore 64 computer after switching the device on. Which means, that no or only a small operating system is available. If the user likes to edit a textfile or connect over the internet he has enter the routine first.
A ready to run Linux system contains of preinstalled tools like the Linux kernel, awk, the C compiler and the TCP/IP stack. This allows the user to do something useful with the machine. In contrast, a fresh booted Forth system contains exactly nothing. It is equal to a system which has a need for software. The dominant qfuestion within Forth is how to create such software. The surprising answer is that nobody knows it. Some books were written about the subject, but the details are missing. I would call Forth mostly not a programming language but a conversation which is written down in books. That means, the Forth standard is given with the existing literature which is not very large in it's amount.
Let us describe a scenario who Forth will look like in 20 years. The idea is, that the amount of books is higher and that the books are written for practical purpose. The user starts a computer which has apart from a minimalist Forth system no addtional software. In the first page of a Forth tutorial the user finds the bootstrap code, he types in the letters which are equal to a basic hardware kernel. Now the user has access to the graphics card, the network card and the harddrive of the computer.
On page 2 of the Forth book he finds another listing which is a texteditor, and on page 4 the sourcecode of a simple webbrowser is printed. If the user types in all the Forth code the size of the overall operating system grows from 2 kb to 10 kb. In an additional listing a small GUI is printed which makes the Forth computer more usuable.
The best example what Forth is in reality is given by the Jupiter Ace computer. It was an homecomputer from the 1980s which provided only 3 kb of RAM which is less than a Commodore 64 had. The challenge is to write useful programs for this machine. Programming early homecomputers in Assembly language was not uncommon, because high level language for example C have a higher memory footprint. In case of the Jupiter Ace the situation is more minimalistic, because the system was delivered with a built in Forth interpreter. This allows the programmer to write much smaller software.

No comments:

Post a Comment