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.

112 questions
44
votes
4 answers

Instantiating a python class in C#

I've written a class in python that I want to wrap into a .net assembly via IronPython and instantiate in a C# application. I've migrated the class to IronPython, created a library assembly and referenced it. Now, how do I actually get an instance…
Yes - that Jake.
  • 15,710
  • 14
  • 68
  • 94
15
votes
7 answers

Why does the Python/C API crash on PyRun_SimpleFile?

I've been experimenting with embedding different scripting languages in a C++ application, currently I'm trying Stackless Python 3.1. I've tried several tutorials and examples, what few I can find, to try and run a simple script from an…
Sion Sheevok
  • 3,799
  • 2
  • 17
  • 37
15
votes
7 answers

How to share business concepts across different programming languages?

We develop a distributed system built from components implemented in different programming languages (C++, C# and Python) and communicating one with another across a network. All the components in the system operate with the same business concepts…
Lev
  • 687
  • 5
  • 17
13
votes
1 answer

Declare a C++ function that has C calling convention but internal linkage

I'm trying to interface with a C library, which expects me to provide a pointer to a callback function. As I understand it, according to the standard the callback must have C language linkage, due to possibly different calling convention. I can…
yuri kilochek
  • 11,212
  • 2
  • 25
  • 52
9
votes
3 answers

How to unserialize PHP Serialized array/variable/class and return suitable object in C#

The goal is to unserialize a PHP serialized string and get sutable object in C# Is there any way to make this possible in C#(.Net)? To be more specific: We need to make an application which comunicates (Via HTTP) to specific website which returns…
George
  • 1,380
  • 3
  • 11
  • 27
8
votes
3 answers

Wrapping C create and destroy functions using a smart pointer

I have some C API that handles object creation and destruction, it provides: createObject(...) and destroy(...). I want to wrap it into some more modern construction/destruction mechanisms and use them with smart pointers. I am afraid that at some…
Piotr Barejko
  • 456
  • 2
  • 12
7
votes
1 answer

How to pass a list of objects from C++ to C#?

My first question here :) I am working with an application written in C++ (a map editor for a game) that has the front end UI written in C#. Since i'm new to C# i'm trying to do as much as possible on the C++ side. From C# i want to call a C++…
Cousken
  • 160
  • 2
  • 10
7
votes
4 answers

Is there a cross-language TDD solution?

I want to write a simple colour management framework in C#, Java and AS3. I only want to write the unit tests once though, rather than recreating the unit tests in JUnit, FlexUnit and say NUnit. I have in mind the idea of say an xml file that…
David Arno
  • 40,354
  • 15
  • 79
  • 124
7
votes
2 answers

Is it safe to "play" with parameter constness in extern "C" declarations?

Suppose I'm using some C library which has a function: int foo(char* str); and I know for a fact that foo() does not modify the memory pointed to by str. It's just poorly written and doesn't bother to declare str being constant. Now, in my C++…
einpoklum
  • 86,754
  • 39
  • 223
  • 453
7
votes
3 answers

Invoking C++ code from Java (GCJ)

I'm trying to invoke C++ from Java using GCJ using the CNI, so far I'm able to invoke Java code from C++. How can I invoke C++ from Java using the CNI?
Joe D
  • 2,674
  • 2
  • 27
  • 25
7
votes
2 answers

In Apache Thrift How Should Date Objects Be Represented

In the Thrift IDL there isn't a Date type. What's the best cross language mechanism to represent a date object. I think there are 2 ideal candidates but I'd love to hear other ideas. String - in each language you could use something like strftime…
Bryan M
  • 163
  • 1
  • 5
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
4 answers

Interacting with java code from C#

We've written a Java program which we are looking to use and interact with from C#. What are our options? Optimally it would be possible to compile the Java application as a library (.DLL) that we could reference from C# perhaps using P/Invoke.…
Kasper Holdum
  • 11,655
  • 4
  • 41
  • 72
5
votes
1 answer

Use C library in a C++ code with non-compatible code

I want to use a C library in a C++ code, without modifying it. The library contains fragment of code non-compatible with c++ like : C++ keyword new and delete _Atomic object bad declaration I compiled the C library into a .so. And I also used it…
Pierre I
  • 53
  • 4
5
votes
5 answers

Can you call Ada functions from C++?

I'm a complete Ada newbie, though I've used Pascal for 2-3 years during HS. IIRC, it is possible to call Pascal compiled functions from C/C++. Is it possible to call procedures & functions written in Ada from C++?
paxos1977
  • 135,245
  • 26
  • 85
  • 125
1
2 3 4 5 6 7 8