Questions tagged [cross-language]

In programming, "cross-language" or "multi-language" refers to features that operate across multiple programming languages.

In programming, "cross-language" or "multi-language" refers to features that operate across multiple programming languages.

Cross-language features include type systems, data formats, storage layouts, etc. which are common across multiple languages. They help applications or services written in different languages to inter-operate and exchange information.

132 questions
1
vote
2 answers

Sending object via socket, but different language client, how to make the object serialize?

I have a Java Server that sending the java serializable object to my client, and receive java serializable object for execution. If my client is also java written, which is nice, that allow me to do communication within any problems. But now, I…
DNB5brims
  • 29,344
  • 50
  • 131
  • 195
1
vote
1 answer

Is this possible for C to execute a piece of js code?

For example, I have a js code, and I while like to write a simple console program that read this code, execute it, and print back the result. Is this possible to do so? If yes, how can I start doing this? Thank you.
DNB5brims
  • 29,344
  • 50
  • 131
  • 195
1
vote
1 answer

Forcing a rounding mode for a single operation in OpenCL

Suppose I want to perform a (single-precision) division of x by y in my CUDA kernel, and regardless of anything else, get a rounded-up result (= rounded to positive infinity). This is easy: Instead of: float r = x / y; I write : float r =…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
0 answers

How can I use functions in a .pyc file in my C++ project in VSCode?

I have a cryptography project I am working on, and the module I am using is Python only so I can't use it in C++. I would like to compile the Python code into a .pyc file (a compiled python file) and use this in my C++ project. I would like to call…
user19316228
1
vote
2 answers

Importing C methods/classes into a C# project

I have some c headers, and a c lib that I'd like to import and use in a c# project. How can I do this?
Malfist
  • 31,179
  • 61
  • 182
  • 269
1
vote
0 answers

Why are the OpenCL C++ bindings in CUDA 11.6 older than in CUDA 10.1?

I'm looking at the OpenCL C++ bindings header distributed with several versions of CUDA, and am noticing that the newer CUDA versions have older C++ bindings: CUDA Version cl.hpp version cl.hpp modification…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

When to use c or cpp to accelerate a python or matlab implementation?

I want to create a special case of a room-impulse-response. I am following this implemetation for a room-impulse-response generator. I am also following this tutorial for integrating c++\c with python. According to the tutorial: You want to speed…
havakok
  • 1,185
  • 2
  • 13
  • 45
1
vote
2 answers

What's the idiomatic way to compile the same file twice, with different languages?

I have a source file which is valid in (at least) two languages. Say, C and C++ or C and CUDA. I want to compile this file in both languages, each time into a different library. What's the idiomatic way of doing this in recent versions of…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

How to consume messages using beam's external kafka transform (locally)

I am trying to run an app that uses a kafka producer (Python client), and an apache beam pipeline that will (for now) simply consume those messages by printing them to STDOUT. I understand that using Kafka external transform with apache beam is a…
Imad
  • 2,358
  • 5
  • 26
  • 55
1
vote
0 answers

What is best tool to generate source to source code other than Haxe?

I need to develop an sdk for an app and we have many clients written in many languages such as js, java, python, swift, CPP... etc. Do we have any language which we can use to write the SDK and it will translate it into other source languages? I…
Atikur Rahman
  • 1,043
  • 1
  • 7
  • 14
1
vote
2 answers

How to handle a C++ header file with a extern call to C function and a class object

I am trying to compile an application involving both C and C++ files. With one particular header I face issues. The file in question (a C++ header file), would look something like this: #ifndef TASK_H #define TASK_H #include "MyCCPObject.h" int…
mmcblk1
  • 158
  • 1
  • 3
  • 10
1
vote
3 answers

How can I throw an NSError from a Swift class and catch it in an Objective-C class?

I need to implement a try-catch structure in Objective-C to handle Swift thrown NSErrors. I've written an NetService manager with Swift code and I am implementing it on an already existent Objective-C UI. However, whenever I throw an error from my…
1
vote
2 answers

How to interface Swift with C or C++?

I’d like to write some native code in either C or C++ to be used with Swift on iOS. This code would mainly be invoked from Swift but would also need to callback to Swift as well. What is the mechanism for interfacing Swift with each of these 2…
Clancy Merrick
  • 855
  • 1
  • 8
  • 16
1
vote
1 answer

Managing project agnostic code libraries without creating dependencies

I'm curious to know how fellow developers manage project agnostic code/libraries? For example, given these two functions: function array_exclude_keys(Array $array, Array $keys){ foreach($keys as $key){ unset($array[$key]); } …
Dan Lugg
  • 20,192
  • 19
  • 110
  • 174
1
vote
1 answer

D problems with static arrays and C interoperability

I have problems passing D struct that contains static array to C. D code: extern (C){ struct vec3f{ float[3] array; } void testVec3f(vec3f v); } ... void test(){ float[3] ar = [1f,2f,3f]; vec3f v = vec3f(ar); …
Rulli
  • 35
  • 4
1 2 3
8 9