Language Interoperability is the ability of code to interact with code that is written using a different programming language. Language Interoperability can help maximize code reuse and, therefore, improve the efficiency of the development process.
Questions tagged [language-interoperability]
193 questions
6
votes
1 answer
Operator overload "<" declared in Swift class is sometimes not called when used in Objective-C
I've come across a strange issue related to Swift/Objective-C interoperability. The case is this:
I have an @objc public class GKDistance:NSObject,NSCoding,Comparable written in Swift. In order to compare distances, I have added an operator overload…

hellerahum
- 103
- 6
6
votes
2 answers
Calling Java from Clojure
When I try to run the following code (from the REPL) in Clojure:
(dotimes [i 5]
(.start
(Thread.
(fn []
(Thread/sleep (rand 1000))
(println (format "Finished %d on %s" i (Thread/currentThread)))))))
I get the following…

Paul Reiners
- 8,576
- 33
- 117
- 202
6
votes
1 answer
Use Python alongside C# in Windows UWP app
I started writing an application in Python, but I now want to switch to C# and UWP. I know that you cannot write a UWP app in Python, but I am trying to see if I can write some code in Python and access that code from C#.
For example, writing a…

M3579
- 890
- 2
- 11
- 22
6
votes
2 answers
How can I make my Objective-C class conform to Swift's `Equatable` protocol?
I have an Objective-C class (that happens to be a button, but that is not important), and at another part of my (mixed language) project, I have an array of these buttons and I'd like to get the index of a button using the find() method. Like…

Yerk
- 988
- 7
- 20
6
votes
1 answer
Implementing unsafe Java interfaces
I've ran into a problem recently while developing with Spring Security. It has an interface GrantedAuthority with following signature:
public interface GrantedAuthority extends Serializable, Comparable
And as for Java 1.5 and later, the interface…

BorisOkunskiy
- 1,830
- 1
- 19
- 24
5
votes
3 answers
Bridge between Java and C#
I have been given a task to create a bridge between C# and Java. It was said that if we use C# right now, and then we receive a Java file from somewhere else, we should be able to convert that Java file into .NET so it can be compatible with our…

Alexey
- 3,607
- 8
- 34
- 54
5
votes
2 answers
How to store Fortran-style long character scalar in C++ data structure
I am working with a legacy Fortran library that requires a character scalar PATH as an argument to the subroutine. The original interface was:
SUBROUTINE MINIMAL(VAR1, ..., PATH)
CHARACTER (LEN=4096) PATH
...
I need to be able to call this from…

Sebastian Wieczorek
- 179
- 9
5
votes
8 answers
Is CORBA a language?
As i know CORBA is used to maintain interoperability in distributed systems by acting in middle.
What i want to know is, is CORBA a language which has its own syntax of coding or do we code in CORBA using other languages like C#, Java etc.
I went…

Nipuna
- 6,846
- 9
- 64
- 87
5
votes
5 answers
How can I pass data from Perl to Java?
I'm working on some Java <-> Perl interaction. I would like to know what the best way is to pass information from Perl to Java. (Great answers about Perl and Java here and here btw).
There's a lot of text and XML(XML::Twig) I'm parsing in Perl, in a…

Fernando Briano
- 7,699
- 13
- 58
- 75
5
votes
1 answer
What is a reliable way to find a Scala type's companion object via Java reflection?
I'm writing Java (not Scala) code, where I have a Java Class reference, referring to a Scala type T:
trait T {}
I would now like to discover the Java Class reference, and the singleton instance that corresponds to object T by using Java reflection…

Lukas Eder
- 211,314
- 129
- 689
- 1,509
5
votes
1 answer
ObjC generic collection with protocol as parameter is translated as [AnyObject]
Why protocols property is translated as [AnyObject] in swift, not as [P]
@protocol P;
@class C;
@interface TestGenerics: NSObject
@property NSArray* classes;
@property NSArray
* protocols; @end In Swift it look this way: public class…

Igor Palaguta
- 3,579
- 2
- 20
- 32
5
votes
2 answers
About using F# to create a Matrix assembly usable from C#
There are no builtin matrix functions in C#, but there are in the F# powerpack.
Rather than using a third party or open source C# library, I wonder about rolling my own in F#, and exposing the useful bits to C#.
Wondered if anybody has already…

Benjol
- 63,995
- 54
- 186
- 268
5
votes
1 answer
GNU Fortran and C interoperability
I have a large, mixed C/Fortran, code base, currently compiled using the Intel tools on Windows. I've been asked to port it to the GNU tools, on Linux. More or less at random, I've selected version 4.8.
Where a C function is called from Fortran,…

Tom
- 7,269
- 1
- 42
- 69
5
votes
1 answer
Calling a Go callback function from C++ through SWIG
I'm trying to call the C++ function:
void TestFunc(void(*f)(void)) { f(); }
From Go Code.
I would really want it to be that I just pass a Go function to that function. I know that I can wrap it into a class, and solve it using %feature("director"),…

user1921312
- 101
- 5
5
votes
2 answers
haskell scala interoperability
I am a Scala beginner and coming from Object Oriented Paradigm. While understanding Functional programming part of Scala, I was directed to Haskell - the pure Functional programming language.
Exploring SO question-answers, I found that Java -…

Optimight
- 2,989
- 6
- 30
- 48