Speaking of which, I have another. You could have external functions they way that blitzmax and some other languages do. If you have xcode on the users computer for example, you could compile C++/etc and have a proxy method within SC. When anyone runs that method it executes the compiled function written in C++ that its linked too, and returns the variables/arrays/etc. So, when the user compiles their SC project, it also compiles the .cpp file they added, and links all the functions in it to SC method proxies.
Although to be fair, this will probably be really clunky and hard to implement. But the more options the better eh?
My idea was not too far off. The plugin developer would compile the C++ themselves into a dylib. REALbasic can "weak link" to dylibs. All I would need to do is weak link to generic methods in 50 dylibs all named SCPlugin01, SCPlugin02... all the way to SCPlugin50. When you compile the game in SC, it would take all of the dylibs the game needs and rename them, and then include some information as to which plugin is which dylib.
So, to include the physics dylib with your game, the SilverCreator compiler would take SC Physics.scplugin (which has the dylib and the file describing all the functions), take the dylib and rename it to SCPlugin01.dylib and bundle it in the app. The byte code system works by assigning everything numbers, for example the beep method is method #1. The byte code system would assign numbers to methods from used plugins and would include a table that says methods 123-126 are in plugin 1, etc. When method 123 is called, we then call a function in the weak-linked SCPlugin01.dylib, something like ExecuteMethod which returns nothing. We would also have ExecuteNumberFunction and ExecuteStringFunction if we need data back, and some way to pass the parameters.
The whole point of doing all that is that we need not modify the SC Runtime (RuntimeMac) at all, we just have to include information that says SCPlugin01.dylib is really "such and such plugin, that does all of this nice stuff that we'll be referencing". So they're really truly plugins but without all of that messy actual compiling.
I'm not sure how dylibs work exactly, whether or not they have a persistent memory area as long as the parent app is running - or if they just have temporary memory while a dylib method is running. I *think* they might have persistent memory which would make things easier.
I'm not sure if you can do this Gan - can you write a dylib? Something that just exposes a generic function named "TestBeep", no parameters or return value, all it does is issue a system beep? Make sure it compiles for 10.4+, PPC and Intel. We can use that to test.