Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Epic Fail Date: Thu, 10 Apr 2014 19:03:03 -0400 Organization: Aioe.org NNTP Server Lines: 46 Message-ID: References: <2014Apr7.192923@mips.complang.tuwien.ac.at> <19597f37-fa23-478f-9a5f-b2aa66e89ae4@googlegroups.com> <2014Apr8.175427@mips.complang.tuwien.ac.at> <2014Apr9.181655@mips.complang.tuwien.ac.at> <64idnem648RzN9jOnZ2dnUVZ8iWdnZ2d@supernews.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:29514 On Thu, 10 Apr 2014 07:24:46 -0400, Todd Hughes wrote: > It's remarkable that most posters in c.l.f seem to understand what most > posters in c.l.c don't: C is more of a worldview and possibly a VM than > it is a language. That's a strange perspective, but an acceptable one. > It is no longer helpful to understand the hardware if you want to use C. Did anyone ever need to understand the hardware to use C? ... > C has its own abstract view of the hardware and to use C you have to > share that view, [...] C works best on the microprocessor model of computing hardware. Memory is contiguous, bytes are 8-bits, all pointers have a single size, integers and pointers are an integer multiple of the size of a byte, two's complement arithmetic, etc. Of course, C was implemented on a variety of hardware that didn't conform to that model, e.g., 16-bit bytes but 9-bit characters, differently sized pointers, no ability to access small integers as needed for characters, etc. These "other", mostly obsolete, mainframe/corporate platforms like Crays, DECs, Burroughs, IBMs, etc is what creates all the "undefined" behavior for C. C is superb for microprocessors where the useful behaviors are usually implemented. > The only safe and reasonable default is warning about anything that isn't > conforming. Everything of value in C is non-conforming. C was standardized for multiple different computing platforms with different architectures. Only 30% of C's code is truly portable, in the sense that the code performs exactly the same way on all hardware. Another 30% or so appears to be portable, because the same result can be implemented on most hardware, albeit differently. The rest is simply not portable. It has to be adjusted for different platforms. While the C language is almost entirely independent of the host, the C libraries aren't. Minimal C libraries need about twenty host specific functions. Rod Pemberton