Live data from Hacker News

Collapse OS – Why Forth?

collapseos.org

51–60 of 172 posts

Re: Collapse OS – Why Forth?

#51

Earlier quoted context omitted.

Perhaps Forth has changed less than C in that time. The C of 48 years ago can look quite different from modern C.

There has never been one Forth. In a world with N Forth programmers, one can expect roughly N implementations of Forth. Perhaps closer to 2*N. An ANS spec exists, but most Forth programmers would say it misses the point. Forth is a collection of ideas and philosophies toward programming as much as it is a language. Two stacks and a dictionary. Threaded code (direct, indirect, token, subroutine, etc...). Collapsed abs…

Well, shit... I've been a lil frustrated by a lack of a clear resource and consequentially haven't gotten far on a couple half-hearted attempts to learn it. I can just make it up myself? A little late in the weekend for a new project, but I'm suddenly interested again.

Re: Collapse OS – Why Forth?

#53

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…

The rest of the storyline of this page covers what I think is the core concept that Chuck Moore started from, and defines Forth as its own environment: the core of the language that needs to be defined in order to write and execute Forth words is surprisingly small. Once you have the core words in place, you can layer on exactly the constructs you need.

I won't claim to be a proficient Forth author, but I've used it to accomplish a couple of rather odd one-off projects, and it is amazing how much you can do, as long as you're not expecting graphics or networking or huge storage needs.

Compactness matters because when you're trying to bootstrap into a tiny (or hacked together custom build) environment, the tiny bootstrap footprint means you can be up and rolling that much faster.

C is all good, I've been writing it for a long time, but I'd much rather get a Forth core going in raw assembly than even a stripped down to brass tacks C compiler.

Re: Collapse OS – Why Forth?

#54

https://collapseos.org/why.html "That being said, I don't consider it unreasonable to not believe that collapse is likely to happen by 2030, so please, don't feel attacked by my beliefs." Triple negative? Quadruple negative? (If we count the second "don't".) Compare something like: "I consider it reasonable to believe that collapse is unlikely to happen by 2030, so please, don't feel attacked by my beliefs." It is al…

I don't really want to participate in developing this silly argument, but people making such comments should always consider the possibility that there is a reason for somebody to say things the way they do, and that your "simplification" in fact loses the point of what author is trying to say.

So let me translate for you.

He doesn't "consider it reasonable to believe that collapse is unlikely to happen by 2030", in fact he believes that given the importance of the matter, he is better to assume the scenario, in which his project will turn out to be life-saving. But if it doesn't seem likely to you, that collapse will happen before 2030, and you don't believe the evidence supporting that claim, he wouldn't call you silly (unreasonable) for that, so we (he and you) can work on the project together even if our forecasts are different, don't worry about that too much.

Re: Collapse OS – Why Forth?

#55

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…

You're describing a hypothetical piece of software that would be easily two or three orders of magnitude more complex than the current Forth, and potentially be entirely unfeasible to run on a resource-constrained 8-bit system. Self-hosting isn't a cute trick, either- it's a functional requirement.

Forth makes bootstrapping and cross-compilation a straightforward exercise. C provides no help whatsoever until you've climbed to the top of a mountain of abstraction.

Re: Collapse OS – Why Forth?

#56

Earlier quoted context omitted.

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…

The rest of the storyline of this page covers what I think is the core concept that Chuck Moore started from, and defines Forth as its own environment: the core of the language that needs to be defined in order to write and execute Forth words is surprisingly small. Once you have the core words in place, you can layer on exactly the constructs you need. I won't claim to be a proficient Forth author, but I've used it…

Seems like an IR would make sense here. Perhaps a stack-based one. If you need a compact program representation, that doesn't mean you have to use FORTH as your source language.

Re: Collapse OS – Why Forth?

#57

https://collapseos.org/why.html "That being said, I don't consider it unreasonable to not believe that collapse is likely to happen by 2030, so please, don't feel attacked by my beliefs." Triple negative? Quadruple negative? (If we count the second "don't".) Compare something like: "I consider it reasonable to believe that collapse is unlikely to happen by 2030, so please, don't feel attacked by my beliefs." It is al…

Hmmm, let's see if I can make it worse:

"That being said, I don't consider it unreasonable to not believe that collapse is unlikely to not happen by 2030"

Re: Collapse OS – Why Forth?

#58
post #35

Forth is one of the last languages on my list. Whenever I read something like this article, I want to learn it. The advice at the end of the article seems interesting. Does anyone have any resources that might help with this?

A Forth shibboleth is that you have to implement your own in order to understand it. Try reading the assembly, then forth source, for jonesforth: https://github.com/AlexandreAbreu/jonesforth This is how I learned.

Oh wow, thanks. That is pretty much exactly what I was looking for.

Re: Collapse OS – Why Forth?

#59

this might be a dumb question but can someone briefly explain why Forth is more suitable over C or other languages in general on post-apocalyptic OS?

- It's tiny and dead simple to implement - It sits very close to assembly - It allows high-level programming like in C - The concept of pushing/popping things onto/off the stack is a relatively straightforward programming model when done consistently One of the old competitors to the likes of UEFI and uBoot is OpenFirmware (also known as OpenBoot), for which the primary UI is a Forth shell; OpenFirmware was the BIOS…

Also works great with graphics. PostScript is similar to Forth.
Post reply on HN