You can propose to make a feature available or to ban a feature by sending anemail to chromium-dev. Ideally include a short blurb on what the feature is,and why you think it should or should not be allowed. Ideally, the list willarrive at some consensus and the wiki page will be updated to mention thatconsensus. If there's no consensus, src/styleguide/C++/OWNERS get to decide --for divisive features, we expect the decision to be to not use the feature yetand possibly discuss it again a few months later, when we have more experiencewith the language.
PK
The Google style guide recommendations are based on a different set of toolchains than we use in Chromium. For example, many C++11 library features are allowed in the Google style guide but are not supported in our toolchains. As a result, we can't simply use the same features.
There are also a number of features that will be considered in comparison to equivalent or overlapping functionality that we have in the Chromium tree (like base::Bind to pick a somewhat obvious one). We'll have to make decisions on these that will probably only apply to Chromium and not other repositories that have a different set of libraries available.
Does the same list of approved C++11 features apply to Blink as to
Chromium, or will those evolve separately? What about formatting rules
for new features (like lambda expressions)?
Where do you see Blink using move semantics today? My understanding is that it does not.
You can remove compiler guards for C++11 language features on the permissible list today. I'm pretty sure we do not have any guards for things like using >> in templates but if you know of any please send the review to me.
- James
Hi,I believe all (*) our toolchains are now in a state where they understand C++11language features.We won't want to use every single C++11 feature, just like we don't use everyavailable C++98 feature. Here's how it's going to work: There's a list ofC++11 features at http://chromium-cpp.appspot.com . At the moment, almost allof them are marked as "to be discussed". A few are already pre-approved.You can propose to make a feature available or to ban a feature by sending anemail to chromium-dev. Ideally include a short blurb on what the feature is,and why you think it should or should not be allowed. Ideally, the list willarrive at some consensus and the wiki page will be updated to mention thatconsensus. If there's no consensus, src/styleguide/C++/OWNERS get to decide --for divisive features, we expect the decision to be to not use the feature yetand possibly discuss it again a few months later, when we have more experiencewith the language.Factors for allowing or banning a feature include:* purely technical (for example, uniform initialization doesn't reallymake sense without std::initializer_list)
* the feature's complexity/convenience trade-off (for example, if you want toallow rvalue references, you should be able to make a convincing case thatmost chromium developers can explain the difference between std::move andstd::forward)So go ahead, propose your favorite feature :-) To get used to the process,it's probably best to start with a simple feature like lowercase final/override.Nico*: Some conditions apply: Targets that have build_glibc or build_newlib setto 1 don't work. The exhaustive list of these targets is currently gtest,liblouis, libjingle, modp_b64. It's all third-party code, and not much.ps: Thanks to all the folks who helped to make this happen: scottmg iskeeping us on a recent Visual Studio, dschuff and mseaborn got the naclIRT converted to use the pnacl compiler instead of an old gcc, torne andprimiano worked with Android build engineers to move the webviewbuild from an old gcc to a fairly new clang, pasko and fdegans are keepingchrome/android's gcc up-to-date, the chromeos compiler team is doing the samefor chromeos, and lots of people helped to move the linux build and thechrome/android and simplechrome chromeos host compilers to clang. Thanks alsoto hans for keeping our clang binaries up-to-date, the goma team for quicklyfixing various bugs triggered by all these changes, and to the clang and llvmcommunity for building a versatile compiler that supports modern languagefeatures while still working with the libstdc++ that ships on precise.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
Factors for allowing or banning a feature include:* purely technical (for example, uniform initialization doesn't reallymake sense without std::initializer_list)It's funny that you'll say so because it actually makes perfect sense - or at least one fairly limited form of it does:int x[5]{};is zero-initialized array from five alements. "()" works in constructors and with "new" but will not work here for obvious reason.
... it's IMPOSSIBLE to value-initialize objects in C++03 with default values (zeros for PODs): without () it's default constructor which does not initialize PODs and with () it's function declaration, not declaration of value-initialized object!
Unless I'm misunderstand what you're after:struct A { int i; }; // PODA a = {};int x[5] = {};Everything here would initialize to zero in C++03.
On Wednesday, September 24, 2014 9:11:53 AM UTC-7, khim wrote:... it's IMPOSSIBLE to value-initialize objects in C++03 with default values (zeros for PODs): without () it's default constructor which does not initialize PODs and with () it's function declaration, not declaration of value-initialized object!Basically this forms does not offer just a syntax sugar, it kind of plugs the hole in the C++98/03 design instead. But syntax is somewhat unintuitive and I'm not sure how often people actually need to zero-initialize non-trivial objects on stack thus I'm not sure if this feature is worth adding.
This would not only be simpler and faster than trying to discuss every single feature, it would make clear that, philosophically, our goal with C++11 is the same as our goal with all other aspects of our styleguide, namely to conform to the Google guide except in a few specific cases.
--
+1000 on std::forward<T>()
On Wed, Sep 24, 2014 at 11:58 AM, Alex Vakulenko <avaku...@chromium.org> wrote:+1000 on std::forward<T>()std::forward<> is a language feature, so I see no value in the rest of this post to chromium today. We don't have language support today.
- James
Hi,I believe all (*) our toolchains are now in a state where they understand C++11language features.We won't want to use every single C++11 feature, just like we don't use everyavailable C++98 feature. Here's how it's going to work: There's a list ofC++11 features at http://chromium-cpp.appspot.com . At the moment, almost allof them are marked as "to be discussed". A few are already pre-approved.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
On Tue, Sep 23, 2014 at 1:51 PM, Nico Weber <tha...@chromium.org> wrote:Hi,I believe all (*) our toolchains are now in a state where they understand C++11language features.We won't want to use every single C++11 feature, just like we don't use everyavailable C++98 feature. Here's how it's going to work: There's a list ofC++11 features at http://chromium-cpp.appspot.com . At the moment, almost allof them are marked as "to be discussed". A few are already pre-approved.clang-format appears to still prefer "> >" over ">>" (AFAICT). Who should I talk to to get this fixed?
On Tue, Sep 23, 2014 at 1:51 PM, Nico Weber <tha...@chromium.org> wrote:Hi,I believe all (*) our toolchains are now in a state where they understand C++11language features.We won't want to use every single C++11 feature, just like we don't use everyavailable C++98 feature. Here's how it's going to work: There's a list ofC++11 features at http://chromium-cpp.appspot.com . At the moment, almost allof them are marked as "to be discussed". A few are already pre-approved.clang-format appears to still prefer "> >" over ">>" (AFAICT). Who should I talk to to get this fixed?
Given the excitement and refactorings people are excitedly starting -- when did the toolchains become compatible?In particular, if we're building a Chrome Stable 37/38/whatever on an older toolchain, is it worth lagging any of these rollouts to make back merges not-harder?
On Sep 24, 2014 6:21 PM, "Dana Jansens" <dan...@chromium.org> wrote:
>
> On Wed, Sep 24, 2014 at 9:19 PM, Viet-Trung Luu <viettr...@chromium.org> wrote:
>>
>> On Tue, Sep 23, 2014 at 1:51 PM, Nico Weber <tha...@chromium.org> wrote:
>>>
>>> Hi,
>>>
>>> I believe all (*) our toolchains are now in a state where they understand C++11
>>> language features.
>>>
>>> We won't want to use every single C++11 feature, just like we don't use every
>>> available C++98 feature. Here's how it's going to work: There's a list of
>>> C++11 features at http://chromium-cpp.appspot.com . At the moment, almost all
>>> of them are marked as "to be discussed". A few are already pre-approved.
>>
>>
>> clang-format appears to still prefer "> >" over ">>" (AFAICT). Who should I talk to to get this fixed?
>
>
> File an internal bug against clang-format.
>
http://llvm.org/bugs/enter_bug.cgi
Or a public one. I'm an email, not a cop.
There are at least two proposals where we're considering rewriting the world to a new way (enum class over enum, using over typedef). If the new way is strictly preferred to the old way, are we going to add support to the clang plugin to warn about doing it the old way? If we don't, I fear that new instances will surely be introduced.
(The third proposal is nullptr over NULL, but removing the definition of NULL would fix that quickly.)
On Sep 25, 2014 12:17 AM, "Nico Weber" <tha...@chromium.org> wrote:
>
> On Wed, Sep 24, 2014 at 9:06 PM, Avi Drissman <a...@chromium.org> wrote:
>>
>> There are at least two proposals where we're considering rewriting the world to a new way (enum class over enum, using over typedef). If the new way is strictly preferred to the old way, are we going to add support to the clang plugin to warn about doing it the old way? If we don't, I fear that new instances will surely be introduced.
>
>
> No, the clang plugin is for things that are likely bugs, not for stylistic things.
We could add presubmit warnings for these. They both sound like things a regex could easily find.
Our long Chromium nightmare of > > is over... Our clang-format works; our great mailing list of "C++11 Feature Proposal"s will continue. Here the people rule.
Yeah, move semantics was added for the performance sake, I do not have the numbers but the impact can be quite significant: for instance move semantics is enabled for WTF::Strings (via RefPtr) and those are used everywhere.
BTW here is an example of move semantics introduction to KURL which was made quite recently https://codereview.chromium.org/297223005
BR,
Mikhail
________________________________________
From: blin...@chromium.org [blin...@chromium.org]
Sent: Thursday, September 25, 2014 11:55 AM
To: James Robinson
Cc: Pozdnyakov, Mikhail; blink-dev; Chromium-dev; Nico Weber
Subject: Re: [blink-dev] C++11 feature rollout
I thought this was done in WTF and the Length classes to reduce copying. What's the performance impact of removing it?
On Wednesday, September 24, 2014, James Robinson <jam...@chromium.org<mailto:jame...@chromium.org>> wrote:
Looking at the history those were added in the WebKit days (pre-Blink) and are not compatible with the current Chromium or Blink style guides. This should not be considered blanket approval for these features and we should probably just delete them until we can allow this functionality across the board.
One use of rvalue refs in WTF::OwnPtr<> is really about trying to emulate the behavior of = delete for constructors. We should replace that one with = delete.
- James
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org<mailto:blink-dev+unsub...@chromium.org>.
C++11 Standard Library features are completely banned for now.
Do we have any plans to enable move semantics support for std containers?
On Thursday, September 25, 2014 at 7:38:47 PM UTC+10, Mikhail Pozdnyakov wrote:
Yeah, move semantics was added for the performance sake, I do not have the numbers but the impact can be quite significant: for instance move semantics is enabled for WTF::Strings (via RefPtr) and those are used everywhere.
BTW here is an example of move semantics introduction to KURL which was made quite recently https://codereview.chromium.org/297223005
BR,
Mikhail
________________________________________
From: blin...@chromium.org [blin...@chromium.org]
Sent: Thursday, September 25, 2014 11:55 AM
To: James Robinson
Cc: Pozdnyakov, Mikhail; blink-dev; Chromium-dev; Nico Weber
Subject: Re: [blink-dev] C++11 feature rollout
I thought this was done in WTF and the Length classes to reduce copying. What's the performance impact of removing it?
On Wednesday, September 24, 2014, James Robinson <jam...@chromium.org<mailto:jam...@chromium.org>> wrote:
Looking at the history those were added in the WebKit days (pre-Blink) and are not compatible with the current Chromium or Blink style guides. This should not be considered blanket approval for these features and we should probably just delete them until we can allow this functionality across the board.
One use of rvalue refs in WTF::OwnPtr<> is really about trying to emulate the behavior of = delete for constructors. We should replace that one with = delete.
- James
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org<mailto:blink-dev+...@chromium.org>.
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.