X-Received: by 10.43.75.198 with SMTP id zb6mr4093744icb.22.1396068975718; Fri, 28 Mar 2014 21:56:15 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!ur14no108302igb.0!news-out.google.com!du2ni17107qab.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Ivan Godard Newsgroups: comp.compilers Subject: Re: catch and throw, was Is multi-level function return possible? Date: Fri, 28 Mar 2014 21:32:46 -0700 Organization: A noiseless patient Spider Lines: 26 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-082@comp.compilers> References: <14-03-065@comp.compilers> <14-03-068@comp.compilers> <14-03-070@comp.compilers> <14-03-076@comp.compilers> <14-03-077@comp.compilers> <14-03-080@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 X-Trace: miucha.iecc.com 1396068975 18753 2001:470:1f07:1126:0:676f:7373:6970 (29 Mar 2014 04:56:15 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 29 Mar 2014 04:56:15 +0000 (UTC) Keywords: architecture, errors Posted-Date: 29 Mar 2014 00:56:15 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Xref: csiph.com comp.compilers:1204 On 3/28/2014 7:47 PM, Kaz Kylheku wrote: > On 2014-03-29, Ivan Godard wrote: >> Useful or no, the ability to resume requires retaining the illusion of >> sequential execution. You have no idea how expensive, in power and >> performance, that illusion is. And it's flat-out impossible on wide >> issue machine such as VLIWs. > > I suspect you're may be thinking about resuming the exact instruction with the > exact machine state where some exception occured. > > That's not even necessarily the best, most useful way to resume. In machine terms, you are describing throw/catch, not resume. It happens that your catch does a programming-language-level resume, as opposed to a hardware resume. However, programming languages consume zero power; my note was about machines, which unfortunately do a bit worse :-) Even in your throw/catch, it is extremely difficult to provide a consistent model of side-effects that have, or have not, happened at resumption. Of course, the language level (which runs infinitely fast) can say that the program state is memoized at try and restored at catch. That's not a recommended practice on finite machines though.