I guess the best reference for implementing new interpreters is npiet and testing all example images.
I guess the best reference for implementing new interpreters is npiet and testing all example images.
npiet is good, and I use its examples for testing, but FYI it diverges from the spec in how it handles whitespace. According to DMM, if the cursor enters a loop entirely within whitespace, the program should terminate. Currently, npiet doesn't have a cycle-detection algorithm so it hangs.
One of these days I'll get around to making my test infrastructure and polishing up my tests... but I've recently had some weird thoughts about a place&route algorithm to replace my existing Piet backend and that's more interesting. First step, design a router that creates right-hand-rule paths through whitespace? What am I even doing with my life...
I remember a point in development when I implemented whitespace handling and cycles therein. I thought I had implemented the spec but some example programs did not run properly. Maybe that was because of the divergence in the spec vs. npiet you mentioned. Since my main goal was to learn rust I just made the example programs work and did not double check the spec again. Will look into it again when I find some time :)