I took the time to read the linked pages, mainly because of my long-standing interest in operating system design. This is not a critique, just some out-loud thinking.
BigEd wrote:
The main advantages given in the blog post for adopting Forth are
Yes, Forth can appear to be very compact—if one chooses to ignore all the stuff behind the curtain that makes Forth work. I suspect one will find Forth's overall footprint is larger than an equivalent that was efficiently written entirely in assembly language. With any interpreted language, the overhead stays relatively constant, even with the smallest programs. With assembly language, the only overhead is that which the programmer chooses to include in the source code.
Quote:
That's all a matter of opinion.
Forth enthusiasts see Forth as simple. Much of the computing universe sees Forth as an arcane melánge of disjointed words, symbols and reverse Polish gibberish. I'm part of the latter group, and view assembly language as much less impenetrable and more logical than Forth.
On the other hand, if one considers the rapidity at which a Forth program can be written by someone fluent in the language, I suppose there is simplicity over the process of edit/assemble/link/execute. However, that is the case for most interpreted languages.
Quote:
No operating system is truly portable, especially in the 8-bit microcomputer world. There are always system dependencies that have to be resolved and almost always, they have to be resolved with system-specific assembly language. As Forth cannot execute in a vacuum and must ultimately interact with the underlying hardware, the Forth kernel has to be written for the particular machine architecture on which it is expected to run, which makes it non-portable.
My takeaway is the author of Collapse OS is probably not an expert Z80 assembly language programmer, which would explain why he decided to rewrite it in Forth—there's no question writing an OS in pure assembly language is a daunting task. Also, he notes in his writeup he is a Python developer, which suggests he is likely more comfortable with languages that insulate the programmer from the bare metal (which is a paradox of sorts, considering that at some point an operating system has to be in contact with device registers, etc.). However, he clearly understands the performance implications of writing an OS in Forth, as well as possible maintenance issues related to the language's syntax and structure (this latter item is likely a reason why Forth has not enjoyed much popularity in the general programming community).
BTW, the individual who wrote Collapse OS is a "prepper," which explains the software's name.