public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Please support Coroutines TS in C++
@ 2017-08-15 13:29 Ramón García
  2017-08-19 15:49 ` Ramón García
  0 siblings, 1 reply; 10+ messages in thread
From: Ramón García @ 2017-08-15 13:29 UTC (permalink / raw)
  To: gcc

Hello,

Please consider supporting the Coroutines TS in GNU C++.

It is really important to make asynchronous programming usable.

Modern programs should be scalable to use the performance of multicore
processors. Stackless coroutines allow the programmer to scale to
millions of asynchronous requests. But without the primitives in the
Concurrency TS, chaining the result of an asynchronous computation to
the next step, one must program a chain of callbacks. It becomes
quickly unusable.

The promise/future, as specified in the concurrency TS, (that is, with
the function future::then for chaining a callback to the completion of
the future) make asynchronous programming somewhat more usable.
Unfortunately, almost no C++ library shipped supports future with
then.

This is an excellent explanation of the Coroutines TS:

https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction

Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
TS. Please consider it.

I saw that someone started an attempt at implementing it:
https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-08-15 13:29 Please support Coroutines TS in C++ Ramón García
@ 2017-08-19 15:49 ` Ramón García
  2017-08-20  8:52   ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Ramón García @ 2017-08-19 15:49 UTC (permalink / raw)
  To: gcc

ping.

On Tue, Aug 15, 2017 at 2:21 PM, Ramón García <ramon.garcia.f@gmail.com> wrote:
> Hello,
>
> Please consider supporting the Coroutines TS in GNU C++.
>
> It is really important to make asynchronous programming usable.
>
> Modern programs should be scalable to use the performance of multicore
> processors. Stackless coroutines allow the programmer to scale to
> millions of asynchronous requests. But without the primitives in the
> Concurrency TS, chaining the result of an asynchronous computation to
> the next step, one must program a chain of callbacks. It becomes
> quickly unusable.
>
> The promise/future, as specified in the concurrency TS, (that is, with
> the function future::then for chaining a callback to the completion of
> the future) make asynchronous programming somewhat more usable.
> Unfortunately, almost no C++ library shipped supports future with
> then.
>
> This is an excellent explanation of the Coroutines TS:
>
> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>
> Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
> TS. Please consider it.
>
> I saw that someone started an attempt at implementing it:
> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
> were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-08-19 15:49 ` Ramón García
@ 2017-08-20  8:52   ` Jonathan Wakely
  2017-08-31 11:31     ` Ramón García
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2017-08-20  8:52 UTC (permalink / raw)
  To: Ramón García; +Cc: gcc

See the thread on gcc-help:
https://gcc.gnu.org/ml/gcc-help/2017-08/msg00045.html



On 19 August 2017 at 14:09, Ramón García <ramon.garcia.f@gmail.com> wrote:
> ping.
>
> On Tue, Aug 15, 2017 at 2:21 PM, Ramón García <ramon.garcia.f@gmail.com> wrote:
>> Hello,
>>
>> Please consider supporting the Coroutines TS in GNU C++.
>>
>> It is really important to make asynchronous programming usable.
>>
>> Modern programs should be scalable to use the performance of multicore
>> processors. Stackless coroutines allow the programmer to scale to
>> millions of asynchronous requests. But without the primitives in the
>> Concurrency TS, chaining the result of an asynchronous computation to
>> the next step, one must program a chain of callbacks. It becomes
>> quickly unusable.
>>
>> The promise/future, as specified in the concurrency TS, (that is, with
>> the function future::then for chaining a callback to the completion of
>> the future) make asynchronous programming somewhat more usable.
>> Unfortunately, almost no C++ library shipped supports future with
>> then.
>>
>> This is an excellent explanation of the Coroutines TS:
>>
>> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>>
>> Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
>> TS. Please consider it.
>>
>> I saw that someone started an attempt at implementing it:
>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
>> were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-08-20  8:52   ` Jonathan Wakely
@ 2017-08-31 11:31     ` Ramón García
  2017-10-16 12:28       ` Ramón García
  0 siblings, 1 reply; 10+ messages in thread
From: Ramón García @ 2017-08-31 11:31 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc

(repeated, forgot to reply to mailing list)

Xi Ruoyao misses completely the point!

The amount of error prone boilerplate code, that the programmer would
have to write, is huge. See examples in the excellent presentation
"C++ coroutines: a negative overhead abstraction"
https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
Video: https://www.youtube.com/watch?v=_fu0gx-xseY

