Scripting library for C++ and C#

Started by
3 comments, last by Aardvajk 12 years, 6 months ago
Hi,

I am working on a cross-platform game engine that currently runs on Windows, Ubuntu, Android and iOS. Since it is written in C++ I will not be able to run it on WP7, unless I port the source code to C# which I have now decided to do. But before I begin with that I want to implement support for a scripting language so I don't have to port the code for the future games that will be powered by the engine. So to be able to use the exact same game code on all devices I need a scripting language library that has been implemented for both C++ and C#. So my question is:

Does anybody here know about a cross-platform scripting language library that is available for both C++ and C# applications?

Thanks for your help!

/Klarre
http://epiccode.org/
Advertisement
C++ and C# are languages, not platforms, so cross-platform doesn't apply to them.

For C#, the platform is CLR. For Win8, the platform will become WinRT.
For C++ mentioned above, the platforms are Win32 and iOS. For Linux it's tricky. 32 vs. 64 bit? x86 vs. ARM? POSIX? C++ says nothing at all about portability, only that given C++ compiler and sufficient access to OS kernel, one can typically write code around it.

And it gets trickier, Win8 will require C++/CLI, which is no longer C++, but may use C++ and C code in some cases. For mobile it will be targetting ARM processors and majority of C++ code written will not work on it (one may have a standard-compliant C++ compiler, .but majority of C++ code every written targets a very limited subset of platforms, usually just one).

A scripting language targets its own platform. Python uses Python VM, Lua uses Lua VM and so on.


For portability, one must implement this VM on desired target platform. Some have already been written. If it's not supported, you may need to do it yourself.


Finally, for each combination, you will need to write the bindings to your own engine. So a C# version of engine will need to expose *precisely* the same API as C++ version. A notoriously hard problem which only two mainstream VMs solve (Flash and JVM).

What you are proposing is Flash. A runtime available on many platforms that runs some portable code.

There is not a company left in the world that could provide such a portable platform. Adobe never came even close with Flash and Java, despite all the Sun's engineering effort could never come close to anything beyond a very basic, mostly server-centric common subset.
I didn't stated that C++ and C# were platforms - I said "cross-platform scripting language _library_".

Anyway, I get the point of your post and should probably wait for a WP7/8 NDK that will probably never be released...

Thanks for taking time.
http://epiccode.org/

For Win8, the platform will become WinRT.


Win32 and .NET aren't going anywhere in Windows 8. There is no need to target WinRT.

Win8 will require C++/CLI, which is no longer C++, but may use C++ and C code in some cases. [/quote]

Huh? What are you talking about? C++/CLI is a language used to mix C++ code with .NET, it's not a general purpose language and I see no point in considering it for game creation.

There is not a company left in the world that could provide such a portable platform.[/quote]

No, I'd say Java comes pretty close to being that portable.

Back to the point...

Why don't you take a look at LuaJIT 2.0

Huh? What are you talking about?


I presume this. I'm personally still a little unclear on what you will and won't be able to do without using these extensions to C++ or without using COM the hard way as the article describes.

This topic is closed to new replies.

Advertisement