People who have this blog since a while, would recognize that in the subtext the Linux operating system was recommended for programming tasks. Right now, it is the most advanced piece of software I’m aware of it. But perhaps this decision can be improved if we are let the Forth language come in. The question right now is how Forth can be compared with Linux. The main idea behind Linux is, that software is everything and hardware can be ignored. The Linux kernel is implementing a complete operating system from scratch and ignoring existing BIOS drivers which are built-in every PC. But, after booting up a PC the system knows exactly what a network is, what a graphics card is and what a cpu scheduler is, even without booting the Linux kernel. All the information are stored in the BIOS, in the existing ROM chips on the hardware and even on the CPU itself.
Forth is a good choice because Forth is as default lowlevel and bare-bone oriented. That means, a typical Forth program contains of low amount of commands and if a Forth system was programmed right, it will use existing BIOS routines and doesn’t invent his own network system. The main difference between Linux and Forth is, that the Linux OS is documented quite well with lots of tutorial like the famous book of Andrew Tanenbaum, while around Forth there is no information available. Today, I’ve checked out Stackoverflow. Under the tag “Forth” they have under 200 questions right know. This can’t be called a huge community, it is more a niche.
The main idea behind Forth is a better balance between Hardware, software and operating system. Linux has the focus entirely on software, Forth is more hardware oriented. In theory the result is a more efficient overall system, which needs less power consumption and can be programmed easier. The drawback is, that in the now it is very complicated to write an OS in Forth, mainly because nobody has tried so before. The only bigger example is the iTV company of CHuck Moore which has developed a workstation. But the computer isn’t sold anymore and the iTV PC is not available in a computer museum so that nobody can reverse engineer the software.
In theory the famous SVIG (Silicon Valley Forth interest group) has the aim to promote the usage of Forth, but everybody who has read their printed publication or watched one of the youtube streams will recognize that they are doing exactly the same. SVIG doesn’t bring Forth into the mainstream, they make complicated things more complicated. So the problem is: where to start if the aim is to make things more transparent? Right now I see two potential starting points for teaching Forth to a mainstream audience. The first is to simulate a CPU in an electronics simulator. That means, every transistors is visualized and the user can see who 1000 transistors are forming a CPU. The other possibility is a qemu image, which is an operating system written in Forth, compared to the menuet-OS project. The aim is, that the user can boot up the system and run his own Forth software in it. This allows him to interact with the existing BIOS which is emulated by qemu too.
In contrast, I don’t think that existing Forth implementations like gforth or Forth derivatives like Factor are making so much sense. Because it is unclear what the advantage to existing software is. The main advantage of Forth is, that it can replace Linux, so there is a need to bare-bone programming directly on the hardware.
One aspect in Forth is important. The language isn’t faster then C. This might be surprise because most people are interested in efficient computers. But it is in reality not a big problem. The slowdown of Forth compared to a C program is not more then the factor 3. And this amount can be compensated by better hardware. If the aim is to speed up a Forth program, not a better compilation to existing x86 architecture is used, but instead a better CPU can used. For example a memristor which is a combination between DRAM memory and CPU.