9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] NUMA
Date: Sun, 17 Jul 2011 01:44:11 -0700	[thread overview]
Message-ID: <20110717084411.95552B827@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Sun, 17 Jul 2011 09:38:47 +0200." <20110717073847.GB539@polynum.com>

On Sun, 17 Jul 2011 09:38:47 +0200 tlaronde@polynum.com  wrote:
>
> Furthermore, I don't know for others, but I prefer correctness over
> speed. I mean, if a program is proved to be correct (and very few are),
> complex acrobatics from the compiler, namely in the "optimization" area,
> able to wreak havoc all the code assumptions, is something I don't buy.

C's design has compromises in favor of speed to correctness
(mainly by underspecifying, by leaving more things upto the
implementor). So if you really prefer correctness over speed,
you should be using Scheme, ML or Haskell etc but not C!

But note that for what C is used for, this compromise is fine
(IMHO). But this has made its semantics significantly more
complex.  C doesn't even have a well defined formal semantics
(there have been attempts to define denotational semantics for
C subsets but never the whole language, and even such a subset
specification is significantly larger than, say, Scheme's).

Also note that the ISA implementations these days are quite
complex (perhaps even more than your typical program).  We
don't see this complexty because it is all hidden behind a
relatively simple ISA.  But remember the FOOF bug? Usually the
vendor has a long errata list (typically only available on a
need to know basis and only under NDA!). And usually they
don't formally prove the implementation right; they just run
zillions of test vectors! I bet you would be scandalized if
you knew what they do :-)

> But how can one rely on a binary that is so mangled that the fact
> that you do not see it fail when testing does not prove it will
> yield a correct result? And, furthermore, that the code is so chewed
> that the proofs of correctness on the source level do not guarantee
> anything about the correctness of the compiled result?

Most all complex programs have bugs. gcc does, clang does, and
so does plan9 cc. The difference is in the degree of
bugginess. One uses the best tool available for a given job
and then learns to work around its problems.

The problem with C/C++ optimization is that these languages
are quite complex and it is not always easy to figure out the
correct equivalent operations under all conditions.  Contrast
that with Stalin which does whole program optimization of R4RS
Scheme programs and does it extremely well (but extremely
slowly!).

> My gut feeling is that the whole process is going too far, is too
> complex to be "maintenable" (to be hold in one hand), and that some
> marginal gains in specific cases are obtained by a general ruin if not
> of the certainty, at least of some confidence in correctness.

I seriously think you will be happier with Scheme!



  reply	other threads:[~2011-07-17  8:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 15:15 tlaronde
2011-07-15 20:21 ` tlaronde
2011-07-15 20:47   ` ron minnich
2011-07-15 22:59     ` Charles Forsyth
2011-07-16  8:02     ` tlaronde
2011-07-16 16:27       ` erik quanstrom
2011-07-16 18:06         ` tlaronde
2011-07-16 19:29           ` Ethan Grammatikidis
2011-07-16 19:54           ` erik quanstrom
2011-07-16 20:56             ` dexen deVries
2011-07-16 22:10               ` Charles Forsyth
2011-07-17  1:44                 ` erik quanstrom
2011-07-17  7:38                   ` tlaronde
2011-07-17  8:44                     ` Bakul Shah [this message]
2011-07-17 10:02                       ` tlaronde
2011-07-17 12:04                         ` dexen deVries
2011-07-17 15:24                       ` erik quanstrom
2011-07-17 15:28                         ` ron minnich
     [not found]                         ` <CAP6exYL2DJXbKfPZ8+D5uL=fRWKEyr8vY2OVc4NTO3wsFo=Unw@mail.gmail.c>
2011-07-17 15:32                           ` erik quanstrom
2011-07-17 17:16                         ` Bakul Shah
2011-07-17 17:21                           ` erik quanstrom
2011-07-17 15:51                     ` erik quanstrom
2011-07-17 16:12                       ` dexen deVries
2011-07-17 16:37                       ` tlaronde
2011-07-17 10:08               ` Ethan Grammatikidis
2011-07-17 14:50                 ` erik quanstrom
2011-07-17 17:01                   ` Ethan Grammatikidis
2011-07-17  3:39       ` Joel C. Salomon
2011-07-17  7:01         ` tlaronde
2011-07-17 15:05           ` Joel C. Salomon
2011-07-17 15:26           ` erik quanstrom
2011-07-17 15:52             ` ComeauAt9Fans@gmail.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110717084411.95552B827@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).