WhyAreVirtualMachinesGreat?
Because they provide an abstraction of the low level hardware without enforcing a specific language.
Many real programming languages have some intermediate language anyway - why not make it explicit?
If done correctly this doesn't compromise performance (too much) and can gain you a lot in return.
The obvious example is the JavaVirtualMachine. But have a look at VirtualMachine and its backlinks and LikePages.
What does (or can) a VM gain you?
- Simple implementation of lots of other languages. See, for example, OtherLanguagesForTheJavaVm.
- Simple integration with other languages (for the same VM). This is extremely obvious with the DotNet environment which explicitly targets different languages (but doesn't tell you that it partly cripples them).
- Certain safety properties which are based on TypeSafety and ByteCodeValidation?... This could rid you of the performance penalty of process isolation.
There can be a price:
- Performance, if not done correctly (this is very, very difficult).
- Specialized hardware (e.g. numeric processors) not accessible (by definition).
- Difficult to integrate with native languages.
- Loading time.
- Memory allocation issues (VMs are often garbage collected; this issue is due to garbage collection rather than VMs per se.)
See WhyJavaIsGreat
CategoryProgrammingLanguage (?)