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: 4, Insightful) by driverless on Wednesday June 10 2020, @03:26AM (3 children)
Uhh... it's a minimal operating environment for a Z80, sort of like CP/M from nearly half a century ago but not as sophisticated. Why is this news?
And if the news is Forth, that's also half a century old and since Forth is interactive it's been a sort of shell/operating system from day one. In particular microFORTH has been running on most of the popular 8-bit CPUs for 40+ years.
(Score: 0) by Anonymous Coward on Wednesday June 10 2020, @03:34AM
CP/M doesn't self assembles on those kind of resources. Is microforth self-hosting on its target machines?
(Score: 5, Informative) by RamiK on Wednesday June 10 2020, @12:49PM
https://collapseos.org/why.html [collapseos.org]
https://collapseos.org/roadmap.html [collapseos.org]
It's a prepper's OS.
Putting aside the civilization collapse silliness, we could use something like Open Firmware [wikipedia.org] with lots of input and storage peripheral drivers to kickstart new non-C-compatible architecture that's targeting MCUs. That is, future novel architectures would want to have a tiny MCU loading their actual OS into their novel compute cores instead of falling into the x86's dos mode pitfall or ending up like the RasPi with a custom written bootloader for each board version as it needs to support new peripheral since someone thought it would make sense having the proprietary GPU cores boot first.
compiling...
(Score: 0) by Anonymous Coward on Wednesday June 10 2020, @07:15PM
Look at it this way: working on this keeps them off the streets and messing up traffic. We could use a lot more of that these days.