I've heard that Reddit and Facebook have written certain parts of their applications in C/C++ to speed up run times. However, to my knowledge, the main platforms are written in other languages. How do they get these programs to work together?
I recently wrote a program in Java to allow me to push/pull data from a RESTful resource. A colleague now requested that I implement into his. Unfortunately, his application is authored in C#.net and I don't know C#, nor do I want to re-write my code. Is it possible to simply create some kind of wrapper/shim to integrate the two systems together, i.e. the main C# program requests some kind of data file/object from my Java program?
Also, would it just be more reasonable to simply learn how to re-write the program in C#?
There is actually an excellent open source project for using Java bytecode from .NET languages. It's called IKVM. You can either dynamically interpret Java .class files on the fly, or you can first "compile" the Java bytecode to .NET bytecode to produce a .NET assembly and then use that along with some IKVM DLL's. I've used the pre-compiling option successfully to incorporate a large Java computational geometry library (JTS) into a C# application.
C# and Java are not so different in a lot of ways, so porting your app would probably not be a huge undertaking (depending on various factors, of course.). As they are both managed languages, I wouldn't expect to see a performance gain when calling C# code instead of native Java.
However, you may find this link useful: http://codefry.blogspot.co.uk/2012/01/calling-net-dlls-from-java-code-without.html?m=1#!/2012/01/calling-net-dlls-from-java-code-without.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With