|[10 earlier articles]|
|Re: Do we really need virtual machines? Nicola.Musatti@ObjectWay.it (2004-10-09)|
|Re: Do we really need virtual machines? firstname.lastname@example.org (Daniel C. Wang) (2004-10-09)|
|Re: Do we really need virtual machines? email@example.com (glen herrmannsfeldt) (2004-10-09)|
|Re: Do we really need virtual machines? firstname.lastname@example.org (2004-10-12)|
|Re: Do we really need virtual machines? email@example.com (2004-10-17)|
|Re: Do we really need virtual machines? Colin_Paul_Gloster@ACM.org (Paul Colin Gloster) (2004-10-21)|
|Re: Do we really need virtual machines? firstname.lastname@example.org (Paul Robinson) (2004-12-17)|
|Re: Do we really need virtual machines? email@example.com (glen herrmannsfeldt) (2004-12-19)|
|Re: Do we really need virtual machines? firstname.lastname@example.org (Tobias Bergmann) (2004-12-22)|
|Re: Do we really need virtual machines? email@example.com (2004-12-23)|
|From:||Paul Robinson <firstname.lastname@example.org>|
|Date:||17 Dec 2004 00:31:14 -0500|
|Posted-Date:||17 Dec 2004 00:31:14 EST|
Nicola Musatti wrote:
> According to their proponents virtual machines such as JVM and CLR are
> the solution to all our (programming) problems, of which portability
> is but one.
I'm not sure if that is what has been claimed, or if that's your opinion
but if it is what is being claimed, it's obviously dead wrong.
A Virtual Machine solves one problem and only one: allowing a
particular binary program to be operated in a non-compatible
environment. That the environment may not exist anywhere except in
software isn't really relevant.
There are a number of areas that a virtual machine does not solve,
including source portability (care to say that you are certain you can
run a program unchanged on two different machines that use the same
virtual machine environment? Maybe you can but it is probably likely
you can't); execution efficiency in critical environments (nobody
writes a boot loader to run in multiple virtual machine environments)
and graphics standardization (a game to run on Windowz will be
different from one to run on Linux or the Macintosh even if it can run
in a virtual machine).
> Maybe it's just because when I learnt programming the p-machine was
> considered an interesting oddity, but with the exception of code that
> really must run unchanged on unknown platforms, I fail to see what do
> I gain from a virtual machine that I don't already get from a good old
> compiler/runtime support/standard library chain.
For text-based and batch processing in ordinary applications a virtual
machine may provide a bettet choice for targeting an application than
a recompile for dozens of targets. This may be one reason Ryan
McFarland COBOL is quite popular since the p-code for compiled
applications is the same for all platforms the compiler is written
> After all, isn't gcc the most ported virtual machine of all?
I don't think GCC would qualify as a virtual machine as I think code
is generated to run natively, not to be interpreted.
> Now, this being the compiler forum, I'm interested in learning about
> the advantages of virtual machines from the compiler writer
It allows you to write the code generator once (as opposed to
rewriting the code generator for each target machine) and simply
rewrite (or recompile) the run-time library and virtual support
environment for each target machine (which you have to do anyway).
You would also have to rewrite the compiler's I/O routines to handle
differences in file management.
If the compiler itself can run on the run-time library then you might
not even have to rewrite any part of the compiler at all.
"The lessons of history teach us - if they teach us anything - that
nobdy learns the lessons that history teaches us."
Return to the
Search the comp.compilers archives again.