C++11
-
- Member
- Posts: 106
- Joined: Tue Jan 01, 2013 18:47
- GitHub: hdastwb
- IRC: hdastwb
- In-game: hdastwb
- Location: United States
C++11
It's been out for a couple of years now and has fairly decent support in newer compilers; I think we should be able to use it in Minetest, thus I've submitted a pull request:
https://github.com/minetest/minetest/pull/596
https://github.com/minetest/minetest/pull/596
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
We should also port Minetest to JavaScript.
</troll>
</troll>
Last edited by kaeza on Thu Apr 04, 2013 20:39, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!
Check out my stuff! | Donations greatly appreciated! PayPal
Check out my stuff! | Donations greatly appreciated! PayPal
-
- Member
- Posts: 106
- Joined: Tue Jan 01, 2013 18:47
- GitHub: hdastwb
- IRC: hdastwb
- In-game: hdastwb
- Location: United States
I have been using ranged-for, auto, and lambdas in my code for the last year or so; many of the most prominent features are already implemented in VC++11, GCC 4.6, and newer clangs.
There should be absolutely no issue with using these features in any Linux distro that comes along with a working package manager; if you guys still do the Windows builds in VC++06 or something, then there might be cause to wait on upgrading.
There should be absolutely no issue with using these features in any Linux distro that comes along with a working package manager; if you guys still do the Windows builds in VC++06 or something, then there might be cause to wait on upgrading.
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
Also MinGW should be supported.hdastwb wrote:I have been using ranged-for, auto, and lambdas in my code for the last year or so; many of the most prominent features are already implemented in VC++11, GCC 4.6, and newer clangs.
There should be absolutely no issue with using these features in any Linux distro that comes along with a working package manager; if you guys still do the Windows builds in VC++06 or something, then there might be cause to wait on upgrading.
And the packages for the compiler should be in Debian stable.
-
- Member
- Posts: 106
- Joined: Tue Jan 01, 2013 18:47
- GitHub: hdastwb
- IRC: hdastwb
- In-game: hdastwb
- Location: United States
MinGW's had a newer version than Ubuntu for a while now (they seem to have adopted 4.7 much earlier).PilzAdam wrote:Also MinGW should be supported.hdastwb wrote:I have been using ranged-for, auto, and lambdas in my code for the last year or so; many of the most prominent features are already implemented in VC++11, GCC 4.6, and newer clangs.
There should be absolutely no issue with using these features in any Linux distro that comes along with a working package manager; if you guys still do the Windows builds in VC++06 or something, then there might be cause to wait on upgrading.
And the packages for the compiler should be in Debian stable.
You have a point with Debian, though; it does appear that the squeeze g++ package is still 4.4.5 (though sid and wheezy are already at 4.7.2 like Ubuntu).
That said, one can always just write the cleaner code using the new features and use conditional compiling to swap it for the uglier, older code if needed; i.e.:
Code: Select all
#if __cplusplus > 199711L
auto v = "C++11";
#else
string v = "C++03";
#endif
cout << v << endl;
-
- New member
- Posts: 3
- Joined: Wed Jan 28, 2015 12:52
- GitHub: gregorycu
- IRC: gregorycu
- In-game: gregorycu
Re: C++11
As time goes on, we should reflect where we are at with technologies. I think it's time to reassess where we are at with regards to C++11. I understand I am pulling up an old thread.
It has been 3 years since the standard was ratified, and while not many (any?) compilers boost full conformance, a lot of compilers have support for the most important features.
The new standard offers compelling features, and while it doesn't mean we can do anything new, it means we can code more easily. We get performance increases for free (due to moves), it is easier and faster to develop, we have a bigger library, and a benefit which is often overlooked: it is more fun!
While it seems stupid to list programming enjoyment as a benefit to using something, for an open source project, enjoying what you do is the best way to retain developers. Being able to be more expressive means more frequent, higher quality changes, with less chance of bugs (all else being equal).
I really cannot think of any legitimate reason NOT to use the new standard. While we may be decreasing the number of people who may be able to compile Minetest themselves, I don't think it's a percentage that is even worth worrying about. The new standards may be outside the understanding of some developers, but it should be a slow introduction with the most important features.
What do people think?
It has been 3 years since the standard was ratified, and while not many (any?) compilers boost full conformance, a lot of compilers have support for the most important features.
The new standard offers compelling features, and while it doesn't mean we can do anything new, it means we can code more easily. We get performance increases for free (due to moves), it is easier and faster to develop, we have a bigger library, and a benefit which is often overlooked: it is more fun!
While it seems stupid to list programming enjoyment as a benefit to using something, for an open source project, enjoying what you do is the best way to retain developers. Being able to be more expressive means more frequent, higher quality changes, with less chance of bugs (all else being equal).
I really cannot think of any legitimate reason NOT to use the new standard. While we may be decreasing the number of people who may be able to compile Minetest themselves, I don't think it's a percentage that is even worth worrying about. The new standards may be outside the understanding of some developers, but it should be a slow introduction with the most important features.
What do people think?
-
- Member
- Posts: 106
- Joined: Tue Jan 01, 2013 18:47
- GitHub: hdastwb
- IRC: hdastwb
- In-game: hdastwb
- Location: United States
Re: C++11
You haven't found the github discussion on this yet, have you?
https://github.com/minetest/minetest/pu ... t-15932423
I really doubt they'll ever upgrade, since they seem to have some rather strong opinions on the subject. However, Freeminer has been using C++11 for a while now:
http://freeminer.org/
https://github.com/minetest/minetest/pu ... t-15932423
I really doubt they'll ever upgrade, since they seem to have some rather strong opinions on the subject. However, Freeminer has been using C++11 for a while now:
http://freeminer.org/
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: C++11
Thanks for pointing to this, even when I don't like C++11.
My OS supports C++11 only in a strange way, see this freeminer issue
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: C++11
I think it's wrong. 100% (or darn close to) of the people running servers compile minetest themselves.gregorycu wrote:I really cannot think of any legitimate reason NOT to use the new standard. While we may be decreasing the number of people who may be able to compile Minetest themselves, I don't think it's a percentage that is even worth worrying about. The new standards may be outside the understanding of some developers, but it should be a slow introduction with the most important features.
What do people think?
If you think that 100% of the people running servers is not a percentage to worry about then that's a concern. Personally I'd rather worry about it.
The new features of C++11 are certainly not outside the understanding of any core developer.
The upgrade to C++11 should occur when all supported OSs and compilers support C++11. This is not the case at the moment. We should (and will?) support all LTS Linux versions.
This has nothing to do with the understanding of core developers (and, to be honest, your suggestion that core developers cannot understand the new standard is nothing short of offensive).
Those are the legititimate reasons. Trying to say "wahhh, nobody compiles minetest themselves" and "wahhhh, the developers cannot understand the changes to the standard" is complete and utter rubbish. These "reasons" you give for supporting c++11 are not legitimate reasons.
Re: C++11
I have stated on IRC that we should start using the commonly supported parts of C++11 this year. Now I stated it here too.
Not doing so is unproductive. C++11 is a much more tolerable language than C++03.
I have been using the reasonable parts of C++11 for two years in other projects now, including one that compiles for Windows using MinGW and based on what I've seen, implementations are perfectly solid by now.
One of the most important blockers for the adoption of C++11 in Minetest was Debian stable's default compiler support. It's now there and is not a problem anymore. (Since the release of wheezy on January 10th, 2015 or something? Not sure, but it's there anyway.)
Long discussion today: http://irc.minetest.ru/minetest-dev/201 ... #i_4135238
End result: Probably at Debian 8 release. Windows will be a slight problem; prepare for that.
Not doing so is unproductive. C++11 is a much more tolerable language than C++03.
I have been using the reasonable parts of C++11 for two years in other projects now, including one that compiles for Windows using MinGW and based on what I've seen, implementations are perfectly solid by now.
One of the most important blockers for the adoption of C++11 in Minetest was Debian stable's default compiler support. It's now there and is not a problem anymore. (Since the release of wheezy on January 10th, 2015 or something? Not sure, but it's there anyway.)
Long discussion today: http://irc.minetest.ru/minetest-dev/201 ... #i_4135238
End result: Probably at Debian 8 release. Windows will be a slight problem; prepare for that.
- Pitriss
- Member
- Posts: 254
- Joined: Mon Aug 05, 2013 17:09
- GitHub: Pitriss
- IRC: pitriss
- In-game: pitriss
- Location: Czech republic, Bohumin
Re: C++11
Note: Debian squeeze LTS will have EOL at February 2016, so servers can still have this version. As I understood it, there will be no way how to compile MT server on it when it will contain any C++11 code.
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.
-
- New member
- Posts: 3
- Joined: Wed Jan 28, 2015 12:52
- GitHub: gregorycu
- IRC: gregorycu
- In-game: gregorycu
Re: C++11
Feel free to be offended, that is your right. It's a right you exercise freely and with reckless abandon, and I wouldn't want you to change.and, to be honest, your suggestion that core developers cannot understand the new standard is nothing short of offensive
I said that the new standards may be outside the understanding of some developers. What you decided to interpret it as that I said: "No core developer would be able to understand the new standard." I don't expect every core developer to be exposed to the new standard, I know many C++ developers who haven't even looked at it.
I'm getting rather sick and tired of your patronizing comments, implying I'm a baby (or at least I think that is what you're doing). I don't actually understand what value you think that this adds to the discussion, and it's a bit of a shame that a contributor thinks a constructive conversation should have this sort of material.
Re: C++11
You see? Freeminer is not a worthless piece of garbage; it too has real potential. Too bad nobody ever, ever plays on its servers though.hdastwb wrote:You haven't found the github discussion on this yet, have you?
https://github.com/minetest/minetest/pu ... t-15932423
I really doubt they'll ever upgrade, since they seem to have some rather strong opinions on the subject. However, Freeminer has been using C++11 for a while now:
http://freeminer.org/
[BitChute: https://www.bitchute.com/channel/fCcBQxrYQjNX/] [Rumble: https://rumble.com/user/HPoorHMagentaHChildH]
- HeroOfTheWinds
- Member
- Posts: 470
- Joined: Wed Apr 23, 2014 23:16
- GitHub: HeroOfTheWinds
- IRC: WindHero
- Location: Hawaii
Re: C++11
Not sure how much say I have in this, but here goes.
I personally agree with celeron55. It's been how long since C++ 11 was ratified, so why not take advantages of whatever benefits it can bring? No one is forced to use the new features it brings either. I use C++ 11 for all my coding, but I haven't looked at what changes it brings because I haven't had to use them yet. Only once have I worked with set templates, and that was just for a healthy dose of extra credit points in a college class. But in that one use, I saw many possible benefits, especially as I found the code slightly easier to understand in C++11 than in C++03. Wouldn't newer standards also mean newer security too?
@Inocudom: Yes, Freeminer has potential. But until it brings back mapgen Voxel Manip, not that interested.
I personally agree with celeron55. It's been how long since C++ 11 was ratified, so why not take advantages of whatever benefits it can bring? No one is forced to use the new features it brings either. I use C++ 11 for all my coding, but I haven't looked at what changes it brings because I haven't had to use them yet. Only once have I worked with set templates, and that was just for a healthy dose of extra credit points in a college class. But in that one use, I saw many possible benefits, especially as I found the code slightly easier to understand in C++11 than in C++03. Wouldn't newer standards also mean newer security too?
@Inocudom: Yes, Freeminer has potential. But until it brings back mapgen Voxel Manip, not that interested.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: C++11
Freeminer has potential because it uses C++11? What low standards.
I'm for it as long as less than 5 in 1000 users are lost through no compiler support.
I'm for it as long as less than 5 in 1000 users are lost through no compiler support.
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: C++11
@Ruben:
But to be OT: I agree completely with the second part of you post. I'd hate to be one of those people. (Fortunately, I have to update my kernel and completely redo my nix-box, so I'd just include that anyway with the installation)
Spoiler
No. That is functioning under the assumption that Ino has only stated that FM only has changed to C++11. There are many other changes, and he is trying to emphasize FM as much as possible. True, though. Those would be rather low standards, AND he should have said something else in that post to be clear.
But to be OT: I agree completely with the second part of you post. I'd hate to be one of those people. (Fortunately, I have to update my kernel and completely redo my nix-box, so I'd just include that anyway with the installation)
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: C++11
I think that might take some years. C++03 has all features we needed in this game.rubenwardy wrote:Freeminer has potential because it uses C++11? What low standards.
I'm for it as long as less than 5 in 1000 users are lost through no compiler support.
It's necessary to update when there's no other way but currently, I can't see any troubles.
Yes, I'm one of those 5 (or more) in 1000 and I would like to play Minetest as long as possible without getting a new OS.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
-
- Developer
- Posts: 131
- Joined: Sat Feb 07, 2015 17:16
- GitHub: nerzhul
- IRC: nrzkt
- In-game: nrz
- Location: France
- Contact:
Re: C++11
We must keep the compat with old compilers like Debian Squeeze, but if we need to do a break, maybe 0.5 or 0.6 can do this. 0.5 do the network rework, maybe we can think about C++11 ?
std::mutex, std::regex, that's two functions i need to use to replace our current working but obsolete implementation for mutexes. Having a portable representation for regex will be great too.
std::mutex, std::regex, that's two functions i need to use to replace our current working but obsolete implementation for mutexes. Having a portable representation for regex will be great too.
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: C++11
I think not until 0.6 series. This give plenty of time to look for other solutions.
- hoodedice
- Member
- Posts: 1374
- Joined: Sat Jul 06, 2013 06:33
- GitHub: hoodedice
- IRC: hoodedice
- In-game: hoodedice
- Location: world
- Contact:
Re: C++11
I am not a developer, but I must highlight that 0AD, another open source game has switched to C++11
http://play0ad.com/new-release-0-a-d-al ... #more-3962
http://play0ad.com/new-release-0-a-d-al ... #more-3962
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
Who is online
Users browsing this forum: No registered users and 0 guests