comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Lazy evaluation
Date: Fri, 19 Sep 2014 16:47:17 +0200
Date: 2014-09-19T16:47:17+02:00	[thread overview]
Message-ID: <11up8h3pwcwf$.1tmy4g7sb6csv$.dlg@40tude.net> (raw)
In-Reply-To: 85idneIsZeZHqYHJRVn_vwA@giganews.com

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


  reply	other threads:[~2014-09-19 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 19:15 Lazy evaluation Victor Porton
2014-09-19 13:51 ` Peter Chapin
2014-09-19 14:47   ` Dmitry A. Kazakov [this message]
2014-09-23 12:01     ` Victor Porton
2014-09-23 19:12       ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox