Hi, On 7/4/07, Nicolas Cannasse <[EMAIL PROTECTED]> wrote:
Because of GC issues, I think you should instead treat Neko values as opaque C pointers, and write a small C API that reproduces the #define macros that would be accessible from C#.
What GC are you considering here? Of course, the C# GC will not know about roots in compound values that live in C# land, and therefore might clean them up. For my purposes, I can live with this because I only need strings in C# land. Do you think there will be problems with the Neko GC as well? Anyway, I think the simplest is to just expose a simple API that can call a static function in a haXe class in a neko.n file. For my purposes, I can live with only having access to functions that take a string and return a string: char const * call(char const * filename, char const * className, char const * functionName, char const * stringParameter ); This API should lazily open a Neko VM (and reuse this for future calls), and call a specific function in my code, as I need it - using the haXe ABI: First lookup _classes, then lookup the class, then lookup the function, and call it. In case of trouble, it should just return NULL. I think I'll add this API to the Neko DLL to avoid having a small DLL for just this part. I'll can a patch when it's done to comply with the LGPL, but are you interested in this? Regards, Asger
-- Neko : One VM to run them all (http://nekovm.org)
