Making C better (by borrowing from C++)

A

Antoninus Twink

No matter how honest you think you are, there are always going to be
people who suspect your motives.

Indeed there are. After all, you and your sycophantic cronies will
probably still be posting to this group on the day the ship finally goes
down, and as your implacable and irrational hostility to Jacob has only
kept burning ever brighter over several years now, there seems little
chance that you'll ever give him a fair chance and stop "suspecting his
motives".
 
F

Flash Gordon

jacob navia wrote, On 26/12/07 15:40:
Eric Sosman wrote:
[snip]
Finally, operator overloading is by no means the only fad you
promote. Your exact words were "many things that are necessary in
a modern software development environment," with no limitation on
or characterization of all these so-called "necessities."

I have published a document that contains my proposal in a very
detailed way. I can send it to you, but the
core of them is

o operator overloading
o references
o generic functions

OK, so you want to add three things I don't have any use for in my work
in C and none of the things that would make my life easier.
You do not want to discuss with any objectivity. Of course
the suggestions *I* do are the ones *I* consider right!

I explained all of them and why they are needed.

Others have explained why they are not needed or could be considered
undesirable.
They are needed for numerical calculations. The problem is that
not everyone does that.

Not everyone does floating point arithmetic either.
Fixed point numbers ARE needed in machines where there is no floating
point hardware. Problem, not everyone has that environment.

OK, so you don't understand a lot of the reasons for fixed point
arithmetic. I would find it useful on high end Windows, Linux and AIX
servers.
Decimal floating point numbers ARE needed for doing exact
accounting calculations. Problem, not everyone is doing that.

The solution I propose would solve ALL those problems with
a SINGLE change.

No it would not. With your solution I would have to implement 1db
numbers, 2db numbers, 3dp numbers, 4dp numbers and 5dp numbers, all the
operations between those in all combinations and all combinations with
the existing numbers. Then I would have to hope the compiler was
intelligent enough to do something sensible. Not to mention the output
code. For decimal floating point I would have to resort to assembler,
since nothing I did would be likely to make use of the HW support for
decimal floating point.

All in all, built in support by the compiler is by far the preferable
solution.
Use standard notation (+ - * or / ) to add, subtact multiply or
divide new kinds of numbers Eric, that's what I am saying again and
again.

You get that if it is implemented as part of the compiler, and that way
the numeric types and all the interesting rules only have to be
implemented by the compiler writers and not by the application developers.
 
C

CBFalconer

jacob said:
Since Microsoft got that technical report with its safe library,
all standard functions like fopen printf, etc provoke a warning.

You seem incapable of telling MS FUD from fact. The C library is
NOT deprecated. Try reading the C standard.
 
U

user923005

GCC is proprietary It has a license just like MS, Borland and others.

Compiler wars are just like OS wars (or your garden-variety wars with
machine guns).
They are started for some reason that nobody can recall.
They expend plenty of resources and get lots of people angry, even
though they don't remember why they are mad.
In the end, when we count the bodies, we usually find that the ones
who 'expended the most' "won".

There is no such thing as free software, it's a myth[*]. However,
there is always a tool to do the job. Sometimes it costs money and
sometimes it does not.

[*] The time and labor used to create the software cost someone
something, even for public domain software. Anything with a value has
a price. Whether or not it every comes out of my pocket is another
thing. And most software (*anything not explicitly public domain*)
has a license that says how you can or cannot use it. Restrictions
are a kind of cost. At any rate, I see no reason to quibble about
it. I don't really mind Jacob touting his compiler. It's not like
he's spamming the group. I do think that he is deliberately thick and
likes to start arguments. But I am guilty of that from time to time
as well.

IMO-YMMV
 
R

Richard Heathfield

Keith Thompson said:
The Free Software Foundation holds the copyright (try "gcc --version").

That just gives the version number; it doesn't mention copyright or
ownership (which need not be the same thing).

But surely this is off-topic.

The whole thread is off-topic. :)
 
K

Keith Thompson

Chris Hills said:
Fair enough.

BTW What is "the book" called? Come on it's Christmas and I have
asked directly so give it a plug. Your book gets mentioned every now
and again so you may as well give the full information for those who
don't know.

Since Richard is being modest, it's "C Unleashed"; amazon.com shows
several new and used copies available, at prices ranging from $20 to
$120 (yoiks!).
 
C

CBFalconer

Richard said:
Chris Hills said:
.... snip ...


I don't know about you, but I think every single question deserves
the best possible answer. If the question is about ISO C, the
chances are very high that the best answer you'll get anywhere on
Usenet can be found right here in comp.lang.c - but if the question
is about something else, the chances are very high that you'll get
a better answer in a group where the question is topical. Platform-
specific questions get better answers elsenet.

