> 1. How much, and where, should we be using standard C++ library
> functionality in Mozilla code?

We've tuned tarray, nsthashtable, strings, etc. to meet our precise
needs, and the implementations are consistent across all platforms.
I can imagine things becoming quite messy we had three or four
different implementations of these classes (in the different stdlibs),
each with their own quirks, and if we couldn't change the
implementations to meet our needs.

I definitely think that some of our APIs could use some love, but it
seems unlikely to me that replacing a complex class like nsTArray with
std::vector would be a net win for us, as compared to simply improving
nsTArray's interface.  Even performing this experiment would be an
expensive endeavor.

By way of contrast, I think it's great that we're using simple
classes, functions, and types from stdlib, such as static_assert and
stdint.  The downside here is much smaller, since we don't have to
worry about the quirks of the different implementations, and since
there's nothing we might want to tune.

-Justin

On Wed, Jul 31, 2013 at 12:08 PM, Ehsan Akhgari <ehsan.akhg...@gmail.com> wrote:
> On 2013-07-31 1:41 PM, Joshua Cranmer 🐧 wrote:
>>
>> With all of that stated, the questions I want to pose to the community
>> at large are as follows:
>> 1. How much, and where, should we be using standard C++ library
>> functionality in Mozilla code?
>
>
> I'm not sure if it's easy to have this discussion in general without talking
> about a specific standard library feature.
>
>
>> 2. To what degree should our custom ADTs (like nsTArray) be
>> interoperable with the C++ standard library?
>
>
> I think some people would like to make the code more understandable to newer
> contributors, and some people would prefer to keep existing convention
> intact.
>
>
>> 3. How should we handle bridge support for standardized features not yet
>> universally-implemented?
>
>
> I think MFBT has been working fine so far.
>
>
>> 4. When should we prefer our own implementations to standard library
>> implementations?
>
>
> Usually doing our own implementation is faster, but there is a significant
> lag from contributing something upstream (if that's even possible) until
> that gets released in a toolchain that people use.  So perhaps we should do
> both in parallel when there is the option.
>
>
>> 5. To what degree should our platform-bridging libraries
>> (xpcom/mfbt/necko/nspr) use or align with the C++ standard library?
>
>
> This is also hard to talk about without having a concrete thing under
> consideration.
>
>
>> 6. Where support for an API we wish to use is not universal, what is the
>> preferred way to mock that support?
>
>
> MFBT, I believe.
>
> Cheers,
> Ehsan
>
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to