• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Any good alternative to c/c++, c# and java for game development? A modern c++?

2+2=5

The Amiga Brotherhood
Just out of curiosity, i'm neutral to java, i like c# and i loved c++ in the past, but nowadays c++ feels archaic.
Any new language that is supported by some good gaming library(directx, opengl/vulkan, monogame, others)?
I heard that D is a modern C++, or a C++ without the C legacy, is it true? Anyone tried it?
Other recent good c++ like languages?
 
Unity offers C# and Simil-Python as programming languages.

Unreal can be done with Blueprint, with some rare C++ sprinkled in.

If you want to write a new engine, you can technically use any language: However, only C\C++ has the performance required.
 
C++ is still the king because performance.

Maybe it's complicated and has some stuff people don't like, but it's not archaic at all. Have you seen C++ 11/14?
 
Just out of curiosity, i'm neutral to java, i like c# and i loved c++ in the past, but nowadays c++ feels archaic.
Any new language that is supported by some good gaming library(directx, opengl/vulkan, monogame, others)?
I heard that D is a modern C++, or a C++ without the C legacy, is it true? Anyone tried it?
Other recent good c++ like languages?

To be honest, the newer C++ standards (2011 and upcoming [yes, you read that right] 2014) are actually pretty robust and do a surprising amount for the language compared to older revisions. That said, 2011 isn't quite fully supported by all compilers yet (Microsoft, natch), and it'll be a while before 2014 is fully supported.

D is in fact C++ without the legacy code, but that unfortunately means it's missing significant portions of the C++ standard library. As a language it's basically better than C++ in every way except for adoption, A result of the legacy-code jettison is obviously also that you're not going to see much in terms of backward-portable code; D code generally is D code, not code that can double as C++/C code.

If you're okay with having a less robust standard library and less available support/knowledge base, though, D's definitely worth a look. It's a very clean, very smart language that, unlike most of the other ease-of-use languages, trusts the programmer enough not to take away the most powerful tools. You can do anything in D you would have done in C++, and most of the things you do will probably be easier and a bit safer.
 
C++ is great when you use a tiny, tiny subset of it and ignore anything that adds ambiguity. This is a bit radical for some, but I personally completely avoid things like templates, operator overloading, and various shorthands that hurt code readability.

Use the stack for most things, but allocate on the heap for any kind of resource. Use automatic pointers. Use libraries for everything and only "roll our own" if you have to.

In the end, it ends up looking fairly close to C# in clarity.
 
To be honest, the newer C++ standards (2011 and upcoming [yes, you read that right] 2014) are actually pretty robust and do a surprising amount for the language compared to older revisions. That said, 2011 isn't quite fully supported by all compilers yet (Microsoft, natch), and it'll be a while before 2014 is fully supported.

D is in fact C++ without the legacy code, but that unfortunately means it's missing significant portions of the C++ standard library. As a language it's basically better than C++ in every way except for adoption, A result of the legacy-code jettison is obviously also that you're not going to see much in terms of backward-portable code; D code generally is D code, not code that can double as C++/C code.

If you're okay with having a less robust standard library and less available support/knowledge base, though, D's definitely worth a look. It's a very clean, very smart language that, unlike most of the other ease-of-use languages, trusts the programmer enough not to take away the most powerful tools. You can do anything in D you would have done in C++, and most of the things you do will probably be easier and a bit safer.

I can only second this. I am trying to develop a basic mahjong game purely in D and I notice that the language is very easy to learn and is very user friendly. However, there is a most certain lack of non-office support features. I am using DLanGUI as my graphical library, but it is really made with office applications in mind.
Nevertheless, I get the feeling D is going through a rapid evolution, so maybe in the next few years it is up to par with other languages.
 
C++ is great when you use a tiny, tiny subset of it and ignore anything that adds ambiguity. This is a bit radical for some, but I personally completely avoid things like templates, operator overloading, and various shorthands that hurt code readability.
Haha I think it might be common practice rather than radical, my ex-company forbade me from using operator overloads in the first place.
 
