Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Fri, 21 Mar 2014 02:50:46 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 42 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-054@comp.compilers> References: <14-03-020@comp.compilers> <14-03-022@comp.compilers> <14-03-025@comp.compilers> <14-03-030@comp.compilers> <14-03-044@comp.compilers> <14-03-046@comp.compilers> <14-03-047@comp.compilers> <14-03-048@comp.compilers> <14-03-053@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1395376055 62636 2001:470:1f07:1126:0:676f:7373:6970 (21 Mar 2014 04:27:35 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 21 Mar 2014 04:27:35 +0000 (UTC) Keywords: history, design, comment Posted-Date: 21 Mar 2014 00:27:34 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1176 Andy Walker wrote: (snip, someone wrote) >> "Parameters have a run-time cost": So has access to non-local >> variables. (snip) > Not so much an argument as a philosophy. You can ask about the > usefulness of a feature from several viewpoints. Is it needed? Is it > something the users want? Is it something they should want, or would > want if only they knew about it? Is it something that would attract > new users or new applications? Is it consonant with the rest of the > language? Is it easy to parse and to generate code for? Is it easy > to explain? Is it efficient? And so on. You seem to be approaching > your question from the point of view of a compiler writer; I'm more > interested in writing programs. Writing programs is itself a very > personal activity depending on experience and context, so different > people may perfectly reasonably have very different attitudes to any > particular feature. The first language I knew with this feature is PL/I. As well as I understand it, the language was pretty well defined before anyone tried writing a compiler for it. They didn't ask many users, though attracting new users would have been important. Seems to me they didn't ask so much what was easy to parse (among other features, no reserved words) and, at least the way it looks, rarely considered how hard it might be to generate code for, or generate efficient code for. Many languages were defined at the same time as the first compiler was written, with that compiler defining the language. -- glen [PL/I was, as I understand it, defined largely by glomming together parts of Fortran and Cobol with some bits of Algol60. They assumed it would be possible to implement since all of the pieces were, although there turned out to be a lot of dark corners where things that seemed reasonable individually weren't so reasonable in combination. -John]