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.

193 questions
3
votes
1 answer

Can't get fortran function output from ctypes

I'm trying to call a Fortran function from Python using ctypes. I have tried to obtain the result from a subroutine and from a function (both with the same functionality), but I can't obtain the expected output from the function whereas the…
Jfreixa
  • 81
  • 7
3
votes
1 answer

Fortran and c interoperability

I have been writing a Fortran and C interface, but there always appears errors. I'm not sure why there is the problem. The original C code is following: #include #include #include #include…
zmwang
  • 519
  • 1
  • 7
  • 13
3
votes
1 answer

What's the best way of accessing a DRb object (e.g. Ruby Queue) from Scala (and Java)?

I have built a variety of little scripts using Ruby's very simple Queue class, and share the Queue between Ruby and JRuby processes using DRb. It would be nice to be able to access these from Scala (and maybe Java) using JRuby. I've put together…
Tom Morris
  • 3,979
  • 2
  • 25
  • 43
3
votes
2 answers

Why does Scala occasionally fall back to Java objects?

I'm almost certain that this question has been asked before, but I'm missing the right words to find it. scala> Seq[Any]( 3, 3.4 ) res0: Seq[Any] = List(3, 3.4) scala> res0( 1 ).getClass res1: Class[_] = class java.lang.Double scala> Seq( 3, 3.4…
Taig
  • 6,718
  • 4
  • 44
  • 65
3
votes
1 answer

Code organisation for native interoperability in .NET

I am currently porting some native code to C#, which consists of various structures, delegates, enumerations and external method calls. Some of the fields within structures expect certain constants to be applied to them. It seems logical to list…
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
2
votes
2 answers

Calling scanf from Ada

How do you call scanf from Ada? That is, presumably with an appropriate pragma import declaration, but what would the declaration look like? (I'm interested in how to call C functions of the more unruly variety from Ada, not how to parse strings per…
rwallace
  • 31,405
  • 40
  • 123
  • 242
2
votes
0 answers

Java/Kotlin Interoperability Limitations

I recently faced a problem regarding interoperability between Java/Kotlin for suspend functions. See my question: How to Override a suspend function in java class. Both the answers seem to agree on suspend functions not completely interoperable. So,…
Abbas
  • 3,529
  • 5
  • 36
  • 64
2
votes
1 answer

.NET Core 6.0 COM interoperability issues with Python/Octave

I am currently trying to create a COM object in .NET Core 6. To achieve this I have made a class library and edited the project like this: C#: Project file (*.csproj):
Spikxz
  • 35
  • 5
2
votes
1 answer

How to convert Objective-C NSData to Swift Data?

I have a NSData in Objective-C, the NSData has value 0x10, code like bellows: @implementation BufUtil + (NSData *_Nonnull) getOCBuf { std::vector sendData = {0x10}; NSData * reqBuf = [[NSData alloc]…
2
votes
3 answers

How to use from C# a Rust function that has another function as a parameter?

The following example illustrates what I am looking to do. The operation function receives a value and a function as a parameter, then returns the execution of the function. So far everything is perfect. Now I would like to use that function…
2
votes
2 answers

Protected variable in an objective c super class is inaccessible in a swift subclass

@interface MyObjectiveCmainClass { @protected NSMutableArray* thisStringIsInaccessibleInSwiftSubclasses;//this I can't access in swift subclass } @property NSString* thisStringIsAccessibleInSwiftSubclasses;//this I can access in swift subclass -…
2
votes
0 answers

Using .NET Core 3.1 C# dll in C++ project

I'm a software developer in a generalist company. We are a small team and I inherit some 20 year old software (like in a lot of companies I guess) This software is coded in C / C ++, with Visual Studio 2010. Its purpose is to communicate with…
JohanB
  • 21
  • 3
2
votes
1 answer

How to create a C struct from Python using ctypes?

I have a similar problem to this question. I'm basically trying to create C structs from Python using ctypes. In C I have: typedef struct Point { int x; int y; } Point ; Point* makePoint(int x, int y){ Point *point = (Point*)…
CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106
2
votes
2 answers

How to make Swift class conform to Objective-C protocol, without exposing it to Objective-C?

I have a Swift class called LoginCoordinator that performs a "Sign In with Apple" request. In order respond to callbacks it conforms to the ASAuthorizationControllerDelegate. Because of this requirement, I also need to make this class a subclass of…
2
votes
1 answer

How to use map_indexing_suite from Boost.Python with custom not std object?

Simple example of 'map_indexing_suite' usage is working fine: class_ >("testMap") .def(map_indexing_suite, true>()) ; and on python side it works as expected: a =…
Oleg Kmechak
  • 165
  • 1
  • 14