Purpose of VM [was: Re: Better management of encoding of environment variables]
Posted by Martin McClure-2 on Jan 17, 2019; 1:00am
URL: https://forum.world.st/Better-management-of-encoding-of-environment-variables-tp5088714p5093676.html
On 1/16/19 1:24 AM, Nicolas Cellier wrote:
> IMO, windows VM (and plugins) should do the UCS2 -> UTF8 conversion
> because the purpose of a VM is to provide an OS independant façade.
I have not looked at this particular problem in detail, so I have no
opinion on whether the VM is the right place for this particular
functionality.
However, I feel that in general trying to put everything that might be
OS-specific into the VM is not the best design. To me, the purpose of a
Smalltalk VM is to present an object-oriented abstraction of the
underlying machine.
Thinking that way leads me to believe that the following are examples of
things that are good for a VM to do:
* Memory is garbage-collected objects, not bytes.
* Instructions are bytecodes, not underlying machine instructions.
This works well to hide the differences between machine instruction
sets, memory access, and other low-level things. However, no Smalltalk
implementation that I know of has been able to use the VM to iron out
all differences between different OSes.
I do believe that it is a good idea to have cleanly-designed layers of
the system, and that there should be an OS-independent layer and an
OS-dependent layer with clean separation. But I think it might be better
to put most of the OS-dependent layer in the image rather than in the
VM. For one thing, the image is easier to change if there is a bug, or a
lacking feature, or you're trying to support a new OS.
And if it's in the image you get to do the programming in Smalltalk
rather than C or Slang, which is more fun for most of us. And, let's
face it, fun is an important metric in an open-source project -- things
that are fun are much more likely to get done.
Regards,
-Martin