For the C compiler that I developed to replace the GNU Mes compiler in the live-bootstrap project, I also used a Forth like language that uses two stack. One stack for parameters and return values and one for the return addresses and local variables. The Forth like language is transpiled in assembly and through some steps made into an ELF file. The targets are: x86, x86_46, and arm64. Work on supporting riscv64 has started, but is currently on hold due to other responsibilities. If there is anyone willing to complete it, I do have some small funds as a bonus.
https://github.com/romforth/romforth already has a port to RISV-V for both 32 and
64 bit, (among many others). So if you don't mind lowering your language
implementation to romforth (or even rewriting your compiler to directly generate
it), you should be able to use it "for free", no funds required ;)
Oh yeah, this is right up my alley. I've been thinking about making a Forth on bare metal for a while (made a Forth interpreter in C last summer, and a tiny amount of testing stack manipulation in hand-assembled machine language on a C64U), and the thought I (coincidentally) had moments before seeing this link was about making a boot sector on some floppies I just got for my 8088 IBM PC. I know that will only work for the Real Mode part but it might be fun to start there anyway. Edit: I knew about CollapseOS but didn’t realize this had been around too.
> An alternate way to go about this is to sidestep that complexity entirely and build your own OS.
> We'll go bare metal and then build an operating system of our own, with a C compiler of our own. It's simpler this way.
I love the audacity of those statements. And I appreciate this sort of approach which says "let's implement the simplest possible version of _______ to learn how it is done."
I think it's a bit silly to assume that a supply chain collapse will lead people to using your handmade unoptimized systems stack and not well-understood commodity OSes like Linux or FreeRTOS.
Reminds me of preppers hoping for an apocalypse that makes their buckets of dried food valuable but leaves their access to fresh water and medicine intact.
It's probably an interesting series regardless, I just find that framing silly
For years I've had an idea in my head to add a Forth to the old game Master of Orion so that I could automate some of my common actions in the game. There is an open source GIThub called 1oom with source code for the game and I thought I would just write my own Forth. Well, I've recently been using AI's to code, so I asked GPT and it suggested that I use ficl rather than writing my own Forth. It helped me add ficl to 1oom. I've added Forth words to access most of the game variables and I've just begun adding forth words that can manipulate the game state. It's been fun. I had not written much, if any, Forth code in the last 30 years, so it's been a fun trip down memory lane.
einpoklum | a day ago
astrobe_ | a day ago
ozonator | a day ago
zovirl | 21 hours ago
fjfaase | 23 hours ago
romforth | 5 hours ago
drivers99 | 21 hours ago
dang | 21 hours ago
Tumble Forth - https://news.ycombinator.com/item?id=38184539 - Nov 2023 (22 comments)
zovirl | 21 hours ago
> We'll go bare metal and then build an operating system of our own, with a C compiler of our own. It's simpler this way.
I love the audacity of those statements. And I appreciate this sort of approach which says "let's implement the simplest possible version of _______ to learn how it is done."
jackb4040 | 17 hours ago
Reminds me of preppers hoping for an apocalypse that makes their buckets of dried food valuable but leaves their access to fresh water and medicine intact.
It's probably an interesting series regardless, I just find that framing silly
andai | 16 hours ago
irchans | 17 hours ago