Questions tagged [language-interoperability]

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.

176 questions
11
votes
6 answers

How to call java objects and functions from CPython?

I have a python program, which runs on the CPython implementation, and inside it I must call a function defined in a java program. How can I do this? It would be nice to be able to use some java objects too. Jython is not an option. I must run the…
nosklo
  • 193,422
  • 54
  • 273
  • 281
11
votes
3 answers

How to convert a Scala Array[Byte] to Java byte[]?

I have an Akka application with actors written in Scala and others in Java. In one case a Scala Actor writes an Array[Byte] and I need to deserialize this from a Java Actor. In this use-case I ultimately need a String representation in Java of the…
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
10
votes
2 answers

How to pass an array of Swift strings to a C function taking a char ** parameter

I'm trying to interact with an old C terminal app from Swift. I've successfully integrated the source code and bridged the headers from C to Swift. The code compiles and runs from Xcode 6.3 beta. I've renamed the terminal app's main entry point…
Mark
  • 103
  • 5
9
votes
3 answers

What are the best practices in language interoperability?

In a system which requires use of multiple languages, what are the best practices to ensure a loosely-coupled architecture when code is calling another language's code?
GurdeepS
  • 58,809
  • 95
  • 236
  • 371
8
votes
4 answers

Using a C++ library in C# winforms

I'm trying to use the SPARK particle system in OpenTK. my project contains the header files in folders, with just two header files which only includes the others, and the folders contain the source files too. I have tried several approaches so far,…
niceman
  • 2,354
  • 21
  • 49
8
votes
2 answers

How to access private members of an Objective-C class from a Swift extension?

I'm trying to extend an Objective-C class in Swift and make it conform to the Equatable protocol. This requires to access some private members of the extended class, which the compiler doesn't let me do. What is the correct way to do it without…
Mike Lischke
  • 36,881
  • 12
  • 88
  • 141
8
votes
2 answers

How interoperability works

I know that many large-scale applications such as video games are created using multiple langages. For example, it's likely the game/physics engines are written in C++ while gameplay tasks, GUI are written in something like Python or Lua. I…
gone
  • 2,397
  • 6
  • 22
  • 31
7
votes
2 answers

Avoiding writing the same algorithm in multiple different languages

I am a web developer, and I have observed that many times I need the same function on both client and server. So I write it in JS as well as in PHP or whichever server side language. I am fed up with this. If I have to change it then I need to…
Hafiz
  • 3,847
  • 11
  • 54
  • 106
7
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,387
  • 8
  • 32
  • 53
7
votes
2 answers

calling methods on .net object from coldfusion

I am trying to instantiate and call methods on a .net object created from a dll from coldfusion. This works when I call methods with one or zero arguments but fails with - System.MissingMethodException: Could not find the generic method…
Nick Van Brunt
  • 14,482
  • 11
  • 60
  • 89
7
votes
0 answers

Fortran-C++ interoperability: Passing array via void pointer

I roughly have the following situation. I have a C++ function which is called from Fortran code and takes a function pointer and a void pointer as arguments like this int STDCALL FORTRAN_NAME(CPPFunction, CPPFUNCTION)( int (*userFunction)(const…
7
votes
1 answer

Interoperability of types in C and C++

A very simple question: are there any guarantees that a C int is the same thing as a C++ int, on the same system? It goes without saying that this is, of course, a purely theoretical question. The C and C++ standards use the same language to define…
Tristan Brindle
  • 15,036
  • 2
  • 31
  • 79
6
votes
4 answers

Create Indexer in VB.NET which can be used from C#

Can I create a class in VB.NET which can be used from C# like that: myObject.Objects[index].Prop = 1234; Sure I could create a property which returns an array. But the requirement is that the index is 1-based, not 0-based, so this method has to map…
codymanix
  • 25,944
  • 18
  • 83
  • 142
6
votes
3 answers

Unifying enums across multiple languages

I have one large project with components in multiple languages that each depend on some of the same enum values. What solutions have you come up with to unify enums across multiple arbitrary languages? I can think of a few, but I'm looking for the…
Jonathan Swinney
  • 1,014
  • 8
  • 26
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…
1
2
3
11 12