Jump to content
  • Advertisement
Sign in to follow this  
Daggerbot

Universal class library

This topic is 3253 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Part of my current project is a library that is meant to be usable on all of the following languages: C, C++, Objective-C, Java, .NET. I've been researching C/C++ calling conventions and name mangling and have been considering writing a program that eases the process of porting the library. All languages will be able to access the same shared object (DLL). Using this program would add a little bit of complexity to writing the library, but would be much less time consuming than writing all of the language bindings manually. To use the program, I would first write an interface file that describes all of the classes and other types that the library defines. With this interface file, my program would generate a header file (for use by C/C++/Obj-C), a java library file (.jar) and a .NET module (.netmodule). Once the implementation is written in one of the native languages (C/C++/Obj-C), I would push all of the COFF object files produced by the compiler through this program, which would add the symbols and instructions necessary to use the same machine code by any of the native languages. In addition, JNI functions would automatically be generated. These post-processed object files could then be linked normally. When I finish the project and confirm that all components work properly from all target languages, I might release this universal class compiler as a separate project. If enough people use it, I will attempt to port it to OSX and Linux (but currently just Win32), and possibly other machine architectures such as AMD64, IA64, and ARM. Bindings for languages like Python and Lua may be added as well. What are your thoughts on this idea? Is this something that library developers would like to use? Any constructive feedback is appreciated. Last second note: The reason I don't just use COM is that it is mostly a Windows-only model, and I tend to target as many platforms as possible.

Share this post


Link to post
Share on other sites
Advertisement
CORBA is the non-Microsoft technology equivalent of COM.

I've never used it on linux but there probably are IDL tools for use with java and gcc.

The gnome and mozilla libraries seem to have similar things in them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!