I don’t know if this is a good idea or not, but it does make me wonder. There are all of these excellent virtual machine projects and architectures out there but they are mostly in userspace. The few that aren’t are geared specifically towards virtualizing operating systems. It occured to me that something useful might be to put a virtual machine interface into the kernel which would allow dynamic languages to be compiled to a common format which could run closer to the OS and possibly yield a speed increase. If system calls and other execution can be managed from the kernel, wouldn’t that yield a speed increase? What I’m proposing is a kernel-level virtual machine aimed at providing an improved interface for running dynamic languages. Imagine a workflow like this: 1. The kernel has a module called the KLVM or something. 2. You write a program in a language and compile it to some common
bytecode or something.
- Then, you invoke an application to run it, like “vmrun program” and the instructions are executed in the KLVM.
I’m not an expert on this subject I’m thinking about how kernel traps, system calls and instruction thunking works and can’t figure out if there’s anything to this thought or not! Alternatively, this might be solved by tying something like LLVM into the kernel.