Background: I want to develop a component therefore building a class library.
This component should be usable with many higher-order languages such as C, C#, C++, VB, Java, Haskell, Ruby, Erlang, ... I do not want to exclude any users which are not using my development language. Are there principles or tools which supports my project? I searched a little bit and found Haxle for compiling into different languages, but it supports very few of them. I would even develop parallel in all n languages to be supported, but if I want to change or fix something I have to maintain all other n-1 and the code is possibly distributed... This is not what I know about clean code design and maintainability. So how to manage edits on code for the different languages? What is the proper way to solve this? I am surely not the first one which want to build a library for multiple languages.
I want to develop this library (in this case for complexity reduction) in one target language but this time for multiple platforms (Unix, Win, Mac ...). How to manage this? In fact there will be appreciated about 90% of code which is platform independent and 10% which differs for every OS. What is the best way to control the changes in the platform dependent code? (The independent is easy ...) What if I change so things in the part which uses Unix dependent code, then I have to trail all other platform and the code is possibly distributed. I think
#IFDEF
is no option ...
Are there any experiences or hints?
I would be delighted if there are existing solutions to these problems, which are quite similar.
For 1), I would use an interface that all these languages can use. A common approach is something based on networking/TCP, like protobuffer, REST, SOAP. Many languages support these in their standard libraries, and interfaces designed with that are normally language agnostic.