Python Front-end to GCC

M

Mark Janssen

OTOH why in particular would you want to initialise them with zeros? I
It's a useful debugging technique to initialize memory to distinctive values
that should never occur in real data.

If you're doing this, you're doing something wrong. Please give me
the hex value for NaN so I can initialize with my array.
 
M

Mark Janssen

OTOH why in particular would you want to initialise them with zeros? I
If you're doing this, you're doing something wrong. Please give me
the hex value for NaN so I can initialize with my array.

It is clear that you know as much about debugging as you do about objects
and message passing [...] can see why the
BDFL described you as an embarrassment, and if he didn't, he certainly
should have done.

Clearly the python list has been taken over by TheKooks. Notice he
did not respond to the request. Since we are talking about digital
computers (with digital memory), I'm really curious what the hex value
for NaN is to initialize my arrays....

All hail chairman Meow. Dismissed.
 
R

rusi

Clearly the python list has been taken over by TheKooks. Notice he
did not respond to the request. Since we are talking about digital
computers (with digital memory), I'm really curious what the hex value
for NaN is to initialize my arrays....

I dont see how thats any more relevant than:
Whats the hex value of the add instruction?

Presumably floating point numbers are used for FP operations
FP operations barf on nans
So a mis-initialized array in which a nan shows up can be easily caught

Yes nans are not one value but a class
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_math.html

but so what?
 
G

Grant Edwards

If you're doing this, you're doing something wrong.

Pardon me if I don't take your word for it.
Please give me the hex value for NaN so I can initialize with my
array.

Seriously? You haven't discovered google and wikepedia yet?

http://www.google.com/
http://en.wikipedia.org/

Assuming you're using IEEE-754, all 1's is a quiet NaN:

http://en.wikipedia.org/wiki/IEEE_floating_point
http://en.wikipedia.org/wiki/NaN

If you want a signaling NaN you've got to change one of the bits (see
the above links).

IIRC, the Pascal language required that using unintialized variables
caused an error. intializing FP values to a signalling NaN is a very
convenient way to do that.
 
M

Mark Janssen

I dont see how thats any more relevant than:
Whats the hex value of the add instruction?

You "don't see". That is correct. Btw, I believe the hex value for
the add instruction on the (8-bit) Intel 8088 is x0. Now what were
you saying?
 
R

rusi

You "don't see". That is correct. Btw, I believe the hex value for
the add instruction on the (8-bit) Intel 8088 is x0. Now what were
you saying?

There are a dozen different (hex values) for the add instruction -- depending on operand sizes/directions/immediate-operand/special-registers etc.

So just as there is one add instruction with many hex values
there is one nan as a concept with many different hex values.

Are you arguing for the sake of arguing?
If so lets at least agree on what you are arguing about!!
 
M

Mark Janssen

As for the hex value for Nan who really gives a toss? The whole point is
that you initialise to something that you do not expect to see. Do you not
have a text book that explains this concept?

No, I don't think there is a textbook that explains such a concept of
initializing memory to anything but 0 -- UNLESS you're from Stupid
University.

Thanks for providing fodder...

Mark Janssen, Ph.D.
Tacoma, WA
 
M

Mark Janssen

As for the hex value for Nan who really gives a toss? The whole point is
We've been discussing *DEBUGGING*.

Are you making it LOUD and *clear* that you don't know what you're
talking about?

Input: Yes/no

MarkJanssen
 
T

Tim Delaney

No, I don't think there is a textbook that explains such a concept of
initializing memory to anything but 0 -- UNLESS you're from Stupid
University.

Thanks for providing fodder...

I know I'm replying to a someone who has trolled many threads over multiple
years ... or as I'm now starting to suspect, possibly a bot, but I'll give
him (it?) this one chance to show the capability to read and learn.

http://en.wikipedia.org/wiki/Hexspeak

Search for 0xBAADF00D; 0xBADDCAFE; and (in particular) OxDEADBEEF. These
are historical examples of this technique used by major companies.

Tim Delaney
 
T

Tim Delaney

I can't see it being a bot on the grounds that a bot wouldn't be smart
enough to snip a URL that referred to itself as a quack.

My thought based on some of the responses is that they seem auto-generated,
then tweaked - so not a bot per-se, but verging on it.

But OTOH, it can also be explained away entirely by (as you previously
noted) the Dunning-Kruger effect, with the same uninformed responses
trotted out to everything. Not necessarily a troll as I injudiciously
claimed in my previous post (I'd just woken up after 4 hours sleep - my
apologies to the list).

Anyway, not going to get sucked into this bottomless hole.

Tim Delaney
 
M

Mark Janssen

