

Building Classic Mac OS Apps in OS X - milen
http://blog.steventroughtonsmith.com/post/109040361205/mpw-carbon-and-building-classic-mac-os-apps-in-os

======
nandhp
Windows should have a similar amount of compatibility. The API is basically
the same at least as far back as Windows 3.1 (1992), and probably further
(though I have no personal experience with programming for older versions of
Windows).

Also, Windows 3.1 can be augmented with Win32s, which offers a subset of the
32-bit Windows API -- so it's possible for a single binary to run on Windows
3.1 all the way through Windows 10 (64-bit Windows does not support 16-bit
executables). If you want to try this for yourself, Win32s is rather finicky,
so executables produced by modern compilers won't run. I believe I used
Borland C++ 5.5, which is now available as a free download.

~~~
rpeden
It's actually interesting how similar a pure Windows API app for Windows 8
looks to one created for Windows 1.0. A fun example of this is Charles
Petzold's birthday cake app:

[http://charlespetzold.com/etc/Windows1/CAKE.C](http://charlespetzold.com/etc/Windows1/CAKE.C)

With relatively minor modifications, it'll run on Windows 7/8 and look exactly
as it did on Windows 1.0 30 years ago.

The app was actually created for a fun presentation he gave in 2005:

[http://www.charlespetzold.com/etc/windows1/](http://www.charlespetzold.com/etc/windows1/)

------
stuaxo
I wonder if someone could use carbon to make an emulator for old apps that ran
them seamlessly in OSX ?

Originally I assumed this is what the classic support would do.

~~~
thought_alarm
Classic support was simply Mac OS 9 running in a virtual machine.

Carbon is a modernization of the classic APIs. If an app was ported to Carbon
then it could run in OS X natively without the VM. Older apps that weren't
ported to Carbon need a VM running a classic version of Mac OS.

~~~
yuhong
It is not a true VM, the virtualization is at the nanokernel level.

------
yuhong
There is a big exception. They eventually removed Open Transport support.

------
frozenport
Did the classic Mac OS 1 support things like threads? For example, how do you
deal with a std::async?

~~~
yuhong
Mac OS 9 had MP tasks, but the amount of things you can do from them was
pretty limited.

~~~
stroughtonsmith
I could be wrong, but OS 9's Multiprocessing framework actually relies on
multiple physical CPUs, from what I can tell - there's no way to use it or
test in an emulator (I've tried in the past)

~~~
yuhong
No, all that it needs is the new nanokernel.

------
stuaxo
For the compatibility layer, stuff it might be worth looking at the old, but
open sourced emulator 'executor'.

He built a compatibility layer that can run a lot of binaries up to about
system 6, but without a copy of the OS.

(The closest analogy I can think of is like wine, but also he has a CPU
emulator underneath with neat tricks like dynamic recompilation).

[https://github.com/ctm/executor](https://github.com/ctm/executor)

------
mightykan
Very impressive! It's so cool to see stuff like this. Great job.