I am glad you have answered most of CHs points, and I don't have
to. However, I should mention that use of standard C constructs
will generally result in more reliability and integrity than will
reliance on single vendor sourceless systems.
 
H

Harald van Dijk

Keith Thompson said:

That just gives the version number; it doesn't mention copyright or
ownership (which need not be the same thing).

This is the output of gcc --version for one installation I use:

2.95.3

This is the output of gcc --version for another installation I use:

gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
 
K

Kenny McCormack

jacob navia said:


Well, I can certainly accept that, at least as a possibility. But quite
seriously, you would do better to let other people recommend lcc-win32 for
you, rather than do it yourself.

A strong recommendation of/for sock-puppetry, from an experienced hand.

Good show, old man!
 
C

CBFalconer

Charlton said:
Malcolm McLean said:
I've got very strong views on car use. However I may not
set up my own referendum, [...]

Gordon Brown, however, can call a referendum, because he is man
in charge of the government. If it came out against supermarkets
with car parks, the case for closing them down would be
overwhelming.

The point is you have to have legitimate authority to make laws.

Governments derive their powers from the consent of the governed.
We had a discussion about this, and found that the majority of the
people who cared enough to state an opinion preferred limiting the
discussion here to portable standard C, as defined by C99, C89, or
K&R.

What is so hard to understand about that?

Not much, to most. However there is a small and noisy group here
who seem to feel that topicality is strictly defined by their urges
at any moment. I believe the psychiatrists etc. have a name for
that type of group.
 
C

CBFalconer

Chris said:
.... snip ...


The problem is that the vast majority who would have voted have
long since been chased off by the Language Taliban

Please document the precise method of so 'chasing off'. I will
immediately put it to use.
 
K

Keith Thompson

Chris Hills said:
The problem is that the vast majority who would have voted have long
since been chased off by the Language Taliban

Chris, I've usually found you to be a sensible person. You disappoint
me. Will you *please* stop using that deeply offensive term? I've
always been willing to discuss things with you; I'd truly hate for
that to end. (And yes, given the context, I presume that it's
directed at me and others.)

Now that I've made it clear that the term "Taliban" offends me, I'm
sure the trolls will use it at every opportunity. I expect better of
you.
 
C

CBFalconer

jacob said:
Keith Thompson wrote:
.... snip ...


It does. I have implemented the complex numbers with it, and
the qfloat extension.

How does it operate on machines with 1's complement and sign
magnitude numeric expression? What about machines with 9 bit
chars, or with 16 bit integers?

Note that I am not even asking about generalization to the extent
permitted by the C standard.
 
C

CBFalconer

Richard said:
Keith Thompson said:



If he means user-defined operator overloading (which he has not made
clear), he is correct. But operators are overloaded routinely within C.
Even the humble + operator has many meanings; not only does it have a
variable number of operands, but the types of those operands are by no
means fixed, so we have "+ that adds two int types; + that adds an int
to a double; + that adds two doubles; + that adds a pointer and an
int", and so on. And don't get me started on * ! :)

I don't recognize that last operator.
 
E

Eric Sosman

Richard said:
[...]
The whole thread is off-topic. :)

Well, no: Masood asked why C doesn't have "neat features"
of C++, which seems topical enough.[*] Unfortunately, he asked
his question in a deliberately offensive way, and the thread
frayed almost immediately despite a few attempts at answers.

[*] "Why can't a woman
Be more like a man?"
-- H. Higgins
 
B

Ben Pfaff

jacob navia said:
I could also argue that RH exploits this group commercially
since the fact of him being the guru here promotes his book and
he earns money with it.

I have never seen Richard Heathfield promote his book here.
Every time it's come up, to the best of my recollection, it's
been someone else who brought it up.
 
R

Richard

Mark McIntyre said:
Which part of "we had a vote on this idea, and disagreed with it" is hard
for you to understand?

The truthful bit? As in there is no truthful bit.
 
R

Richard

Ian Collins said:
You had your chance, now you have to put up with the result. That's the
way democracy tends to work.

He, and others, do not have to put up with anything you seem obsessed
with foisting on them. Others can post or reply to whatever C related
questions they see fit.
 
B

Ben Pfaff

CBFalconer said:
You seem incapable of telling MS FUD from fact. The C library is
NOT deprecated. Try reading the C standard.

It's a matter of point of view. Microsoft can consider the C
library, or portions of it, deprecated if they want to, and it
seems that they do. The question is really whether the C
standards committee considers it deprecated. The answer is, I
presume, "no".
 
C

CBFalconer

Richard said:
Keith Thompson said:
.... snip ...

That just gives the version number; it doesn't mention copyright
or ownership (which need not be the same thing).

Quoted to avoid line wrap:
[1] c:\c\hashlib>gcc --version
gcc.exe (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 

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
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top