Looking for appropriate language

As much as I would love to use C++, dynamic/shared libraries are a pain, especially since the same compiler must be used if you want to use anything from the standard library.

I want to make a game with plugin support. I want the end-user experience to be as easy as picking out the plugins they want and then, depending on the language, downloading the correct versions for their OS.

That means, I am looking for a language which is suitable for making games and which is also suitable for dynamic/shared libraries compiled by different people. I don't really know how to search for programming languages; I was wondering if anyone already knew of a suitable language?
Last edited on
since the same compiler must be used if you ant to use anything from the standard library
Only if you want to use those across the interface. You can mix and match compilers if the interface is pure C and the things that go across it are PODs and basic types.

If performance isn't an issue, I'd go with a .NET core with .NET DLL plugins.
If it is, either a C++ core embedding a Lua interpreter for Lua plugins, or a C++ core that loads C++ plugins exposing a C interface.
A .NET core with Lua plugins is also possible of course, but unnecessary IMO.
Last edited on
I will be dealing with many non-POD types. I have looked into LUA but it is not what I am looking for; in fact it's quite the opposite. Ideally I want the game itself to be written in the same language as the plugins.

I have yet to look into C#/.NET but I have heard of Mono, do you think that is the right direction?
¿would this be an issue if you let the users compile the libraries themselves?
I considered that for a time, but do you really want to spend a few hours messing around trying to get things to compile just to play a game?
$ make
I don't think that it is too much to ask the user to run an "installer"
So the user has to install a compiler too?
sure, why not.
how else may they have "installed" all the other wonderful program that they are using.

(just as some ask for DirectX or .NET Framework)
You know, I think you're right. The plugins will be entirely server-side anyway so there's no reason to worry about it. Thanks!
Last edited on
Ideally I want the game itself to be written in the same language as the plugins.

The majority of games are probably programmed in multiple languages, including tools and such. Use the right tool for the job.
The majority of games are probably programmed in multiple languages, including tools and such
not that i have any experience in this or if using multiple languages/tools is right or wrong, to provide an example, the blizzard client and WoW uses mostly lua/c++, but apparently also uses flash and java
If you did it in C# you could write the plugins in C# or something like IronPython. The performance of .Net is pretty good.
Cross platform/drag and drop libraries? I smell Java (and if you prefer, Scala)
My experience with Minecraft has proved to me that while Java definitely has a better user experience, there are just too many issues with server stability and performance despite many independent attempts at better designs. I will, however, allow rapidcoder to explain away my misguided assumptions, but I have already decided not to use Java.
I suggested .NET because C# has much better linguistic features than Java; Java the language is probably the shittiest in its abstraction level range.
With LINQ, C# now supports many functional programming idioms. For example, lately I've been doing a lot of Windows registry traversals that look pretty much like
1
2
3
4
5
6
7
//Note: Type inference at declaration.
var list = someKey.GetSubKeyNames() //returns an IEnumerable<string>
    .Select(someKey.OpenSubKey) //Select is the FP map function
	.Where(x => x != null) //Where is FP filter function
	.Select(x => x.GetValueNames().Select(y => x.GetValue(y) as string).Where(y => y != null)) //Note: At this point this is an IEnumerable<IEnumerable<string>>
	.SelectMany(x => x.ToArray()) //Flatten the list of lists. ToArray() prevents multiple evaluation. More on that below.
	.ToList(); //If I leave this out, list is a IEnumerable<string> rather than a List<string>. LINQ IEnumerables are lazy. 
If you're dealing with lots of non-memory resources, C# also makes it easier (though not as easy or infallible as C++) with using. Java only has finally, which looks horrendous in a sufficiently busy scope.
Another nice feature of C# is extension methods, which is a syntactic sugar nicety that lets you extend a class without having to derive from it.
1
2
3
4
5
6
7
public static class StringExtensions
{
    public static string MakeSnafucated(this string s){ /*...*/ }
}
//...

var s = "hello".MakeSnafucated();
Topic archived. No new replies allowed.