If you can’t beat ‘em, join ‘em

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]<br>cycle () 

Viola, a nice little interactive Forth!

image

Take it for a spin!

image image

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)