Update our C++ library to C++11 standard

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Update our C++ library to C++11 standard

Vladimir Ozerov
Igniters,

Over time we were very conservative about language levels for our libraries
to be able to target wider platforms. But it looks like some of them are
way too old, what doing more harm than good.

For C++ we still use C++03 standard, which 15 years old. C++11, C++15 and
C++17 were released since then. I propose to plan upgrade to C++11 version
at least. May be event C++15. Major improvements in C++11:

1) Standard threading model - we will be able to remove a lot
platform-dependent code (atomics, shared pointers, etc)
2) Rvalues - most probably we will be able to benefit from move semantics
in terms of both performance and cleaner API
3) Lambdas - this needs to be investigated, but may be we will be able to
integrate them into our compute API.

If agreed we should plan it to AI 3.0 release, since this is a breaking
change.

What do you think?

Vladimir.
Reply | Threaded
Open this post in threaded view
|

Re: Update our C++ library to C++11 standard

Igor Sapego-2
Vladimir,

I'd wish we could do that, but unfortunately, even VS 2017 does not
support all C++11 (and even C++03) features [1]. So, maybe we should
also speak about dropping support of old VS and moving to at least VS 2012.

You can find the benefits of this at [2]. For example, this will give us
native support of atomics, fences, threads and also better language
features,
that can help a lot when developing API and help finding bugs during
compilation.

If we will adopt the "limited C++11" approach, then I believe we will need
to
update our API to make it more modern and convenient for C++11 users.

But, unfortunately, this won't give us the complete support of C++11.

Something else we should also consider here, is that C++ community can be
very conservative, so some part of community could still be on C++03.

[1] -
https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance?view=vs-2017
[2] - https://msdn.microsoft.com/en-gb/library/hh567368.aspx

Best Regards,
Igor

On Mon, Nov 12, 2018 at 10:28 AM Vladimir Ozerov <[hidden email]>
wrote:

> Igniters,
>
> Over time we were very conservative about language levels for our libraries
> to be able to target wider platforms. But it looks like some of them are
> way too old, what doing more harm than good.
>
> For C++ we still use C++03 standard, which 15 years old. C++11, C++15 and
> C++17 were released since then. I propose to plan upgrade to C++11 version
> at least. May be event C++15. Major improvements in C++11:
>
> 1) Standard threading model - we will be able to remove a lot
> platform-dependent code (atomics, shared pointers, etc)
> 2) Rvalues - most probably we will be able to benefit from move semantics
> in terms of both performance and cleaner API
> 3) Lambdas - this needs to be investigated, but may be we will be able to
> integrate them into our compute API.
>
> If agreed we should plan it to AI 3.0 release, since this is a breaking
> change.
>
> What do you think?
>
> Vladimir.
>
Reply | Threaded
Open this post in threaded view
|

Re: Update our C++ library to C++11 standard

Igor Sapego-2
I've filed a ticket for this task [1].

[1] - https://issues.apache.org/jira/browse/IGNITE-10333

Best Regards,
Igor


On Mon, Nov 12, 2018 at 1:39 PM Igor Sapego <[hidden email]> wrote:

> Vladimir,
>
> I'd wish we could do that, but unfortunately, even VS 2017 does not
> support all C++11 (and even C++03) features [1]. So, maybe we should
> also speak about dropping support of old VS and moving to at least VS 2012.
>
> You can find the benefits of this at [2]. For example, this will give us
> native support of atomics, fences, threads and also better language
> features,
> that can help a lot when developing API and help finding bugs during
> compilation.
>
> If we will adopt the "limited C++11" approach, then I believe we will need
> to
> update our API to make it more modern and convenient for C++11 users.
>
> But, unfortunately, this won't give us the complete support of C++11.
>
> Something else we should also consider here, is that C++ community can be
> very conservative, so some part of community could still be on C++03.
>
> [1] -
> https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance?view=vs-2017
> [2] - https://msdn.microsoft.com/en-gb/library/hh567368.aspx
>
> Best Regards,
> Igor
>
> On Mon, Nov 12, 2018 at 10:28 AM Vladimir Ozerov <[hidden email]>
> wrote:
>
>> Igniters,
>>
>> Over time we were very conservative about language levels for our
>> libraries
>> to be able to target wider platforms. But it looks like some of them are
>> way too old, what doing more harm than good.
>>
>> For C++ we still use C++03 standard, which 15 years old. C++11, C++15 and
>> C++17 were released since then. I propose to plan upgrade to C++11 version
>> at least. May be event C++15. Major improvements in C++11:
>>
>> 1) Standard threading model - we will be able to remove a lot
>> platform-dependent code (atomics, shared pointers, etc)
>> 2) Rvalues - most probably we will be able to benefit from move semantics
>> in terms of both performance and cleaner API
>> 3) Lambdas - this needs to be investigated, but may be we will be able to
>> integrate them into our compute API.
>>
>> If agreed we should plan it to AI 3.0 release, since this is a breaking
>> change.
>>
>> What do you think?
>>
>> Vladimir.
>>
>