comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: OT: A bit  of Sudoku
Date: Fri, 6 Jun 2014 15:38:44 +0200
Date: 2014-06-06T15:38:44+02:00	[thread overview]
Message-ID: <1j5u8lwf88652.1crfbjqysx1zr$.dlg@40tude.net> (raw)
In-Reply-To: 53918830$0$6605$9b4e6d93@newsspool4.arcor-online.net

On Fri, 06 Jun 2014 11:21:51 +0200, Georg Bauhaus wrote:

> On 06/06/14 09:51, Dmitry A. Kazakov wrote:
>> Or reduce overhead
> 
> Will there be less overhead if programmers can announce
> some controlled jump, back to where "it" came from?

A model of error handling based on returning back to the point of raising
was in PL/1 (on-error stuff). It proved to be wrong, because the whole idea
of exception is that you cannot go back because you cannot and will not
handle it where you detected it.

Regarding overhead, it is stack winding which takes most time. This
overhead is necessary per the logic of exception processing = leaving all
contexts compromised by the unexpected/undefined/undesired state. You must
finish these contexts regardless exception propagation or if-then-goto.

And testing/checking state is sometimes far more expensive that handling
it. Which is why exceptions are often less overhead than doing looking
ahead for an unanticipated condition, like EOF. Or an extreme example:

   if Check_Syntax (Ada_Program) then
      Compile (Ada_Program);
   else
      Put_Line ("I won't compile that mess!");
   end if;

If you moving forward checking each step you made, you are much slower than
when walking normally.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2014-06-06 13:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 17:49 OT: A bit of Sudoku Mike H
2014-06-05 18:30 ` Adam Beneschan
2014-06-05 19:00   ` J-P. Rosen
2014-06-05 19:18     ` Jeffrey Carter
2014-06-05 19:43       ` J-P. Rosen
2014-06-05 20:05     ` Mike H
2014-06-05 23:12     ` Robert A Duff
2014-06-05 23:39       ` Adam Beneschan
2014-06-06  7:51         ` Dmitry A. Kazakov
2014-06-06  9:21           ` Georg Bauhaus
2014-06-06 13:38             ` Dmitry A. Kazakov [this message]
2014-06-06 15:47           ` Adam Beneschan
2014-06-06 17:09             ` Dmitry A. Kazakov
2014-06-07  6:03             ` J-P. Rosen
2014-06-06 14:13         ` Brad Moore
2014-06-13  0:21     ` Shark8
2014-06-13  6:30       ` J-P. Rosen
2014-06-13 10:10       ` Mike H
2014-06-13 12:37         ` Dmitry A. Kazakov
2014-06-13 15:47         ` Shark8
2014-06-05 20:03   ` Mike H
2014-06-05 20:40     ` Adam Beneschan
2014-06-06  9:10       ` Stefan.Lucks
2014-06-06 10:59         ` Mike H
2014-06-06 16:06         ` Adam Beneschan
replies disabled

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