X-Received: by 10.58.23.137 with SMTP id m9mr4324717vef.13.1389384035429; Fri, 10 Jan 2014 12:00:35 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!6no2777264qao.1!news-out.google.com!l9ni13732qay.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: Implementation dependent behaviour (WAS: Re: Programming language and IDE design) Date: Fri, 10 Jan 2014 09:11:04 -0800 Organization: A noiseless patient Spider Lines: 26 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-01-010@comp.compilers> References: <13-11-025@comp.compilers> <14-01-007@comp.compilers> <14-01-008@comp.compilers> NNTP-Posting-Host: lnews.iecc.com Mime-Version: 1.0 X-Trace: leila.iecc.com 1389384034 58584 64.57.183.51 (10 Jan 2014 20:00:34 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 10 Jan 2014 20:00:34 +0000 (UTC) Keywords: arithmetic, standards Posted-Date: 10 Jan 2014 15:00:33 EST 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:1077 On 1/8/2014 10:21 AM, Kaz Kylheku wrote: > On 2014-01-08, Ivan Godard wrote: >> On 11/20/2013 2:29 AM, Martin Ward wrote: >> >> >> >>> (2) CPU designers may choose to implement that behaviour in hardware >>> on the next iteration of the CPU. Now the programs run fast on *all* >>> CPUs. >>> >>> Everybody wins. >> >> I am such a CPU designer. We faced the "undefined" issue in our Mill >> family of general-purpose CPUs (ootbcomp.com). Not only are languages >> under-constraining, they are also sometimes over-constraining: signed >> integer overflow is undefined in C but required to wrap in Java. > > It's only undefined on paper. In reality, if you don't make it wrap in C like > in Java, unknown numbers of C programs will break, and not all of them doing it > by accident. Or one may say that unknown numbers of C programs are already broken. And the reality is that the program cannot even in practice depend on wrapping; see http://www.airs.com/blog/archives/120, or just Google "signed integer overflow in C".