I'm in the process of designing some code "packages" (as we call them at my company) which provide fairly generic functionality, and I would like to find a way to standardize the API across all languages that we are working with.
I'm thinking about designing the classes and test cases to be the same for each language, but leaving the implementation be language-specific. This would mean that if we find a bug in one of the language implementations, we'd need to check to make sure it didn't also exist in the others. My current philosophy is that, as long as the class design and the test cases are synchronized across languages, then this is an acceptable tradeoff for having some degree of "knowledge sharing".
So what I think would work best in this case is a simple check against class and method names, just to make sure that the calling convention is the same for each language, and that we are testing for the same types of stuff with each one, too. Are there any such tools out there to do this, or am I better off just writing some script to do the name checking myself?
And moreover, am I looking at this problem in completely the wrong way? I really would like a way to make our respective algorithms available for each language that we need them in, but sharing or integrating the code directly isn't an option here (as an example, the two main languages which I need to support now are AS3 and C++, so a shared library is out of the question). However, I feel that making everything this generic and modular may come back to bite me in the ass later.
Any advice would be greatly appreciated.