I’m having a hard time understanding the difference between an emulation virtual machine and a language vm. I started with the research and implementation of an emulation virtual machine. Primarily emulating quite old 16-bit architectures.
I want to get the basics down for a language virtual machine. Are both systems similar? Do they both use register-based architectures and stack-based?
I’m under the impression a language VM is basically a run time environment. Depending on the complexity of the VM, it may have a garbage collector, JIT compiler, etc… Would that assumption be correct?
EDIT: I’m also talking about bytecode VMs, but native machine code works too.
The line can be very fuzzy, but the distinction lies in their intended purpose rather than their implementation.
Language VMs typically operate at a higher level of abstraction. They may execute bytecode or execute the AST directly. JIT compilation may occur in either case, but I don’t know of any processors that implement GC (except possibly lisp machines?).
Your assumption is correct, a language VM implements the runtime environment in a language implementation.
3