From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Generators/coroutines in future Ada? Date: Wed, 12 Jul 2017 00:35:16 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Wed, 12 Jul 2017 05:35:17 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="817"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:47368 Date: 2017-07-12T00:35:16-05:00 List-Id: "Victor Porton" wrote in message news:ok3meg$fg6$1@gioia.aioe.org... > Dmitry A. Kazakov wrote: > .... >>> A task is a perfect abstraction for a thread of control that maintains >>> its own execution state! >> >> Except that no control is required. >> >> I don't understand what is wrong with: >> >> type Stateful is limited private; >> function Generate (X : not null access Stateful) return Things; > > The thing "wrong" with this, is that it is sometimes hard to implement > Generate(). In Python this can be done in an easier way by using > generators > (Python's "yield" keywords). The thing "wrong" with this is that it forces sequential execution. A Python generator is by its nature a serial bottleneck (indeed, when this was discussed on the ARG list, that was suggested as an advantage!!! of the Python approach). The coming problem with "classic" programming languages like Ada is that they don't map well to architectures with a lot of parallelism. The more constructs that require sequential execution, the worse that Ada programs will perform. With that in mind, it is hard to imagine why anyone would want to invest the hundreds or even thousands of hours required for a new language version on still more sequential constructs. Especially constructs that by their nature require sequential execution. Randy.