[Vm-beginners] Combining C and Objective-C headers

Chris Cunnington smalltalktelevision at gmail.com
Sun Apr 29 22:25:04 UTC 2012


MicroSqueak produces several source files for a VM. At bottom, you'd 
need three:

sq.h
interp.c
msqMain.c

(msqFilePrims.c and msqMiscPrims.c can be stubbed out)

msqMain.c is ~1000 lines long. It would be shorter in Objective-C. But 
then it would no longer be able to use sq.h as a header file, because 
you cannot mix languages in a header. So, msqMain.m would require an 
msqMain.h?

You'd have:

sq.h
msqMain.h
interp.c
msqMain.m


And then the two header files could import each other.
Is that how Cocoa VMs combine the two languages?

Chris


More information about the VM-beginners mailing list