Re: Pedants
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Sat, 21 Jun 2008 23:09:19 +0530
Richard wrote:
santosh <santosh.k83@xxxxxxxxx> writes:
Malcolm McLean wrote:
"Joachim Schmitz" <nospam.jojo@xxxxxxxxxxxxxxxxxx> wrote in message
n
Richard Heathfield wrote:However Jacob publishes only his binaries. I can't actually remember
Joachim Schmitz said:However: the criticism starts only when you publish
No, I meant "don't write any". Because if you write some code,
you'll want to write some more (programming is very more-ish), and
then you'll write even more, and sooner or later you'll get to the
point where you think you're pretty good, and then some day you'll
want to show someone your stuff. And then they'll criticise it.
And that would be just awful, right?
seeing any C source by him. He's not one of those people who, like
me, are constantly providing little snippetts.
However I recall him posting various minor snippets of code
occasionally, mainly from his standard library. In the past he used
to post code more often than he does these days.
Which leads us to a philosophical point. Can we tell the quality of
code purely from the binaries?
We must first define what we mean by "quality of code", and this is
not a simple job, as the difference between the source of various
versions of functionally identical programs is largely a subjective
matter, IMHO.
If the binary happens to do correctly all that it is specified to do
under reasonable conditions, then we can say that the binary
is "working", but we still can't say anything much about the source
from examining the machine code. We can attempt a decompilation, but
the resulting source is hardly likely to be better than travesty of
the original source.
Why do you insist on waffling on about the obvious Santosh? Clearly we
can not look at the source if only the binary is there.
Still examining the binary versions of program under a debugger and
under various "stress" conditions, and taking comparative
measurements
What comparative measurements? Comparative against what?
can enable is to state many objective statements about the machine
code. If the machine code for both the binaries was derived from the
same compiler under the same switches, then differences can be safely
attributed to the source from which it was compiled.
So, in less words "if it works its good". The binary testing will tell
you next to nothing about type safety assuming the numbers in the
tests fall into compatible ranges for example.
I would be interested to see what you think you are comparing against
here.
Take the case of two binary programs that are specified to do exactly
the same task and with identical interfaces. Further assume that both
were compiled by the same compiler program and with identical compiler
options (except for things like source file naming of course). We shall
also execute both the programs under as similar a condition as
possible.
Now if program A takes twice as long to perform some task as program B,
what does that suggest to us about their respective sources? If we
disassemble two functionally identical routines in both the programs
and we observe the following pseudo-assembler for program A:
LOAD r0, [BP + 8]
LOAD r1, 0
loop:
PUSH [r0 + r1]
CMP [SP], 0
JE ret
CALL _putchar
ADD SP, 1
INC r1
JUMP loop
ret:
ADD SP, 1
RET
and the following for program B:
PUSH stdout
PUSH [BP + 8]
CALL _fputs
ADD SP, 8
RET
What can you conclude about the source for the respective programs?
There are many other similar comparative measurements and examinations
of the binaries that can be done to suggest the possible nature of the
original source code, provided the conditions of translation and
execution were and are "similar enough."
.
- Follow-Ups:
- Re: Pedants
- From: Malcolm McLean
- Re: Pedants
- References:
- Pedants
- From: jacob navia
- Re: Pedants
- From: Ben Bacarisse
- Re: Pedants
- From: Joachim Schmitz
- Re: Pedants
- From: Richard Heathfield
- Re: Pedants
- From: Joachim Schmitz
- Re: Pedants
- From: Richard Heathfield
- Re: Pedants
- From: Joachim Schmitz
- Re: Pedants
- From: Malcolm McLean
- Re: Pedants
- From: santosh
- Re: Pedants
- From: Richard
- Pedants
- Prev by Date: Re: Why no generic function pointers?
- Next by Date: Re: Bit Padding and other questions
- Previous by thread: Re: Pedants
- Next by thread: Re: Pedants
- Index(es):
Relevant Pages
|