From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c65,37e683828bae12e2,start X-Google-Attributes: gidf8c65,public X-Google-Thread: 1014db,37e683828bae12e2,start X-Google-Attributes: gid1014db,public X-Google-Thread: 1008e3,37e683828bae12e2,start X-Google-Attributes: gid1008e3,public X-Google-Thread: 1164f8,b0b9a5eaad4ab6eb X-Google-Attributes: gid1164f8,public X-Google-Thread: 109fba,37e683828bae12e2,start X-Google-Attributes: gid109fba,public From: billm@cygnus.com (Bill Moyer) Subject: Re: [++] Tight coding Date: 1998/03/01 Message-ID: <6dbgjv$lg$1@andros.cygnus.com>#1/1 X-Deja-AN: 329673005 References: <6csl81$rb9@news-rocq.inria.fr> <34F3B7C5.5FD1@earthlink.net> <34F49435.B6307838@hda.hydro.com> Organization: Subtle, but there Newsgroups: comp.sys.dec,comp.lang.c++,comp.lang.c,comp.lang.modula2,comp.lang.modula3 Sean Burke wrote: > >Sean> system is so popular today. Perhaps our code will in turn be >Sean> described as "lean-n-mean" by those who follow us. But don't >Sean> bet on it. In the Mac world, the term "byte-squeaking pinheadery" >Sean> has been applied to some of the brilliant coding that enabled >Sean> the original MacOS to run in 128K. I occasionally wonder if (or when) software will become suf- ficiently massive and complex that system performance will be dominated by the frequency and time it takes to recover from application (or system) crashes. If this happened, upgrading to faster hardware would not effectively improve productivity. There have already been some halfhearted attempts to solve the problems of increasing program complexity by application of object-oriented techniques, but the more I see the object oriented style fail to live up to its promises, the more I think that techniques discarded in the past for being slow, inconvenient, or impractical (memory segmentation with bounds checking, strong type checking, compile-time proving of code correctness, et al) might be worth another look. Run-time bounds checking increases the processor power required to run applications, but applications which are bottlenecked by crash frequency (eg, programmer error in pointer arithmetic) would benefit from it. Use of memory segmentation would help pin- point which data structure (or catagory of data structures) was corrupted, and allow recovery routines to perhaps repair the damage and continue with application execution; this would be a big improvement over "Segmentation Fault; core dumped" or "GPF 314159". Relying on run-time capture and correction of errors bugs the hell out of me. Like most programmers, I believe that programming errors should be caught and corrected before a product ships, but the current practice of shipping products with dozens or hundreds of *known* bugs does not show any sign of changing. Changing the programming language to improve compile-time verification of code correctness (with richer and stronger types, richer static semantic sets, and compile-time range tracking) would locate more bugs at compile-time, reduce the number of bugs in a "finished" product, and reduce the overall time spent in the development cycle (because finding run-time bugs is a much longer and more laborious task than finding them at compile-time). It has been proven that the imperative languages are not provable (ie, for any turing-complete imper- ative language, a program can be written which is not provably correct or incorrect), but it is still possible to improve provability by degrees, and we can do a lot better than C. -- Bill Moyer