by dfischer · 6y ago · 0 comments
I like the feeling of concatenative languages. I especially seem to like the postfix notation over prefix and largely this creates the paradigm of lisp vs forth at first step - in my opinion.
I’ve recently dug in to Factor and it’s quite an amazing piece of art that is highly usable and up to date despite such a small community. It almost feels like a secret weapon and too good to be true. I’m having a ton of fun hacking on it. It’s like Smalltalk and forth had a baby.
I dream of making an OS with Forth/Factor similar to Plan9 and Oberon.
I get a kick out of Forth being made of words and Genesis from the Bible.
At first was the Word, and the Word was with Forth, and the Word was Forth.
https://en.wikipedia.org/wiki/Oberon_(operating_system)
Tidbit if anyone cares: I’ve been obsessing over returning to first principles of computing. I’m bored of the internet and browsers. I want to have fun with software AND hardware and Forth seems like such a perfect language to do exactly that with. Factor is a nice grown up example of that but it’s definitely a few steps removed from portability and self bootstrapping behavior like in CollapseOS.
Retro Forth is extremely impressive: http://forth.works
Oberon System 3 with its gadgets framework or the current AOS (still used as teaching tool at ETHZ) also have interesting ideas, and better support for systems programming.
The book "The Oberon Companion. A Guide to Using and Programming Oberon System 3" is available as part of the System 3 environment delivered as part of AOS.
http://builds.cas.inf.ethz.ch/
You can find some old ISOs from here https://github.com/cubranic/oberon-a2
Also, following on from A2, Composita introduces a component architecture to allow managed memory without GC, and contextless switches:
http://concurrency.ch/Content/publications/Blaeser_Component...
IMHO better than Rust, and I'd love to see this style of memory management paired with a minimal lisp eg. https://piumarta.com/software/maru/
so we can build more deterministic high-level structures
Also have a look at Mesa/Cedar, as it was the inspiration for Oberon ideas.
https://news.ycombinator.com/item?id=24450970
Comments include a link to one hour demo on YouTube with members of the team.
As idea, many of these concepts can be done on modern OSes, on top of something like COM/D-BUS/gRPC/XPC, but none of them go as far as they did.
The “hook” for me was seeing things like ifs and loops being written in Forth itself from simpler primitives. I’ve always been a fan of bootstrapping a general purpose computing environment from a small set of primitives, and Forth lets you do exactly that.
> I’m bored of the internet and browsers. I want to have fun with software AND hardware
I can 100% relate to that feeling. Discovering Forth has been therapeutic for me in a sense. I spend the day dealing with AWS and Java and logs and metrics for large distributed systems, and that brings me zero joy or motivation. I spend my work days looking forward to my time with Forth in the evening.
I think it was CollapseOS that sent me down this rabbit hole :)
"My minimal stack of layers is – problem, software, hardware. People working on the problem (algorithms, UI, whatever) can't do software, not really. People doing software can't do hardware, not really. And people doing hardware can't do software, etc.
The Forth way of focusing on just the problem you need to solve seems to more or less require that the same person or a very tightly united group focus on all three of these things, and pick the right algorithms, the right computer architecture, the right language, the right word size, etc. (...)
So you need at least 3 teams, or people, or hats, that are to an extent ignorant about each other's work. Even if you're doing everything in-house, which, according to Jeff Fox, was essentially a precondition to "doing Forth". So there's another precondtion – having people being able to do what at least 3 people in their respective areas normally do, and concentrating on those 3 things at the same time. Doing the cross-layer global optimization.
It's not how I work."
https://yosefk.com/blog/my-history-with-forth-stack-machines...
That’s largely where we are today in many sectors of society. Experts who only understand the nuances of a niche layer they’ve patched into a series of layers of indirection by the result of not taking the time to fully understand what one is working with from first principles or fundamentals. The OS’s of today are computation stacks that resemble something like bandaids and house of cards with people piling on intricate complexity without conceptual understanding that can be effectively reasoned about.
I understand that simple is hard. However when one can reason about a system when it fits entirely in their head then they can extend it completely. I believe all systems should be this way. To have anything else is a risk of corruption or assimilation as the minority control a majority through complexity against time.
Sorry I kind of went off on a tangent there.
Tl:dr systems should fit in anyone’s ability to reason about it conceptually. Anything too complex is an attack vector and disaster waiting to happen.
I don't remember who said that, but it's a really smart observation: Civilization is not just the state of society when there are lots of smart professionals, orchestrated together to provide infrastructure, and tools, and goods, and services, it's a state of society when almost everyone routinely uses the fruits of labour of those professionals without even being aware of that labour. That's the point: that it Just Works™. You don't have to think about it.
(Edited to add that while I haven't done any significant Forth work in probably 20 years, I've long been intrigued by Factor and I keep meaning to try 8th, as I've got some small simple program ideas that would be lovely to be able to run on Mac, iOS, and Android.)
Oberon inspired Acme and pforth runs on plan 9: https://github.com/Plan9-Archive/pforth9 (Factor cant be built on plan 9 due to the lack of c++ feature.)
I went through a forth phase and realized that its a good fit within the industrial control and motion segments. I started writing a motion control library I called forthaxis which took coordinates and spat out trajectory commands for servo drives. Didn't get very far but it was a fun exercise.