- I was wondering if runtime system and compatible layer are the same thing? They both seem to be some software, running of which allows some other software to run on them. Links to Wikipedia for the two concepts have been provided above.
- Are they both virtual machines? The Wikipedia article for virtual machine mentions that run-time system is a kind of virtual machine.
- Why is Cygwin said to be a compatible layer as its type in its Wikipedia article? Is it an emulator of Linux OS, and/or a run-time system?
Although there appear to be a lot of similarities, there are some key differences:
A good example of a Runtime System would be the Java Virtual Machine which provides a consistent cross-platform environment for [compiled] Java byte code.
A good example of a Compatibility Layer would be WINE, which allows users to run unmodified Windows applications directly on Linux and Unix. Compared to WINE, the compatibility layers can also be quite small, such as a single library that the main code base uses to access OS-specific features (e.g., opening a file, communicating over the internet, etc.) which provide a consistent API for the application to effectively hide all the ugly OS-specific differences.
The disadvantage of a Runtime Environment is that the entire environment must be available to whatever code it will be running, which can require a lot of development effort.
The disadvantage of a Compatibility Layer is that is doesn't necessarily provide consistency, and can be more difficult to debug.
The advantage of a Runtime Environment is that, after being ported to a new platform, the applications will run without modification.
The advantage of a Compatibility Layer is that to support a new platform, only a new layer (or set of layers) needs to be created, and the main application can be compiled for the new target platform with minimal changes.
Virtualization is like an extremely extensive Runtime Environment, but the different there is that a CPU instruction set (and any required devices) are being virtualized or emulated very well.