But OTOH, it can also be explained away entirely by (as you previously
It was rusi who first mentioned this, I merely replied in my normal dead pan
way.

Slight aside, I spelt your surname incorrectly a few minutes ago whilst
replying elsewhere, I do apologise.

What is this? The circle-jerk list? I make some points on the last
couple of threads and you all get bent-out of shape, then gather
around each other as if you're all in a cancer ward....
 
M

Mark Janssen

(Offlist)

Mark, these conversations would go much more smoothly if you would make
direct statements about technical points. Your messages are usually
insinuating questions, or personal insults.

Yes, thank you. That is correct.
For example, you said:

Please give me the hex value for NaN so I can initialize with my array.

I think what you meant by this was: "I don't think there is a hex value that
represents NaN." Why not say that?

Why? Because I know there's not a hex value for NaN, otherwise it
would confuse the abstraction of what a computer is. Any hex digit
you could attempt to obscure would be translatable as a number, and
therefore a contradiction. Is that a good enough reason for ya?
Then we could talk about your claim.

How about we talk about my claim with facts instead of attempts at
creating reality a la NovusOrdoSeclorum?
You could even go so far as to admit that others might know things you
don't, and ask, "is there a hex value that represents NaN, I didn't realize
there was?"

How sweet. Do you like makeup?
We could have a discussion about the concepts involved. As it is, the
threads devolve into name calling, topic-changing non-sequiturs, and silly
sound effects. You seem to start with the assumption that you are right and
everyone else is wrong, and begin with snark.

I'm still waiting on the binary-digit lexer, Ned.
There really are people on the list who know a lot about software and
computer science, including the people you are currently calling
known-nothings.

I don't know if you are personally qualified for the latter, but agree
somewhat on the part of "software".
These things are true: There are hex values that represent NaNs.

Why don't you follow your own advice? Instead of "These things are
true:" Why don't you say "These things could be true" OR "*I*
believe that hex values could be used to represent NaN"?

Tell us, which hex value is used to represent NaN? (thoughts to self:
all-ones wouldn't make a very good magic number for finding errors,
so I wonder what Ned will dream up.... (btw: I'm not gay)). Note
that, just for the record, I was talking strictly about memory (RAM),
not variable assignments.
Non-Turing-complete languages can be compiled to C. ASTs don't have enough
information to compile to machine code.

Please tell us then, what IS enough information to compile to machine
code? ...rather than just saying that "AST's don't have enough
information to compile to machine code"
Data on punched cards can be
tokenized. All of these things are true.

*rolls eyes*
You seem to be a seeker of truth. Why not listen to others?

Yes, now listening....
 
C

Chris Angelico

You responded on-list to a private email that was even tagged as
off-list. Please be more careful and courteous.

Anyway, IEEE floating-point makes it pretty clear that any value that
sets the exponent to all-ones and the mantissa to anything other than
all-zeros is a NaN. So an all-ones hex pattern
(0xFFFFFFFFFFFFFFFF....) will flood the area with NaNs.

You really don't understand IEEE 754 here.

ChrisA
 
M

Mark Janssen

[Getting back to some old comments....]
Did you even read the paragraph you quoted above? The BNF specification
does NOT completely describe a language, it only defines its syntax.

Computer Science 301 (a.k.a. "educating the python brogrammers who've
been too long using interpreted languages"):

C source ("blah.c") is broken down into a linear sequence of tokens
fed into a parser. The BNF definition for C takes those tokens/syntax
and produces a lexical graph of the source -- its grammatical form.
This becomes an abstract syntax *tree* because there is a "main"
function (without which I don't believe you can call a language
formally "Turing Complete" because one doesn't know where to begin to
feed the machine (wait for it.... boom)). In any case, this *roots*
the abstract lexical graph and forms the basis for compiling into
machine code.
So
if the only thing you knew about C was its BNF, you could certainly not
write a C compiler. And neither could anyone else.

Well, now you're confusing everybody, because you're asking, in
essence: "what is the meaning of a symbol to a computer?", and since
there isn't one, then you should wonder: "how are you going to get it
to 'do the right thing?'" For that, you'll have to take Mark
Janssen's PHIL 444: "Epistemics of Quantity" (not offered from the
internet).

Now, please give credit to all the old-timers who paved the way for
all you to be partying in the easy-land of high-level languages like
Python. It's them who made the computer SCIENCE. You guys have been
so spoiled, you're taking it all for granted and confusing people with
all your claptrap about TYPES. The insane cannot tell that they're
insane. Remember that.
Fortunately for the
C community, the language specification included much more than a BNF
grammar. At a minimum, you have to specify both the syntax and the
semantics.

I will look forward to how you will give a semantic specification for
the C token "{": left bracket.

Apologies will be accepted on the list.

Mark J
 
J

John Nagle

No, I don't think there is a textbook that explains such a concept of
initializing memory to anything but 0 -- UNLESS you're from Stupid
University.

Thanks for providing fodder...

Mark Janssen, Ph.D.
Tacoma, WA

What a mess of a discussion.

First off, this is mostly a C/C++ issue, not a Python issue,
because Python generally doesn't let you see uninitialized memory.

Second, filling newly allocated memory with an illegal value
is a classic debugging technique. Visual C/C++ uses it
when you build in debug mode. Wikipedia has an explanation:

http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_debug_values

Microsoft Visual C++ uses 0xBAADF00D. In valgrind, there's
a "-malloc-fill" option, and you can specify a hex value.

There's a performance penalty for filling large areas of memory
so it's usually done in debug mode only, and is sometimes causes
programs with bugs to behave differently when built in debug
vs. release mode.

Sigh.

John Nagle
 
M

Mark Janssen

Apologies will be accepted on the list.

BTW, I can't resist pointing out that you guys are like a cup already
full of (black) coffee -- too full to allow the pure water of clarity
to enter.

(cf. Buddhism) .... .. (boom)

MarkJanssen
Tacoma, Washington
 
M

Mark Lawrence

BTW, I can't resist pointing out that you guys are like a cup already
full of (black) coffee -- too full to allow the pure water of clarity
to enter.

(cf. Buddhism) .... .. (boom)

MarkJanssen
Tacoma, Washington

I took a look at your sourceforge page yesterday. I found it extremely
sad that you'd clearly taken so many contaminated batches over so many
years. Seriously.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top