I am building a Virtual Machine and I think I have a perfect program design but I am worried as I don't have too much experience on this field there might be flaws.
Before I'll tell you how it'll work, I'm first going to list some stuff this programming language and virtual machine is all about.
- Being Loaded as an extension (Like JNI)
- Dynamically Loading Extensions / Plugins
- Object Oriented
- Easy to setup all requirements
- Machine Security (You cannot use any native machine functions, security manager for extended permissions like managing files, connecting to network)
- Code Security (People'll have a hard time to recover the code)
The total package will consist out of different parts:
- Compiler to Bytecode
- Virtual Machine (Read & Execute Bytecode)
- Program using the scripts (Contains VM to run them)
- Bytecode Program (Compiled program to be ran by the VM)
A program will be stored inside a basic .zip archive. The .zip archive will contain all bytecode files as well the file containing an interface. When source code is compiled, all variable and function names will be gone. They will be replaced / obfuscated with regular integers. While compiling, an interface, as mentioned before, will be added to the .zip archive.
The interface will basically be a library of function that can be called from outside the program, by the VM. This interface could for example include the main method. When the VM is being used as a plugin loader, it could for example also contain a
getName() or a
When loading in the VM it'll ask for an interface to use. When later on loading in a .zip to this VM it'll check if the interfaces match. If they don't the VM will refuse to load the program.
When it's loaded in the main program will be able to ask the VM to run a certain function defined in the interface.
Also the program being executed will be able to run functions of the VM. Also these functions will be a part of the interface.
A program being executed can request to load in new programs. They will also be loaded with an interface and the program will be able to use it's method. (A plugin loading plugins basically)
The idea seems flawless to me but just to be sure I wanted to ask everyone here if any problems or blockers might occur while developing it.
Just to be clear, I'm not aiming to compete with Java/CLR or anything.