I’ve had fun making the little DCPU emulator (past couple of posts: 1, 2), but sadly, I’ve had no time to make a Forth for it. But hey, Matt Hellige has already done it! I just took his GoForth and got it up and going. Just grab the image from here and load it up:
let image = File.ReadAllBytes @"..\..\goforth.img"
for i in 0 .. 2 .. image.Length - 1 do
memory.[i / 2] <- (uint16 image.[i]) <<< 8 ||| uint16 image.[i + 1]
Viola, a nice little interactive Forth!
Take it for a spin!
This sure beats assembly (even with a nice IDE) and, for interactivity, it even beats the C tool chain. Running interactively on the target machine is invaluable!
Now we need Notch to get around to spec’ing all the ship sensors and actuators!
(BTW, the code for the little 100-line F# emulator is at my github)