Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Anonymous Newsgroups: comp.arch Subject: Re: Here is what i think of C and C++ Date: 27 Dec 2015 04:27:44 GMT Lines: 36 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net Tk4FfpavyuXVt0CKcfRBpAEdrc04B5jY41R2KWnLiwVJMriFEH Cancel-Lock: sha1:+0EuhDQEtfpdu3ClxvZvh8leuhk= sha1:9uLiHcNe+/qyKzz17uVlXqgCCCY= User-Agent: NewsTap/5.1.2 (iPad) Xref: csiph.com comp.arch:32170 Rick C. Hodgin wrote: > C and C++ offer freedoms that gain performance. It requires more > i-dotting and t-crossing, but will produce code that is often 2x (or more) > faster than Ada or other languages which impose such restrictions, Nope. See http://benchmarksgame.alioth.debian.org/u64q/ada.html > even if they are good implementations. Their strict type-checking > rules require CPU time to implement. My KDF9 emulator, in Ada 2012, runs about 2% faster with all checks disabled than it does with all checks enabled except in a small core set of routines. This is in part because the information-rich declarations of Ada allow the compiler to optimise away checks that it can deduce will always succeed. Also in part because many constructs are correct by construction and never need checks, e.g.: subtype index is m..n; -- m, n are variables a : array (index) of ..... for i in a'range loop a(i) := ...; end loop; A subscripting error in a(i) is simply impossible. The computer biz needs to seriously rethink its priorities. Getting the wrong answer faster is not a selling point any more. -- Bill Findlay