What one can have with a coroutine library, are stackfull coroutines.
But they are not really useful. Not very scalable. The simplification
of programming has a high cost.

With stackless coroutines, one can combine the simplicity of
sequential programming, with the scalability and efficiency of
asynchronous programming.

Did you ever read Linux kernel code? There is a lot of hand written
code that tries to achieve a sequence of actions using chained
callbacks:

void A()
{
  a1();
  when event E1 happens, run B
}

void B()
{
  b1();
  when event E2 happends, run C
}

void C()
{
 c1()
}

with Coroutines TS this is turned into

void A()
{
  a1();
  co_await E1;
  b1();
  co_await E2;
  c1();
}

but have the same efficiency and scalability of asynchronous code.

On Sat, Aug 19, 2017 at 5:49 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> See the thread on gcc-help:
> https://gcc.gnu.org/ml/gcc-help/2017-08/msg00045.html
>
>
>
> On 19 August 2017 at 14:09, Ramón García <ramon.garcia.f@gmail.com> wrote:
>> ping.
>>
>> On Tue, Aug 15, 2017 at 2:21 PM, Ramón García <ramon.garcia.f@gmail.com> wrote:
>>> Hello,
>>>
>>> Please consider supporting the Coroutines TS in GNU C++.
>>>
>>> It is really important to make asynchronous programming usable.
>>>
>>> Modern programs should be scalable to use the performance of multicore
>>> processors. Stackless coroutines allow the programmer to scale to
>>> millions of asynchronous requests. But without the primitives in the
>>> Concurrency TS, chaining the result of an asynchronous computation to
>>> the next step, one must program a chain of callbacks. It becomes
>>> quickly unusable.
>>>
>>> The promise/future, as specified in the concurrency TS, (that is, with
>>> the function future::then for chaining a callback to the completion of
>>> the future) make asynchronous programming somewhat more usable.
>>> Unfortunately, almost no C++ library shipped supports future with
>>> then.
>>>
>>> This is an excellent explanation of the Coroutines TS:
>>>
>>> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>>>
>>> Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
>>> TS. Please consider it.
>>>
>>> I saw that someone started an attempt at implementing it:
>>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
>>> were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-08-31 11:31     ` Ramón García
@ 2017-10-16 12:28       ` Ramón García
  2017-10-17  8:03         ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Ramón García @ 2017-10-16 12:28 UTC (permalink / raw)
  Cc: gcc

ping

