It appears the leadership of Collapse OS have decided to switch from Z-80 to Forth. In this article, they explain their reasoning.
Collapse OS' first incarnation was written in Z80 assembler. One of the first feedbacks I had after it went viral was "why not Forth?". I briefly looked at it and it didn't seem such a great choice at first, so I first dismissed it. Then, I had what alcoholics refer to as a "Moment of clarity".
[...] The Z80 asm version of Collapse OS self-hosts on a RC2014 with a 5K shell on ROM, a 5K assembler binary loaded in RAM from SD card (but that could be in ROM, that's why I count it as ROM in my project's feature highlights) and 8K of RAM. That is, it can assemble itself from source within those resources.
[...] If I wanted to re-implement that assembler feature-for-feature in Forth, it would probably require much more resources to build. Even though higher level words are more compact, the base of the pyramid to get there couldn't compete with the straight assembler version. This was under this reasoning that I first dismissed Forth.
So, again, what makes Forth more compact than assembler? Simplicity. The particularity of Forth is that it begins "walking by itself", that is, implementing its own words from its base set, very, very early. This means that only a tiny part of it needs to be assembled into native code. This tiny part of native code requires much less tooling, and thus an assembler with much less features. This assembler requires less RAM.
What is more compact than something that doesn't exist? Even Z80 assembler can't beat the void.
That's how although Forth is not more compact that native code (duh!), a Forth Collapse OS achieves self-hosting with as much resources than its Z80 counterpart.
(Score: 1, Interesting) by Anonymous Coward on Wednesday June 10 2020, @08:29AM (1 child)
if you are a student of history you realise collapse is inevitable. the myth of infinite progress is a capitalist invention non-aligned with reality
(Score: 3, Interesting) by bzipitidoo on Wednesday June 10 2020, @10:54AM
Collapse is also a myth of sorts. One gets stuck on the notion that a collapse is complete and absolute, as if a stock market collapse would set the indexes all the way down to 0. The collapse of the Roman Empire was by no means so total. The political leadership changed dramatically. Some engineering and science was lost, such as concrete, which was not rediscovered until the 19th century. Latin fell into disuse.
But, the Latin alphabet remained. The ideal of a unified polity, in which there was no destructive internecine competition with all its waste, remained. The environment was not greatly affected, but to the extent that it was, the collapse was almost entirely good for it.
And now? How can we take a step back, without risking a collapse unprecedented in history? Nuclear weapons, you know.