I recently resumed the work on rewriting my toy programming language #Lithia from an interpreter to a stack based virtual machine.
Oh my gosh is it exhausting. But now that I have most foundation work done, it starts getting rewarding. Feels great being able to add some tokens, the vm opcodes and implementing them.
Not that I have much more than if-statements/expressions and some lame arithmetic stuff.
While writing the compile part and thereafter the vm execution, it gets extremely obvious how much more work the runtime has to do in interpreters. Over and over instead of just once.
I am really curious about the speed difference although not a fair comparison due to language design changes.