Extending different targets?

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
912
Is it possible to use any supported language on the different targets? What I mean is, could you use C# as well as C/C++ on Windows? Both Objective C and Swift on macOS & iOS? And Kotlin as well as JAVA on Android?

If not, what stops you from doing it?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,165
Well, TransCC can translate your CX code to one target language at the translation process. Javascript, Java, C++ or C#. ActionScript is obsolete.
Then its about the build process to bind/build the translated code with various tools like MSVC, MingW, Android Studio or XCode.

Did I understood that correctly, you want to add multiple languages for native code to a project?
The only thing I see where this could be done is in Xcode, where you could mix C++ and Objective C files. But the other platforms, i dunno?

If not, what stops you from doing it?
I have no need for it and I think it is not possible to a a certain extend.

What is the mindset/motivation behind this question?
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
912
I will use specific hardware for a few tiny and very simple games. So I'm about to extend CX and it's valuable for me to know beforehand what languages I may use.

I'm adding two pieces of custom hardware (only for macOS and Windows for now, but Android will be the most interesting platform for me to code because it's the hardest one when it comes to adding hardware. So I'm planning to dig right into macOS and shortly after Windows and keeping everyone interested posted.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,165
But why the need for building different native languages in one project. Which compiler can do that?
 

Gerry Quinn

Active member
Tutorial Author
Joined
Jun 24, 2017
Messages
151
A multi-target language gets more bang for the buck by having one target per platform!
 

Gerry Quinn

Active member
Tutorial Author
Joined
Jun 24, 2017
Messages
151
Well, maybe I'm misunderstanding you. But on each target Cerberus translates code into a specific language that gets compiled along with the native library for that target. There would be little benefit in writing Java libraries for desktop, say. I suppose you could leave out mojo and just compile a main program to transpile Cerberus code, but that would have no special support for any given target.

Do you want to write externs in one language while compiling to a target based on another? Well, as people have said, few compilers support that.
 
Top Bottom