upvote
deleted
reply
> yes, Wine is an emulator

I think it's more accurate to say that Wine contains some components that are emulators, not that it is an emulator. Sure, it has to emulate the x86 MMU's segmentation behavior, because Linux doesn't set it up the same way. It has to emulate x86 interrupt & CPU exception delivery, because Windows delivers those to applications in a different way than Linux does. For some very old programs, it has to emulate I/O ports and some device behavior. I think GDI and DirectDraw require emulation of a framebuffer and palette hardware.

But the vast majority of Wine's code is not emulation; most of it is a clean-room reimplementation of the win32 APIs, a PE/COFF loader, Windows registry, etc. All of those parts are implementations of API contracts and binary format parsers, not emulation, in the same way that GNUstep is a reimplementation of NeXTSTEP/Cocoa, and not an emulator. (The main difference being that Wine can run Windows executables unmodified, whereas GNUstep expects you to recompile/relink from source. That is a sizeable difference, but not an emulator-sized difference.)

And yes, the computer science definition of "emulator" doesn't specify hardware: it's simply a system that reproduces the externally observable behavior of another system. But if we follow that definition too closely, then things that are clearly not emulators become emulators. Like musl and glibc are emulators of the C standard library (or of each other?), Android is an emulator of the Java virtual machine, and Mesa's software renderer is an emulator of OpenGL or a GPU (that latter bit is tempting, but it really isn't a GPU emulator). At this level, "emulator" just means "abstraction layer", which makes it pretty useless as a term if we take it that far.

So I think "WINE Is Not an Emulator" is true. It contains some bits that are absolutely emulators, but it is not, in its entirety, an emulator, and emulating isn't the function of the bulk of its code.

(I'm not trying to be pedantic here; this was actually a fun thought exercise about emulation in general and Wine in particular.)

reply