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
4
votes
1 answer

How to wait a js async function from golang wasm?

I have written a little function await in order to handle async javascript function from go: func await(awaitable js.Value) (ret js.Value, ok bool) { if awaitable.Type() != js.TypeObject || awaitable.Get("then").Type() != js.TypeFunction { …
4
votes
1 answer

LLVM Interoperability (Like JVM or .Net) - Is it possible to do?

I recently played around a bit with different LLVM Frontends like Clang (C Familiy ), LDC2 (D), Terra, ... All these languages can be compiled into the LLVM IR (somewhat readable) and LLVM IR Bitcode . So at this stage they are all on the same…
T.Furholzer
  • 199
  • 1
  • 8
4
votes
1 answer

Objective C & Swift Interoperability causes error "Extensions may not contain stored properties"

I was working on one of my previous app that was done on Objective C. I need to add a new module to it and I decided to use Swift for that particular module. I have a class called HomePage in Objective C, I wanted to add some new IBActions and…
Midhun MP
  • 103,496
  • 31
  • 153
  • 200
4
votes
1 answer

Forced to define Go struct for casting an unsafe.Pointer() to a C struct

Interoperating with C code, I was not able to directly cast a structure and I was forced to define an equivalent one in Go. The C function from libproc.h is int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) The C…
gsscoder
  • 3,088
  • 4
  • 33
  • 49
4
votes
3 answers

can i use bdb(berkeley db) file created by c implementation (python bsddb) by oracle berkeley db java edition?

I have a berkeley db file (*.bdb) which is created by the C implementation(python bsddb module). Is it possible to read this file by a pure java implementation of Berkeley Db? I tried to read it using berkeley db java edition (je) but could not. je…
NeoAnderson
  • 397
  • 2
  • 4
  • 11
4
votes
1 answer

problems when accessing C union field

I'd like to access the field of C union in Go. below is my source code, but i got an error when compile it: package main // #include // #include // union bar { // char c; // int i; // double d; //…
Tony Bai
  • 151
  • 2
  • 6
3
votes
1 answer

How can I use a Java library that has a .to method in Kotlin as it assumes I mean to use the infix operator for creating a pair

I am using the Mailgun Java API which is used to send emails. There is a .to method on a message builder that you use to populate the recipient's details. However, when I try to use this it tells me that there is a compilation error as it assumes I…
3
votes
2 answers

Running C++ code asynchronously in a C# program

I wrote some backend code in C++ and I wrote a frontend for it in C#. What I want it to do is run the backend code in the background so I can do other things like update a progress bar, but when I click the "Start" button, the program hangs until…
AlexP98
  • 33
  • 3
3
votes
1 answer

How can one access Kotlin's `backtickedFunctions` from Java?

TL;DR: Is there a simple syntax in java to access kotlins backticked functions such as fun `if`(){...} Long Version: In Kotlin, one may write the following class. class ShapeShifter { fun speak() { println("Hello fellow hooman") } fun…
Ar3s
  • 2,237
  • 2
  • 25
  • 47
3
votes
1 answer

How to access struct members by name in scala native?

From the scala native docs at https://scala-native.readthedocs.io/en/latest/ this is how to access struct members: type Vec = CStruct3[Double, Double, Double] val vec = stackalloc[Vec] // allocate c struct on stack vec._1 = 10.0 //…
user573215
  • 4,679
  • 5
  • 22
  • 25
3
votes
2 answers

Any platform where Fortran `double precision` is different from C `double`?

For interoperability with C programs, the 2003 revision of the Fortran standard introduced a module iso_c_binding, which allows one to write things like this: USE iso_c_binding, ONLY: c_int, c_float INTEGER(KIND=c_int) :: x REAL(KIND=c_float) ::…
3
votes
1 answer

Assign an array of Swift strings to a C structure variable taking a char ** value

I'm trying to interact with an old C terminal app/library from Swift. I've successfully integrated the source code and bridged the headers from C to Swift. The code compiles and runs, I can access all functions from C - library into swift. There is…
3
votes
0 answers

C++/C# : pipe WriteFile() is not writing data to receiver end until you close the pipe handle

I am trying to write string data from a C++ module to a C# module using Named Pipe. My code is below: C# (Pipe Server): namespace CSPipe { class Program { public void ThreadStartServer() { // Create a name pipe …
Raveendra M Pai
  • 445
  • 2
  • 10
  • 27
3
votes
1 answer

Can Google Protocol Buffers be serialized/parsed between different languages?

The official site as well as some other sources describe one of the benefits of Google Protocol Buffers as being highly inter-operable. I know the technology supports different language bindings out of the box, and many more as third party…
3
votes
1 answer

How do I deal with a pointer when Swift calls C API

The c Lib API : mycapi.h typedef struct{ int itype; double * dx; double * dy; }MyObjInfo; typedef MyObjInfo * MyObjHandle; MyObjHandle MyObjInit(const char *pFile); add myapi.h as module my swift code : import Foundation import…
Enping Wu
  • 31
  • 3