UbarDPS wrote:Windows needs those directories for backward compatibility.
Yes, that's my point. It's a lot of extra complexity that shouldn't have been necessary.
UbarDPS wrote:It's quite a bit more elegant than the approach Apple uses to run Classic applications.
Apple used virtualization to run Classic apps on the PPC versions of OS X. Microsoft is using virtualization to implement "XP mode" in Windows 7. This is off-topic though, as it is more about running apps for an older and much different version of the OS on the current version. UBs don't help with that.
UbarDPS wrote:Universal Binaries are a waste of disk space, especially when lots of vendors use them, when you have have something made to runon 3 architectures, but you only use on.
It's a tradeoff, but IMO a good one. Disk space is cheap. User and developer time is not.
UbarDPS wrote:Apple had to make Universal Binaries because they completely switched platforms. Windows never really did that.
Sure it did. NT was originally available for x86, Alpha, MIPS, and PPC. More recently, the first 64-bit version of Windows was for Itanium.
UbarDPS wrote:x64 is backward compatible
Yes, so why is it that Win32 and Win64 binaries are
incompatible?
Consider how DLL loading works in Windows... Let's say a 64-bit process wants to load some system library. It has to use the 64-bit version of the library. More than likely, it was originally a 32-bit program that was ported to 64-bit, so it is probably going to look for the library with its old name, and in the original directory location (e.g.: c:\windows\system32\foobar.dll). Now you need these two parallel directory trees, one with 32-bit binaries and one with 64-bit binaries, and you need to re-direct all accesses from 32-bit processes.
On Mac OS X, a 64-bit process loads exactly the same library that a 32-bit process would, because the library is a universal binary that contains both the 32-bit and 64-bit versions of the code. No parallel directories, no re-direction of file system requests, no registry shadowing, etc. All of that stuff is a hack around failing to solve this problem in the right part of the system.
This is why .NET assemblies can target "AnyCPU" -- because the .NET guys realized that the old way of doing things was a hack (plus, with IL that gets JITted, it would be crazy not to do it this way).