Virtual machines are an execution engine for compiled code, taking in binary instructions and performing the corresponding instructions. In this project we are looking at all the phases of code compilation and execution and creating an compilation and execution environment for the language we are developing in tandem.
There are a number of industry virtual machines which we will look to for inspiration and experience. Most notably, the two dominant ones are the Java virtual machine and the .Net framework. Modern virtual machines often include JIT compilation to compile the intermediate bytecode into native machine bytecode when the program is run.
Looking through the list of instructions for the JVM, we see that it closely mirrors
the instructions that we would see for a processor - manipulating data primitives. In
addition, there are methods for dealing with objects and calling methods which are
applicable to those objects including
invokevirtual among others. The .Net framework specifies similar functions in its intermediate language CIL.
There are a few areas which merit exploration. Technologies have grown and computing devices are more prevalent and connected than ever. It is interesting to look at the merits of incorporating things like networking and device communities in the design of the language and the virtual machine itself. Code is continuing to become more interconnected and collaborative in its creation and use. Package managers such as NPM, pip and NuGet lay an argument for a better system of loading, sharing, and executing shared code and libraries.