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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Lazy evaluation Date: Fri, 19 Sep 2014 16:47:17 +0200 Organization: cbb software GmbH Message-ID: <11up8h3pwcwf$.1tmy4g7sb6csv$.dlg@40tude.net> References: <85idneIsZeZHqYHJRVn_vwA@giganews.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ZB2Fb2q1fa4xpMpNKFqV6Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:189058 Date: 2014-09-19T16:47:17+02:00 List-Id: On Fri, 19 Sep 2014 09:51:21 -0400, Peter Chapin wrote: > On 2014-09-18 15:15, Victor Porton wrote: > >> Can we incorporate into Ada some kind of lazy evaluation (as in Haskell), >> without breaking backward compatibility? >> >> If yes, would this be much useful? > > Speaking in generalities lazy evaluation tends to make it difficult to > reason about the performance characteristics of a program. It is my > understand this is sometimes a problem for Haskell programs that have > significant performance requirements. Thus it appears that lazy > evaluation would be an anathema as far as Ada is concerned. Consider the problem of evaluation order: X : String := String'Input (File) & String'Input (File); -- Ill defined! Now, let "&" be lazy in the right argument: function "&" (Left : String; Right : lazy String) return String; In my opinion, it is not laziness which causes problems, but more the closures. If closures were limited in some reasonable (from Ada's POV) way, then laziness would be not an issue. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de