Live data from Hacker News

Collapse OS – Why Forth?

collapseos.org

131–140 of 172 posts

Re: Collapse OS – Why Forth?

#131
post #59

Earlier quoted context omitted.

Also works great with graphics. PostScript is similar to Forth.

I got into Forth recently - using Gnu Forth - but got bogged down at my inability to do graphics. There are hardly any Forth programming videos of any kind online, besides the "101" kind, but I found one by a guy who managed to get graphics/windows going, I think with GForth. (Can't find it on youtube now.) Looked mega-complicated. So lately back into Tcl/Tk, which also satisfies my "bizarre, powerful and very cool l…

Look at Sun NeWS and Display PostScript for GUIs written in PostScript (well...an extended PostScript).

Re: Collapse OS – Why Forth?

#132

I hate this headline but the project is very cool. People like me who were ignorant should start here instead of the Github to get a better sense of the design goals (and why they are using Forth): https://collapseos.org/forth.html

I've read that page and I'm still wondering why they're using FORTH. C has excellent portability and performance. The article agrees with the general consensus that C is also generally a better language for the programmer. So why use FORTH? What does it matter that it can do cute things with self-hosting? What does 'compactness' matter? If the goal is to build a portable means of writing programs for Z80 and AVR, why…

> What does 'compactness' matter?

Because after the end of civilization, you may be inputting your first programs on punch cards or something similar, and your system's memory capacity might be measured in a few kilobytes, not gigabytes. Compactness is a huge deal in this context.

Re: Collapse OS – Why Forth?

#133
post #96

Earlier quoted context omitted.

For me, the main problem with forth is a lack of names -- most languages (functional or imperative or even declarative) assign names to things -- things like function parameters, temporary values and so on. Even Prolog, which is as far from traditional structural program as one can go, usually has descriptive names for unbound variables. Compared to this, Forth is very name-terse. You get "function names" at best, an…

Note that Forth also supports locals. These will consume and remove N members from the stack so you can summon them as needed prior to calling the words. But as someone that really got into Forth this year, I can assure that it does get better once you get more familiar with the language. I used to write commenting the stack effects on each line and now I barely need them as I write words in one sitting without that…

It's been a long time since I did anything substantive with Forth, but, as I recall, the big problem here is that most Forth guides get so excited to show you how much rope the language gives you that they forget to teach you how not to hang yourself with it. So you're kind of left to figure out all the little idioms and best practices for stack management all on your own.

Re: Collapse OS – Why Forth?

#134

Earlier quoted context omitted.

I love this project, and check in on it every few months. I particularly like the idea of scavenging hardware: > With a copy of this project, a capable and creative person should be able to manage to build and install Collapse OS without external resources (i.e. internet) on a machine of her design, built from scavenged parts with low-tech tools. I'd be interested in trying to build my own proof-of-concept, but my ha…

Definitely read (at least the first chapters of) the Z80 cpu manual: http://z80.info/zip/z80cpu_um.pdf It gets a bit dry when it gets to the bit that documents the individual instructions, but the overview before that point is well worth reading. Once you've done that and you're trying to write code, this page is a good reference for the instructions: http://clrhome.org/table/ To build a scavenged machine, you'll nee…

Thank you for your thorough answer. Especially when you frame it like that, the RC2014 sounds like like a fun next step. I'll definitely look into it.

Re: Collapse OS – Why Forth?

#135
post #104

Earlier quoted context omitted.

Technology isn't a complete panacea, but humans in general are highly adaptable. History seems to indicate that innovation is the most common outcome of Malthusian catastrophes, so it seems more than reasonable to me to ask that anyone arguing for a Malthusian catastrophe needs to also argue why innovation is not going to again be the outcome.

> Technology isn't a complete panacea, but humans in general are highly adaptable. History seems to indicate... The most critical processes for human success - population growth - is an exponential process. Pretty much all of it happened in the age of fossil fuels. We have 200 years (out of 200,000 of human history according to Wikipedia) of experience with global populations >1 billion and we are currently cruising…

> History doesn't show us being adaptable, history shows if something happens to the solid/liquid carbon supply around 7/8 of us are expected to die.

I disagree. Look at the pandemic response here vs. the Spanish flu, or the Bubonic plague.

We also have plenty of alternate energy sources to diversify our power infrastructure, and many nations are taking these steps. The past few decades have been a series of lessons on the importance of resilience over efficiency, and we're slowly learning this lesson.

Re: Collapse OS – Why Forth?

#136

Earlier quoted context omitted.

I love this project, and check in on it every few months. I particularly like the idea of scavenging hardware: > With a copy of this project, a capable and creative person should be able to manage to build and install Collapse OS without external resources (i.e. internet) on a machine of her design, built from scavenged parts with low-tech tools. I'd be interested in trying to build my own proof-of-concept, but my ha…

It is my belief that after civilizational collapse, a working macbook will still be much easier to scavenge than assorted parts such as a Z80, a memory controller, compatible memory, a writable EPROM for program storage, peripherals such as keyboard, video circuitry and a screen, and a power supply, nevermind much more useful.

Not too quite so, and the COS author addresses this in its website. (https://collapseos.org/why.html, section "There are two stages of collapse")

To be clear I don't necessarily share the view that this will likely happen, but for the sake of discussion I will assume it will.

A working macbook will indeed be much easier to encounter working at first, but not only is it much less durable (it isn't even particularly durable from current laptop standards), and parts are much more numerous, specialized, and hard to find. Macbooks in particular have a very tightly controlled supply chain, but this applies to other laptops too.

Z80 style processors and peripherals are still in use in various industrial and home appliance products, so it is still rather widespread anyways.

This means that while a laptop might be way more useful at the beginning of a collapse, it will probably stop being maintainable much earlier than a simpler computer will. In fact, if push comes to shove, it is plausible to actually build a Z80-compatible processor from discrete transistors.

Re: Collapse OS – Why Forth?

#137

Earlier quoted context omitted.

There's a difference between “not unreasonable” and “reasonable”.

Can you provide more details?

There's a difference between "x is not negative" and "x is positive" (¬(x 0)). Why shouldn't a similar subtlety (or a larger one) exist in prosaic language?

Re: Collapse OS – Why Forth?

#138

I think I've had my own moment of clarity that spans both Forth(s) and Lisp(s) and explains why neither is as common as other languages. In most common languages, there is a complicated base spec that covers many cases and defines a broad range of affordances, plus libraries and libraries that expand on an already fleshed out collection of tools and etc. Forths and Lisps give you the core of an environment, and let/e…

> In most common languages, there is a complicated base spec that covers many cases and defines a broad range of affordances

Sure, if we ignore C.

Re: Collapse OS – Why Forth?

#139

I think I've had my own moment of clarity that spans both Forth(s) and Lisp(s) and explains why neither is as common as other languages. In most common languages, there is a complicated base spec that covers many cases and defines a broad range of affordances, plus libraries and libraries that expand on an already fleshed out collection of tools and etc. Forths and Lisps give you the core of an environment, and let/e…

You are giving technical merits way too much credit. People will put up with whatever bullshit as long as there is demand and helps them get a job. The thing is, UNIX was a massive success, and it happened to be written in C. Since then, all successful languages had to have a familiar syntax with the host language. It was UNIX that killed the Lisp Machine (by being given away for free). Programming languages never go…

Unix wasn't given away for free; it was strapped by AT&T licensing and you needed hardware that certainly wasn't free, and not still not affordable to individual consumers. But Unix was a resource-efficient system that scaled down to cheaper hardware with less RAM.

Even the dyed-in-the-wool Lisp enthusiasts headed by Richard Stallman were compelled to reproduce Unix, even though their stated goal was to have a system running Lisp.

Re: Collapse OS – Why Forth?

#140

Love this project. I wonder why not make it run on smartphones? I'd imagine that's the vast majority of computers out there today. Easier to find a working smartphone than retro consoles.

Usually it's nontrivial to get anything custom to run on a smartphone, they're pretty locked down like that compared to more general hardware.
Post reply on HN