Rust seems like a good candidate. Last time I checked, there were people trying to build games with it, but I expect there to be much more once it actually gets to 1.0 release.

That said, I actually mostly like C++11. It still has some rough edges, but is not nearly as bad as some people would want you to believe.
 
Haha I think it might be common practice rather than radical, my ex-company forbade me from using operator overloads in the first place.

That's good. I based my comment on the open source projects that I've seen. Some of that code is indecipherable!

I was looking around for projects to potentially contribute to, but I just "noped" out in the end after witnessing some of the horrors. :)
 
The STL is pretty decent nowadays. I'd stick to C++ personally. I love it.

If a good C++ library is something you'd be interested in I'd take a look at SFML. I use it for when I need to quickly get some 2D prototypes and for my assignment work that needs some simple graphics. It's really easy to use.

http://www.sfml-dev.org/
 
I heard that D is a modern C++, or a C++ without the C legacy, is it true? Anyone tried it?
I really like D, but I'm not sure that it's better than C++ to develop games. As much as the syntax is better, you'll get troubles when trying to interface librairies, and that's a must for a game.

I'm sticking to C++ for games. The last revision, C++11 (which is far from 100% supported by compilers) bring many useful and modern features to C++. Granted, that make the whole language even more a syntaxic mess (there's really awful things sometimes). In fact, C++ is developping faster than D.

C# is probably the most obvious alternative. I'm wondering whether Cython can be used for this too (I've wanted to try this one for ages).



C++ is great when you use a tiny, tiny subset of it and ignore anything that adds ambiguity. This is a bit radical for some, but I personally completely avoid things like templates, operator overloading, and various shorthands that hurt code readability.
I'd say that well used operator overloading definitively improve readability, not hurt it.

Obviously when you use it correctly (I mean, overloading + for a vector class (or [] ) makes things easier to understand...) Of course, if you overload () to perform an obscure action on the class just to spare some characters in source, that's not wise at all.
 
Look into rust. It's gaining serious traction.

I can see how Rust would be interesting for gameplay code, but not really for game engine code. That is, unless there are offline compilers for Rust. Admittedly, I'm not well versed enough with regards to Rust to speak decisively in the matter.

