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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.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: OT: A bit of Sudoku Date: Fri, 6 Jun 2014 15:38:44 +0200 Organization: cbb software GmbH Message-ID: <1j5u8lwf88652.1crfbjqysx1zr$.dlg@40tude.net> References: <5365d3f0-43cc-47ef-989c-d47992c84c9f@googlegroups.com> <1l2x0kuk3kxqx$.1owim8xhlww7x.dlg@40tude.net> <53918830$0$6605$9b4e6d93@newsspool4.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: QTaafVZuunHujkJPndFR7g.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: news.eternal-september.org comp.lang.ada:20162 Date: 2014-06-06T15:38:44+02:00 List-Id: 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