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

Objective-C and Swift interoperability inside framework with module mapping

Context Years ago my company built an Objective-C framework that uses a C library and now we're trying to convert it to Swift. Since we need to use this C++ library, instead of completely eliminating objective-c code from the base we need to…
2
votes
0 answers

How to use class from C# library in F# module?

I have 2 projects in a solution: a C# class library and an F# library. The C# library has the following class: using System; namespace TestFSharpDataLayer.Domain { public class TestData { public Guid Id { get; set; } public…
Léster
  • 1,177
  • 1
  • 17
  • 39
2
votes
1 answer

string array C# Interoperability to C++ dll; string array from C# to C++ dll which sets the data and sends it back to c#

this is what i have so far... basically I use the c++ dll to populate the tree components set them and then return them to the managed csharp code. I am running into problems and have tried the entire day with no success. All I want to accomplish…
2
votes
0 answers

Re-using HTTP REST functions across multiple programming languages

Background I am working on a project where multiple independent system services need to talk to a central service via a well/fully-defined REST API (i.e. via HTTP GET, PUT, and POST requests). There are some complex sets of operations we would like…
2
votes
1 answer

Swift and Objc interoperability - availability not working only in objc

While here Apple states that the Swift available flag should be applied also in objc, it's not working for me. What am I doing wrong? I've got following declarations in Swift files: @objc protocol Readable: AnyObject {...} @available(iOS 10.3,…
Nat
  • 12,032
  • 9
  • 56
  • 103
2
votes
0 answers

How do I get C/C++ <-> C# interoperability with bool arrays working?

I'm playing with C++ interoperability and specifically with C# at the moment. I have a C++ DLL containing a C style API that I want to make available for C# and most of the time I am finding that it is not too bad. However, I am having a terrible…
DisplayName
  • 239
  • 3
  • 7
2
votes
0 answers

Problem in compiling C++/Fortran mixed code

I am writing a C++/Fortran mixed programming where a Fortran subroutine is called from within the C++ main program. In the file c-call-f.cpp: #include extern "C" { void for_sub_(int *, double *, double *, int *); } int main() { …
nougako
  • 234
  • 1
  • 8
2
votes
1 answer

Android library written in Kotlin, provide support for Java apps

I am writing an Android library in Kotlin. But when used in Android apps written in Java the support is very poor. For example default parameters in Kotlin are still required in Java. Another one is, non-null parameters does not accept null in…
priyank
  • 2,651
  • 4
  • 24
  • 36
2
votes
1 answer

How can I avoid calling Python interpreter many times from a Bash script?

I'm working on a project involving two main components, one with a Bash command-line interface and one with a Python API. For the purposes of this question, assume that neither of these components can be modified to use a different language for the…
jdw1996
  • 65
  • 1
  • 4
2
votes
1 answer

Call C function from Swift knowing only memory address

I have a very simple function in C and its pointer gets passed into Swift. void callback() { NSLog(@"such pointer…"); } How can it be invoke in Swift using ONLY the pointer? This is NOT about simply invoking it – it works fine when invoked…
Ian Bytchek
  • 8,804
  • 6
  • 46
  • 72
2
votes
1 answer

Incorrect format Exception while trying to call C++ dll from C#

I'm Using C# WPF. I have a C++ test dll as follow: .h: extern "C" __delspec(dllexport) void TestMethod(); .cpp file: extern "C" { __delspec(dllexport) void TestMethod() { MessageBox(0, L"Test", L"Test", MB_ICONINFORMATION); …
Evyatar
  • 1,107
  • 2
  • 13
  • 36
2
votes
0 answers

How can I apply Java functions to Scala Option in Java code

Given Scala Options Option[String], Option[Long], Option[Boolean] and given Java consumers for String, long, boolean I want to apply these cleanly, with static type checks, in Java code. The problem is, Option[Long] and Option[Boolean] become…
2
votes
2 answers

Interoperable Obj-C typedef NS_ENUM to swift

In my Objective-C .h file, I have defined: typedef NS_ENUM(NSInteger, RTSpinKitViewStyle) { RTSpinKitViewStylePlane, RTSpinKitViewStyleCircleFlip }; How to access the enum in Swift code? I tried using dot operator as…
sambhav
  • 39
  • 4
2
votes
1 answer

How does PHP handle 32 byte keys for tripledes encryption

Apologies all - newbie at encryption - been googling for days and finally asking outright. I need to use PHP to encrypt and decrypt data that is readable by a Java TripleDES "DESede/ECB/NoPadding" function. In Java there is a double-length 32…
Dash Weh
  • 198
  • 1
  • 5
2
votes
1 answer

Using allocatable, target variables in a derived type

I'm binding Fortran code with a C dll, and I would like to have a Fortran array inter-operable with C. I currently have the following subroutine to bind the Fortran array with a C double*: SUBROUTINE Pack_Inputs( Input , In_X ) TYPE( InputType ) ,…
user1628622