Getting a basic interpreter working wasn't hard, but I attempted to add a few of the optimizations listed here[1], which meant adding some form of AST and stuff to manipulate it. This is where I got a bit stuck with regards to performance as some of my optimizations meant the program should have been faster, but instead it slowed down.