OP: As a C-family programmer myself (mostly C++ and C#) I don't have a good answer for you. You could check out Jonathan Blow's recent work in game programming languages, or you could check out some of the proposals for a modern C++ floating around. Nothing usable in their current state though.

Obviously when you use it correctly (I mean, overloading + for a vector class (or [] ) makes things easier to understand...) Of course, if you overload () to perform an obscure action on the class just to spare some characters in source, that's not wise at all.
Operator overloading only makes sense (for me) for mathematical types and even then I think operator overloading should be carefully considered (see the ambiguity of the * operator for vector types, which is a good reason not to overload that operator for vectors at all).
 
Depends on what you're developing and where you want to run it. Look into JavaScript/asm.js/NaCL/PNaCL and WebGL or Canvas. Browser games can be deployed to a wide range of targets (PC, mobile/tablet, Wii U, set top boxes and microconsoles, etc.). Quite a few maturing frameworks as well, like Phaser and Three.JS. Tooling support is excellent, and being able to build GUIs in HTML and CSS is a big bonus.
 
Nevertheless, I get the feeling D is going through a rapid evolution, so maybe in the next few years it is up to par with other languages.
I wouldn't hope to much... I think I discovered D circa 2002, and its evolution is awfully slow. The issue is that too few people are using it... and even finding a proper compiler has been difficult sometimes.

C++ evolves far quicker... which makes D even less appealing (and again, I really like D). I doubt it'll be a major language in the future, although I'd like to be proven wrong.
 
I wouldn't hope to much... I think I discovered D circa 2002, and its evolution is awfully slow. The issue is that too few people are using it... and even finding a proper compiler has been difficult sometimes.

C++ evolves far quicker... which makes D even less appealing (and again, I really like D). I doubt it'll be a major language in the future, although I'd like to be proven wrong.

My bad, then. I had the impression that D was much younger. I discovered the language just over a month ago and I've already witnessed the update to 2.067, hence why I thought that it was evolving rapidly.
 
You might be interested in this

https://www.youtube.com/playlist?list=PLmV5I2fxaiCKfxMBrNsU1kgKJXD3PkyxO

Jonathan Blow (Braid, The Witness) has been working on a new programming language specifically for games for about 5 months now and does talks and demonstrations about it every few weeks. It's way above my level but it's very interesting and he seems to have good ideas.

This does not surprise me as he is constantly complaining about OpenGL programming lol. " WHY IS THIS NOT WORKING?!!?!?! " heh. His twitter feed is a fun follow.

In all actuality C# and C++ scripting is pretty simple as it is.
 
Depends on what you use it for. Many game engines allow you to do scripting in friendlier languages, but even Java is too slow to use for this sort of thing.

Just now we have many attempts to make a 'modernised' C/++ but they are not quite ready yet.

C# is probably the only other language you will find people widely using? I also like to blame MS for that one.
 
I can see how Rust would be interesting for gameplay code, but not really for game engine code. That is, unless there are offline compilers for Rust. Admittedly, I'm not well versed enough with regards to Rust to speak decisively in the matter

Uh, what? The only compiler for Rust is offline. Rust is a statically typed language, intended for writing things like operating systems and web browsers. I don't see how it's not fit for game engines.
 
Wasn't D dependent on garbage collection?
It's a GC language, indeed (but like Java or C#), and the GC of D isn't even the most efficient one. There's many solutions to avoid GC problems, though, like object pools, and many ways to control when and how GC happen.

My bad, then. I had the impression that D was much younger. I discovered the language just over a month ago and I've already witnessed the update to 2.067, hence why I thought that it was evolving rapidly.
D is great, and D is probably what C++ should have been, had they not built an object language as a superset of an old, low-level, imperative language.

But there's not so many people trying to improve D (even finding a reliable compiler can be difficult) and that's a problem. It's even worse when you're talking about libraries, the choice is really limited.

But go on trying D, it's a great language, and the more people are using it, the most we can hope for its future. Just don't be too excited... I was enthousiast ten years ago, It's a bit of desillusion now :/
 
There really isn't any good alternative. C/C++/C# are industry standards while languages such as Lua and Python are commonly used for embedding purposes such as some gameplay programming, event scripting, etc.

I'd say Rust may be the closest good alternative but I don't really know how well it will apply to game development. I've been writing C/C++/C# for about 10 years now and I've played around with Rust as well but Rust is "too safe", it prefers safety over performance and isn't very iterative in my experiences where as the above three languages are kind of the opposite in that regard particularly C/C++. Performance and iteration is much more important than safety in game development.

I'd say Rust is a good thing to maybe keep an eye on but I don't see anything replacing C/C++/C# outright any time soon. It'll take a long extended time for a language to become a modern replacement or alternative. Even if D/Rust become more modern alternatives we're not going to see adoption in game development for at least a decade.
 
I have started programming with Java. For a start, it was great. Easy to understand and well documented in terms of books and online courses. You can directly go into Android if you like as well. But after a while I started using C++ in conjunction with Qt.

Qt is awesome. Easy to use and very powerful and well supported. It even has the ability to directly export your C++ code to Android. The same code base for Desktop as well as Mobile. Just switch your compiler.

C/C++ has the huge advantage of being used everywhere. If you're a Linux user,
You can't get around it.

It adds several layers of complexity on top of Java like pointers, references and manual memory management. But the insight you get into the system by doing it yourself is a huge benefit. Even if you don't plan on using C forever, just learning its basics is worth it.
 
I have started programming with Java. For a start, it was great. Easy to understand and well documented in terms of books and online courses. You can directly go into Android if you like as well. But after a while I started using C++ in conjunction with Qt.

Qt is awesome. Easy to use and very powerful and well supported. It even has the ability to directly export your C++ code to Android. The same code base for Desktop as well as Mobile. Just switch your compiler.

C/C++ has the huge advantage of being used everywhere. If you're a Linux user,
You can't get around it.

It adds several layers of complexity on top of Java like pointers, references and manual memory management. But the insight you get into the system by doing it yourself is a huge benefit. Even if you don't plan on using C forever, just learning its basics is worth it.
I feel teaching new programmers in Java was one of the worst decisions universities did a few years ago and am glad some are reversing it. Knowing C before going into Java is a huge benefit, if only for the insight it give you for what Java is doing in the background.
 
My Uni reversed that as well...

But. I can understand both reasons. If you want to teach someone to program (not to understand a Von-Neumann arch), then Java is much better suited than C. Just programming stuff. I've had additional courses in my first semester with MIPS Assembler to do this.

I mean. If you want to scare people away instead of greeting them nicely go ahead and use C. (I am exaggerating here) For a bloody beginner it's better. For someone that wants to know the how and why C is better.
 
Just out of curiosity OP, what makes u feel that C++ is archaic? You're bored playing with all the C++11 features and using all the gaming related libs or what?
 
I think the decision was more about employability since Java developers were very in demand so having people with lots of practical Java was appealing to employers.
 
In terms of ease of use: I don't think anything in the foreseeaeble future will beat C#. It's crazy intuitive to use and most of the time, really fool-proof (i.e. when you code stupid things, it won't blow up your entire system, and usually it's relatively easy to trace back where the bug is coming from too).
That increases your efficiency and productivity tons; you'll often be able to code stuff in C# orders of magnitude faster than in C++. And you won't even spend half of your day waiting for the compiler to finish.

Having said that, C++ has a very significant speed advantage. You can very well use DirectX etc. with C#, SharpDX is currently the best performing library to help you do that as far as I know. But still it has a significant performance penalty, I've read figures of around 30% for pure rendering.

I'd refrain from using any other language, such as that "game oriented" language someone mentioned above. Nothing is worse than learning a buggy language where it's highly questionable for how long it's going to be supported.
C++ has been around forever and will be around for quite a while. C#, harder to tell, but seeing how Microsoft is focusing the NET Framework and given they even migrated many of their own tools and compilers to be written in .NET languages for a big part, I'd feel comfortable in saying it will be actively used and very well maintained for many years to come.
 
I think it's very much a personality thing whether starting with C or Java is better, most important is getting engaged and sit down and practice.

I'm glad I started with C I just really like to know whats happening behind everything and starting with Java would have annoyed me greatly. Of course the downside it's somewhat hard to do anything super "interesting"(subjective) with C as a beginner(although I managed to do a console connect 4 which was a fun newbie project).
 
It's a GC language, indeed (but like Java or C#), and the GC of D isn't even the most efficient one. There's many solutions to avoid GC problems, though, like object pools, and many ways to control when and how GC happen.
Most of these solutions I heard about address mostly the random slowdown problem. They don't do much about cache trashing. Not to mention GC-oriented object pool is all about fooling GC.

There is a reason C++ found its niche. Sometimes you just can't beat direct control.

Rust looks promising - its syntax is wildly different from what C++ offers and that makes adoption harder, but its authors got some basics right. Time will tell whether it will get most important of C++'s "unsafe" features or not.
 
I think it's very much a personality thing whether starting with C or Java is better, most important is getting engaged and sit down and practice.

I'm glad I started with C I just really like to know whats happening behind everything and starting with Java would have annoyed me greatly. Of course the downside it's somewhat hard to do anything super "interesting"(subjective) with C as a beginner(although I managed to do a console connect 4 which was a fun newbie project).
Depends, for example I think every Java programmer needs to understand pointers and how Java uses them as a bare minimum whether they think they need to or not. (they do)
 
The problem with the likes of Java and C# is that you become dependent on 3rd party software to run your code. Want to support a new platform? You're completely dependent on someone porting the Java VM and a C# framework for it, while C++ allows you to begin coding for it on day one.
 
The problem with the likes of Java and C# is that you become dependent on 3rd party software to run your code. Want to support a new platform? You're completely dependent on someone porting the Java VM and a C# framework for it, while C++ allows you to begin coding for it on day one.
Not entirely true. You need someone to port C compilers to your platforms or provide cross-compilation at the very least. The problem is proprietary software which in the case of Java is a problem with the SunOracle JVM but not with OpenJDK, Java is ported everywhere anyway. Now, C# is slightly different because Microsoft until very recently was very asinine in how they handled the .NET runtimes with respect to non-windows communities that required people to reverse engineer a big part of their code.
Their community on non-windows systems is still pretty small so I would consider C# to be a very bad dependency to consider when planning a project.
 
As others have suggested OP, the modern C++ is C++11/14, and if you aren't familiar with things like decltype, auto, unique_ptr<>, shared_ptr<>, weak_ptr<>, std::move, std::forward, constexpr, std::thread, move operations (constructors), std::function / lambdas, and a lot of other great renovations, you're missing out on what I'd argue is the only real modern C++.

For me, it feels like an entirely new language, and the rate at which C++ is changing now, you have plenty to get excited about. If you did generic programming, or like compile-time featuresets, C++ has you covered in a big way. Concepts are coming at some point, and... hell, when you dig through what is planned for C++17, a lot of it is really exciting.

If you're familiar with all of those things, and you feel like they don't impact how you start new projects, and you don't feel like C++ is scripty enough (it is, in a lot of ways, starting to feel more and more like a scripting language for many tasks), then C#/mono is probably the way to go, but only consider making that leap when you feel you've exhausted every avenue that C++11/14 can give you to turn your code into truly modern code.

I started falling out of love with it, but then C++11/14 happened, and now I swear by it again. As always, its multi-paradigm approach means whether you need OOP for design, or procedural, or functional, or you really just need to get down to the bits and bytes, or you need compile-time computation, you have the options open to you to get dirty with C++ in the way you know you like, or stay high-level and readable. It's a kind of proposition that when you switch to another language the first question usually becomes "what can I not do?"

I've used D before, and while I think it was a fine alternative before C++11/14, I don't feel that it is now. Probably the only thing I miss from that is lazy evaluation. std::optional<> may ultimately pave the way for a similar implementation in C++ when it happens?
 
As others have mentioned, Rust is likely to be the next big game dev language, if there ever is one. It, uniquely among programming languages, offers memory safety without garbage collection, and produces code as efficient as C++. Rust is also great for writing multi-threaded code, since it can statically prevent data races. It's also very expressive, and borrows a lot of cool features from other modern but niche languages.

Rust currently has two problems. First, it's very new, with version 1.0 just coming out next month. This means that the libraries and documentation available are quite immature. Second, is that the compiler is currently very conservative about its notion of safety. There's a lot of code you can write in Rust that is safe, but the compiler can't prove is safe, and therefore won't compile. Rust provides an escape hatch that let's you write that code anyway, but then you lose all of the compiler's static safety checking in that block, which makes it pretty dangerous (though, no more dangerous than writing normal C++). This will improve over time as the compiler gets better, and as people developed more skill in the language.

TL;DR Rust is very cool, and it's a good time to check it out if you want in on the ground floor, but it's a few years away from being a serious contender.
 
I don't know much about languages and this sounds pretty obvious I know but just to be clear, I'm assuming you have to buy a book or something and learn how to use any different language you use?
 
As others have mentioned, Rust is likely to be the next big game dev language, if there ever is one. It, uniquely among programming languages, offers memory safety without garbage collection, and produces code as efficient as C++. Rust is also great for writing multi-threaded code, since it can statically prevent data races. It's also very expressive, and borrows a lot of cool features from other modern but niche languages.

Rust currently has two problems. First, it's very new, with version 1.0 just coming out next month. This means that the libraries and documentation available are quite immature. Second, is that the compiler is currently very conservative about its notion of safety. There's a lot of code you can write in Rust that is safe, but the compiler can't prove is safe, and therefore won't compile. Rust provides an escape hatch that let's you write that code anyway, but then you lose all of the compiler's static safety checking in that block, which makes it pretty dangerous (though, no more dangerous than writing normal C++). This will improve over time as the compiler gets better, and as people developed more skill in the language.

TL;DR Rust is very cool, and it's a good time to check it out if you want in on the ground floor, but it's a few years away from being a serious contender.
Rust's approach to safety is very reasonable from where I stand. If it can't prove a block of code is safe then it cannot ensure that it is safe so it required you to manually override that block which is of course unsafe but not less safe than if it let you run it anyway. The improvements are in being able to more reliably determine code blocks which are safe and is bound to happen over time. Once the language is more or less finalised it will be nice to work on, as it stands you have code that compiled on one version changing overnight which is normal for a new language but very difficult to develop anything substantial.

I don't know much about languages and this sounds pretty obvious I know but just to be clear, I'm assuming you have to buy a book or something and learn how to use any different language you use?
Nay. Also some of the best books for most of the popular languages are available for free, and documention is or at least SHOULD be available online for all developers to access.
A lot of programers like to buy books though and reference manuals are nice to have around though redundant in the age of online references. There is also help forums such as stack exchange and the programming boards here though I confess I do not browse the later.
 
Thanks everyone!
I''l give a look to c++ 11/14/17, D(i didn't know it was so old!), rust, swift, and whatever the name of the language braid's creator is developing.

I guess that in the end i'll stick with c++ 11 because libraries and support is what really matters to me but would be awesome to see some good alternatives becoming more diffused.
 
The real question is - what does your engine support? At this point I would consider it being a bad choice to create your own engine (as an indie dev), because you burn money and time for things that are already available for rather good conditions. That leaves you with mainly C# for Unity and C++ for UE, I'd say.
 
Thanks everyone!
I''l give a look to c++ 11/14/17, D(i didn't know it was so old!), rust, swift, and whatever the name of the language braid's creator is developing.

I guess that in the end i'll stick with c++ 11 because libraries and support is what really matters to me but would be awesome to see some good alternatives becoming more diffused.
I see a lot of simple games being written in Python these days, honestly, it depends on your experience and the scope of what you are trying to create.
 
The real question is - what does your engine support? At this point I would consider it being a bad choice to create your own engine (as an indie dev), because you burn money and time for things that are already available for rather good conditions. That leaves you with mainly C# for Unity and C++ for UE, I'd say.

Might write one for the engineering challenges a game engine gives.
But commercially yeah i would probably choose Unreal engine or others.
 
The problem with the likes of Java and C# is that you become dependent on 3rd party software to run your code. Want to support a new platform? You're completely dependent on someone porting the Java VM and a C# framework for it, while C++ allows you to begin coding for it on day one.

I mostly develop software, so apoligies if I'm writing nonsense now.
But isn't the vast amount of game engines reliant on DirectX or, much less commonly, OpenGL - both of which won't necessarily run on all platforms, either?

For the record, you have Mono to run C# applications on most platforms these days. Which is why Unity allows for pretty easy PC, Android, iOs etc. development with one and the same language (C#). Admittedly, as far as I know it usually requires a paid license (included in Unity "for free", but for other projects..)
 
Top Bottom