On Thu, Aug 31, 2017 at 11:22 AM, Ramón García <ramon.garcia.f@gmail.com> wrote:
> (repeated, forgot to reply to mailing list)
>
> Xi Ruoyao misses completely the point!
>
> The amount of error prone boilerplate code, that the programmer would
> have to write, is huge. See examples in the excellent presentation
> "C++ coroutines: a negative overhead abstraction"
> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
> Video: https://www.youtube.com/watch?v=_fu0gx-xseY
>
> What one can have with a coroutine library, are stackfull coroutines.
> But they are not really useful. Not very scalable. The simplification
> of programming has a high cost.
>
> With stackless coroutines, one can combine the simplicity of
> sequential programming, with the scalability and efficiency of
> asynchronous programming.
>
> Did you ever read Linux kernel code? There is a lot of hand written
> code that tries to achieve a sequence of actions using chained
> callbacks:
>
> void A()
> {
>   a1();
>   when event E1 happens, run B
> }
>
> void B()
> {
>   b1();
>   when event E2 happends, run C
> }
>
> void C()
> {
>  c1()
> }
>
> with Coroutines TS this is turned into
>
> void A()
> {
>   a1();
>   co_await E1;
>   b1();
>   co_await E2;
>   c1();
> }
>
> but have the same efficiency and scalability of asynchronous code.
>
> On Sat, Aug 19, 2017 at 5:49 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> See the thread on gcc-help:
>> https://gcc.gnu.org/ml/gcc-help/2017-08/msg00045.html
>>
>>
>>
>> On 19 August 2017 at 14:09, Ramón García <ramon.garcia.f@gmail.com> wrote:
>>> ping.
>>>
>>> On Tue, Aug 15, 2017 at 2:21 PM, Ramón García <ramon.garcia.f@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> Please consider supporting the Coroutines TS in GNU C++.
>>>>
>>>> It is really important to make asynchronous programming usable.
>>>>
>>>> Modern programs should be scalable to use the performance of multicore
>>>> processors. Stackless coroutines allow the programmer to scale to
>>>> millions of asynchronous requests. But without the primitives in the
>>>> Concurrency TS, chaining the result of an asynchronous computation to
>>>> the next step, one must program a chain of callbacks. It becomes
>>>> quickly unusable.
>>>>
>>>> The promise/future, as specified in the concurrency TS, (that is, with
>>>> the function future::then for chaining a callback to the completion of
>>>> the future) make asynchronous programming somewhat more usable.
>>>> Unfortunately, almost no C++ library shipped supports future with
>>>> then.
>>>>
>>>> This is an excellent explanation of the Coroutines TS:
>>>>
>>>> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>>>>
>>>> Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
>>>> TS. Please consider it.
>>>>
>>>> I saw that someone started an attempt at implementing it:
>>>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
>>>> were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-10-16 12:28       ` Ramón García
@ 2017-10-17  8:03         ` Jonathan Wakely
  2017-10-17 15:23           ` Nathan Sidwell
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2017-10-17  8:03 UTC (permalink / raw)
  To: Ramón García; +Cc: gcc

On 16 October 2017 at 08:25, Ramón García wrote:
> ping

As previously stated, nobody is working on it.

GCC is Free Software, so if you really need ths feature you are free
to add it yourself.


>
> On Thu, Aug 31, 2017 at 11:22 AM, Ramón García <ramon.garcia.f@gmail.com> wrote:
>> (repeated, forgot to reply to mailing list)
>>
>> Xi Ruoyao misses completely the point!
>>
>> The amount of error prone boilerplate code, that the programmer would
>> have to write, is huge. See examples in the excellent presentation
>> "C++ coroutines: a negative overhead abstraction"
>> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>> Video: https://www.youtube.com/watch?v=_fu0gx-xseY
>>
>> What one can have with a coroutine library, are stackfull coroutines.
>> But they are not really useful. Not very scalable. The simplification
>> of programming has a high cost.
>>
>> With stackless coroutines, one can combine the simplicity of
>> sequential programming, with the scalability and efficiency of
>> asynchronous programming.
>>
>> Did you ever read Linux kernel code? There is a lot of hand written
>> code that tries to achieve a sequence of actions using chained
>> callbacks:
>>
>> void A()
>> {
>>   a1();
>>   when event E1 happens, run B
>> }
>>
>> void B()
>> {
>>   b1();
>>   when event E2 happends, run C
>> }
>>
>> void C()
>> {
>>  c1()
>> }
>>
>> with Coroutines TS this is turned into
>>
>> void A()
>> {
>>   a1();
>>   co_await E1;
>>   b1();
>>   co_await E2;
>>   c1();
>> }
>>
>> but have the same efficiency and scalability of asynchronous code.
>>
>> On Sat, Aug 19, 2017 at 5:49 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>> See the thread on gcc-help:
>>> https://gcc.gnu.org/ml/gcc-help/2017-08/msg00045.html
>>>
>>>
>>>
>>> On 19 August 2017 at 14:09, Ramón García <ramon.garcia.f@gmail.com> wrote:
>>>> ping.
>>>>
>>>> On Tue, Aug 15, 2017 at 2:21 PM, Ramón García <ramon.garcia.f@gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> Please consider supporting the Coroutines TS in GNU C++.
>>>>>
>>>>> It is really important to make asynchronous programming usable.
>>>>>
>>>>> Modern programs should be scalable to use the performance of multicore
>>>>> processors. Stackless coroutines allow the programmer to scale to
>>>>> millions of asynchronous requests. But without the primitives in the
>>>>> Concurrency TS, chaining the result of an asynchronous computation to
>>>>> the next step, one must program a chain of callbacks. It becomes
>>>>> quickly unusable.
>>>>>
>>>>> The promise/future, as specified in the concurrency TS, (that is, with
>>>>> the function future::then for chaining a callback to the completion of
>>>>> the future) make asynchronous programming somewhat more usable.
>>>>> Unfortunately, almost no C++ library shipped supports future with
>>>>> then.
>>>>>
>>>>> This is an excellent explanation of the Coroutines TS:
>>>>>
>>>>> https://www.slideshare.net/SergeyPlatonov/gor-nishanov-c-coroutines-a-negative-overhead-abstraction
>>>>>
>>>>> Both Visual C++ 2017 and CLANG (SVN version) support the Coroutines
>>>>> TS. Please consider it.
>>>>>
>>>>> I saw that someone started an attempt at implementing it:
>>>>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00435.html but there
>>>>> were no replies.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-10-17  8:03         ` Jonathan Wakely
@ 2017-10-17 15:23           ` Nathan Sidwell
  2017-10-17 21:14             ` David Brown
  2018-01-06 10:07             ` Jeffrey Walton
  0 siblings, 2 replies; 10+ messages in thread
From: Nathan Sidwell @ 2017-10-17 15:23 UTC (permalink / raw)
  To: Jonathan Wakely, Ramón García; +Cc: gcc

On 10/16/2017 07:06 AM, Jonathan Wakely wrote:
> On 16 October 2017 at 08:25, Ramón García wrote:
>> ping
> 
> As previously stated, nobody is working on it.

Not because nobody cares, but because of lack of time against higher 
priority things.

nathan

-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-10-17 15:23           ` Nathan Sidwell
@ 2017-10-17 21:14             ` David Brown
  2018-01-06 10:07             ` Jeffrey Walton
  1 sibling, 0 replies; 10+ messages in thread
