On Wed, Oct 31, 2007 at 08:10:25PM +0200, Igor Stasenko wrote:
On 31/10/2007, Rob Withers reefedjib@yahoo.com wrote:
----- Original Message ----- From: "Igor Stasenko" siguctua@gmail.com
I'd rather prefer to make modifications to slang to be able to generate VM sources for any target language/platform and keep platform dependent code in image instead in separate file(s). This all to simplify build process and to keep all things together.
You mean subclassing a Thread class? Is that platform dependent? If so, I didn't know that and I agree with you - it's should be out in a separate file, if used at all.
No, i mean to keep ALL plugins code in corresponding methods, and never use external sources. For example, a SocketPlugin can have subclasses Win32SocketPlugin, UnixSocketPlugin and in these subclasses we should keep a code for different platforms. But not in .c sources.
OSProcessPlugin is organized like this, primarily because I did not want to have external file dependencies and platform code for OSPP. The approach works well in the case where all or most of the code can be done in Slang (there is no external C support code for OSPP). I don't know that it helps in the case where the intent of the plugin is to wrap some external library.
There are certainly other areas of the VM and plugins where external support code could be moved back into Slang, although I think this is largely a matter of preference for the folks doing the platform code support.
Dave