Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Wednesday June 10 2020, @02:57AM   Printer-friendly
from the a-new-OS-is-forth-coming dept.

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.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1) by ealbers on Wednesday June 10 2020, @04:12AM (4 children)

    by ealbers (5715) on Wednesday June 10 2020, @04:12AM (#1005650)

    I mean seriously, wtf?
    I wrote a z80 forth interpreter in the 80's, on trs-80 model 1...why the f are we reading about this???
    These things are lovely, but really people, can we please move ON!

  • (Score: 2) by bzipitidoo on Wednesday June 10 2020, @10:19AM (3 children)

    by bzipitidoo (4388) on Wednesday June 10 2020, @10:19AM (#1005737) Journal

    The maintainer believes civilization is likely to collapse by 2030. Thinks this 40 year old tech will be the most advanced stuff we can handle after the collapse. Yeah, I also thought, "WTF?"

    • (Score: 2) by HiThere on Wednesday June 10 2020, @12:20PM (2 children)

      by HiThere (866) Subscriber Badge on Wednesday June 10 2020, @12:20PM (#1005770) Journal

      That's a weird combination of pessimism and optimism. After a real collapse the best we'll be able to manage is an abacus. Too much computer stuff, whatever level you're contemplating, is dependent on highly integrated specialists. After something slightly less major any desktop system should work as long as it keeps running.

      --
      Javascript is what you use to allow unknown third parties to run software you have no idea about on your computer.
      • (Score: 1, Insightful) by Anonymous Coward on Wednesday June 10 2020, @12:31PM (1 child)

        by Anonymous Coward on Wednesday June 10 2020, @12:31PM (#1005772)

        > any desktop system should work as long as it keeps running

        Exactly. Collapse OS is for after that moment.

        • (Score: 2) by Bot on Thursday June 11 2020, @09:50PM

          by Bot (3902) on Thursday June 11 2020, @09:50PM (#1006609) Journal

          Basically some scavenged microcontrollers to design new processors to enable a factory to build proper CPUs to drive autonomous missiles to collapse civilization again 👍

          --
          Account abandoned.