Software-Preservation-Network-Techinfra / spn-techinfra-emulation

Community resource for emulation use cases
2 stars 0 forks source link

Smalltalk Lede #1

Open axfelix opened 3 years ago

axfelix commented 3 years ago

Virtual Machine can have a number of different connotations in a digital preservation context. The one that most users are probably familiar with involves an entire virtualized Windows or Linux instance, potentially with a full desktop environment running in a window, deployed using VMware or VirtualBox for development and testing purposes. Most consumer PCs have been capable of this kind of virtualization with little to no performance penalty since the early 2010s, and it has since become a ubiquitous low-level implementation -- Docker and its derivatives work by shipping the smallest possible Linux kernel and running arbitrarily many virtual instances of server software on top of it, and Microsoft uses a technology called Hyper-V to run entire new releases of Windows as "natively virtual" for security purposes. Because of the hardware features that enable this, virtualization has the advantage over emulation of being able to be seamless and fast, provides that all of your virtualized software is compiled for the same architecture (x86 for most PCs, ARM for increasingly many Macs and servers). And because server software is generally among the most maintainable, is frequently recompiled through the course of regular development, etc., the use case works.

When it comes to running, for example, an old image of Windows 95, the difference between emulation and virtualization is often small in practice. If your host machine is (likely) native x86, you probably have the option of running it as a virtualized guest or going as far as emulating the whole x86 architecture, as if you were emulating PowerPC or some other architecture, using tooling such as qemu. The latter option would not have nearly native performance, but is technically more portable. Additionally, most VM environments tend to internally assume one of a handful of legacy architectures -- that is, certain motherboard chipsets from 1994 that you probably don't need to think about -- and in the even that you were trying to observe subtle differences in hardware behaviour, you may need to emulate them from the ground up.

There is another common meaning for a virtual machine that predates the modern usage -- an environment for an interpreted programming language to execute in. Today, we take for granted that interpreted languages can run like any other; there are more novice and expert programmers of Python, Ruby, etc., than there are of low-level languages, and to many, the distinction is academic. However, should you want to learn about the environment that ships with every common distribution of Python and is responsible for translating it to a dialect of C that can work on the fly, you can go Inside the Python Virtual Machine. This is where we got ScummVM -- a popular not-emulator that takes its name from LucasArts' early cross-platform point-and-click game engine, which was novel at the time for its portability and for allowing game writers to work in a high-level scripting dialect which insulated them from the programmers who needed only to port the engine and add features to it. SCUMM games are often catalogued by their release platform: Mac, Commodore, 3DO, etc., in many cases differing only by the sophistication of the graphics and music that were included with each release, and ScummVM can run them all by executing little to no machine code, because they all contain SCUMM interpreter instructions.

This is also the means by which Smalltalk environments were deployed. Smalltalk was one of the products of Xerox PARC, the computing innovator of the 1970s, and predates virtually every other cross-platform programming language that actually shipped on working computers with the exception of LISP. Among other concepts, it is credited with popularizing Model-View-Controller architectures, object oriented programming, and the "just-in-time" compilation approach that is essential to running an interpreted language on the fly. Smalltalk was primarily used on Xerox Alto computers in its day, but remains beloved by many engineers, and because it various dialects are so well-documented and have such straightforward syntax, Smalltalk interpreter VMs have been ported to various contexts, such as Dan Ingalls' Smalltalk Zoo.

masinter commented 3 years ago

The story about Interlisp is a little different; it was used as a early IDE (integrated development environment) shipping initially on the same hardware (Xerox 1100) as Smalltalk but different microcode. We have a Zotero bibliography (Interlisp), source code and a running VM.