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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Generators/coroutines in future Ada? Date: Wed, 12 Jul 2017 09:27:28 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:47374 Date: 2017-07-12T09:27:28+02:00 List-Id: On 12/07/2017 07:35, Randy Brukardt wrote: > "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. Some algorithms, protocols in particular, are sufficiently easier and clearer to implement in a sequential manner: fetch data, wait, react, repeat. Ada tasks is an ideal abstraction for this except for being too heavy weight for certain applications. > The coming problem with "classic" programming languages like Ada is that > they don't map well to architectures with a lot of parallelism. Rather the opposite. Parallel architectures do not map well to any reasonable programming language. The thing is hard no matter how you approach it. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de