From: David Brown @ 2017-10-17 21:14 UTC (permalink / raw)
  To: Nathan Sidwell, Jonathan Wakely, Ramón García; +Cc: gcc

On 17/10/17 00:19, Nathan Sidwell wrote:
> On 10/16/2017 07:06 AM, Jonathan Wakely wrote:
>> On 16 October 2017 at 08:25, Ramón García wrote:
>>> ping
>>
>> As previously stated, nobody is working on it.
> 
> Not because nobody cares, but because of lack of time against higher
> priority things.
> 

Out of curiosity, is there a publicly available summary of the features
being prioritised and actively developed?  There is a wiki page and a
development plan:

<https://gcc.gnu.org/wiki/DevelopmentSchedule>
<https://gcc.gnu.org/develop.html>

This has some (planned) timing information, but not planned features.

There is the list of development branches at
<https://gcc.gnu.org/svn.html#devbranches>, but it is not easy to guess
from that what features can be expected in the near future.

I could see from that page that you are working on C++ Modules, which is
very nice (and, IMHO, a higher priority than Coroutines).

I realise it is very difficult to be sure of what features will be ready
and working, and that the gcc developers have more than enough on their
"things to do" lists.  It must be particularly challenging when the
target is a moving, such as for proposed future C++ features like modules.

But if there is such a list of features under current development, I am
sure it would be of interest to users and of help to other developers.

And then I could see when to expect C++ metaclasses :-)




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2017-10-17 15:23           ` Nathan Sidwell
  2017-10-17 21:14             ` David Brown
@ 2018-01-06 10:07             ` Jeffrey Walton
  2018-01-06 12:52               ` Jonathan Wakely
  1 sibling, 1 reply; 10+ messages in thread
From: Jeffrey Walton @ 2018-01-06 10:07 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc

On Mon, Oct 16, 2017 at 6:19 PM, Nathan Sidwell <nathan@acm.org> wrote:
> On 10/16/2017 07:06 AM, Jonathan Wakely wrote:
>>
>> On 16 October 2017 at 08:25, Ramón García wrote:
>>>
>>> ping
>>
>>
>> As previously stated, nobody is working on it.
>
>
> Not because nobody cares, but because of lack of time against higher
> priority things.

Related, it looks like C++20 might offer them. Also see
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf.

Jeff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Please support Coroutines TS in C++
  2018-01-06 10:07             ` Jeffrey Walton
@ 2018-01-06 12:52               ` Jonathan Wakely
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Wakely @ 2018-01-06 12:52 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: Nathan Sidwell, gcc

On 6 January 2018 at 10:07, Jeffrey Walton wrote:
> Related, it looks like C++20 might offer them. Also see

That's not decided yet.

> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf.

Yes, that's the TS that people are asking to be supported.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-01-06 12:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-15 13:29 Please support Coroutines TS in C++ Ramón García
2017-08-19 15:49 ` Ramón García
2017-08-20  8:52   ` Jonathan Wakely
2017-08-31 11:31     ` Ramón García
2017-10-16 12:28       ` Ramón García
2017-10-17  8:03         ` Jonathan Wakely
2017-10-17 15:23           ` Nathan Sidwell
2017-10-17 21:14             ` David Brown
2018-01-06 10:07             ` Jeffrey Walton
2018-01-06 12:52               ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).