Author Topic: c++11  (Read 15564 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: c++11
« Reply #15 on: October 15, 2013, 11:15:33 am »
Ok, a little bit offtopic, but I hope C::B will be going in right direction :)
But why would you care as a user of C::B about C++11?
C++11 in C::B will make a difference to you, only if you plan to contribute to C::B, is this the case?
If it is will forcing C++98 stop you from doing so?

Move semantics won't make a big difference to wxString, because it is reference counted, at least in 2.8.
wx 3.0 has some C++11 support.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: c++11
« Reply #16 on: October 15, 2013, 12:49:11 pm »
I'd be the first to use C++11, not so much for the alleged performance advantages of move semantics (which are pretty much non-existent in reality, and in most cases people get them wrong and actually make code slower), but for the easier syntax.

However, we have at least one developer who is still using GCC version 3.3 or 3.4 (I forgot which) as well as some users with some exotic embedded architectures. Therefore it's unlikely that this is going to happen any time soon.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: c++11
« Reply #17 on: October 15, 2013, 12:53:23 pm »
...who is still using GCC version 3.3 or 3.4...
We require GCC 4.0 (C++ TR1) for quite awhile, so I doubt you're correct.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: c++11
« Reply #18 on: October 15, 2013, 01:26:16 pm »
if people prefer to use linux distros which have a very conservative approach on updates of packages, then that is a fair choice.
However such things should not block improvements and innovation.

When we continue this conservative approach our-self, we will be stuck to old C++ for another decade.

Several of those linux distros are for server purposes, less for personal development.

So there is a balance somewhere, and for sure no aggressive dictatorship claiming to revert any commit with c++11, that's just an opinion like any other, a valid opinion at this time.

But any day the strategy can change, and should not be blocked by some Redhat or Centos, then those just use old packages, or are no longer usable as a development platform. And as said more modern C++ compilers can be installed on them, even if they are not the system compiler they can be used to build CB, the only problem might be ABI non compatible on for example wxwidgets.

Don't forget that the majority of our users don't build Cb them selves(they don't even use linux). so building CB is cb developers and plug-in developers territory.
If we as developers obstruct innovation, we should reconsider, since that is no good, as C++IDE we should guide and lead the way :
- by supporting the C++1 features for the users (like code completion)
- by giving example in our own code, through using it

Today is not switching time yet, but conservative distros (for good reasons in their use cases) should not hold us back.


So please all, be open minded, there is no black or white, it it some shade of gray ;-)

As for linux, most 'modern' distros will be within the next couple of months be on 4.8.1, which now even has the library regex support ready. Which are nice forecasts, bumping the "majority" of the linux users on a C++11 compliant compiler. At that time the balance might need to be re-evaluated.

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: c++11
« Reply #19 on: October 15, 2013, 02:03:29 pm »
But why would you care as a user of C::B about C++11?
C++11 in C::B will make a difference to you, only if you plan to contribute to C::B, is this the case?
If it is will forcing C++98 stop you from doing so?

It doesn't stop me, but it would make my plugin sources less clear and so worse maintainable.

Move semantics won't make a big difference to wxString, because it is reference counted, at least in 2.8.
wx 3.0 has some C++11 support.

Refcounting and copy-on-write isn't thread-safe and many plugins use threads (my SemanticHighlight plugin for example).
wxString in wx 2.9 uses std::(w)string under the hood which is not refcounted and has move semantic implemented in C++11.
This is more clean IMHO (and move semantics works well in case of moving/copying large parts of sources).

Anyway, let me repeat: these are wxWidgets problems, not C::B, but C::B might benefit from this a lot.

Also killerbot is right: if you wish to have modern C++ IDE, you have to support writing C++11 code.
Of course this is completely different from C++11 as C::B implementation language :)

As for support for writing C++11 code, bear in mind that Clang has full support for C++11 now, so code completion and static analysis (to build source tree for example) are almost for free.
« Last Edit: October 15, 2013, 02:18:37 pm by mistar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: c++11
« Reply #20 on: October 15, 2013, 02:54:39 pm »
killerbot:
You're so wrong, but I have no time to argue on every statement where you're wrong. :)
Just keep in mind that if you want to develop commercial/binary software on Linux CentOS is best or only choice for a distro and some people are stuck on all Linux distros because their target software works only there.

mistar: No one stops you from using C++11 in your plugins, but if you want to contribute them to the main repo then they have to be C++98 (GCC >= 4.0)

p.s. I don't intend to spend any more time on this topic.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: c++11
« Reply #21 on: October 15, 2013, 05:30:15 pm »
When we continue this conservative approach our-self, we will be stuck to old C++ for another decade.
[...]
So there is a balance somewhere, and for sure no aggressive dictatorship claiming to revert any commit with c++11, that's just an opinion like any other, a valid opinion at this time.


...who is still using GCC version 3.3 or 3.4...
We require GCC 4.0 (C++ TR1) for quite awhile, so I doubt you're correct.

I'm wrong about the exact GCC version, my apologies, but I'm correct about the matter as such. If I may refresh your memory (emphasis added by me):

But more important, the build is broken. Thomas, you have introduced C++11 code, which will not compile unless we start using that option. I want to avoid the discussion at this moment, I would like to open it after the next release ;-)
No need to discuss it (again), I'll revert any c++11 commit because I use gcc4.1.2 at work ( Centos 5.8 ), which is non c++11 enabled. C++11 will be allowed when we have a redhat release with gcc4.7!
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."