EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
1.01k stars 192 forks source link

Moving to a newer C++ language standard #1561

Closed Ghabry closed 5 years ago

Ghabry commented 5 years ago

tl;dr gcc5

(this also applies to liblcf but lets discuss here)

There was a request in the chat about moving to a new C++ language standard. I'm in favor for moving to C++14 after the 0.6 release.

C++14 adds a few nice, features, most convenient are generic lambdas (you can use "auto" in the return type, for automatic type deduction, allows more generic programming without using templates)

I don't have a full overview, @fmatthew5876 could list some other useful stuff he would like to use.

The minimum compiler support is GCC5, a few features (generic lambdas) are already partially supported by GCC4.9 but likely full of bugs.

Portability is important for the Player but it is still a trade-off between "maximum portability" and "least programmer frustration". The jump from C++03 to C++11 was gigantic, it made coding much more fun, how could we life without foreach loops before (and deleting 50 MB of Boost deps, yeah!). The switch from C++11 to 14 will be much smaller. The really interesting stuff is all in C++20 but this is obviously completely out of range for a very long time.

Compiler support on other platforms

I assume that Windows, Linux, OSX/iOS, Android and emscripten, use a recent compiler, so they won't be a problem.

For the other ports:

For MorphOS, AmigaOS and AROS the maintainer told me updates to gcc6 are in the works but this can still take a while.

Therefore requiring at least gcc5 looks like an option.

The GCW Zero port is in general not the most popular, it's maintained by carstene1ns but I'm not aware of anybody using it (correct me if I'm wrong).

fmatthew5876 commented 5 years ago

Polymorphic lambdas, improved constexpr, make_unique, and others. Also when I get to doing performance work I'll need a std::variant. Many of the ones I've seen are better supported by C++14.

I support moving to gcc5 and turning on C++14 after the next release.

Here is a good overview of features: https://en.wikipedia.org/wiki/C%2B%2B14

carstene1ns commented 5 years ago

Should be fine. GCW Zero is a dead platform, but there is an unofficial gcc. So should be no blocker. I am in favor if moving to c++14.

fmatthew5876 commented 5 years ago

I wanted to follow up with this. Can we now migrate to C++14?

Given the last conversation was 9 months ago, what's the minimum gcc we have to support now?

carstene1ns commented 5 years ago

I do not think we should go too far beyond 5 for now. This mentions there should be everything supported in 5.x series: https://gcc.gnu.org/projects/cxx-status.html#cxx14

carstene1ns commented 5 years ago

(Using c++14 now)