Wednesday, March 17, 2010

comp.lang.c - 25 new messages in 3 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* Has thought been given given to a cleaned up C? Possibly called C+. - 13
messages, 8 authors
http://groups.google.com/group/comp.lang.c/t/5954dc70a43f9f8e?hl=en
* Letter sent to Apress with concerns about Peter Seebach's online behavior -
11 messages, 6 authors
http://groups.google.com/group/comp.lang.c/t/482b38643777da3c?hl=en
* Does GCC optimize variadic functions to death? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/00b2bccdde28fde4?hl=en

==============================================================================
TOPIC: Has thought been given given to a cleaned up C? Possibly called C+.
http://groups.google.com/group/comp.lang.c/t/5954dc70a43f9f8e?hl=en
==============================================================================

== 1 of 13 ==
Date: Wed, Mar 17 2010 3:01 pm
From: Richard Delorme


Le 17/03/2010 19:15, Willem a écrit :
> Keith Thompson wrote:
> ) Currently, I can have a file "square.c" that defines a number
> ) of functions, and another file "square.h" that provides visible
> ) declarations for *some* of them. Given your #interface proposal,
> ) how do I specify that some functions in "square.c" are intended to
> ) be used by client code, and some are internal?
>
> Err... You could use the 'static' keyword ?
>
> ) Is #interface supposed to replace #include? If so, what about
> ) declarations for things other than functions (constants, typedefs,
> ) etc.)?
>
> It could pick up all constants, typedefs, variables and macros that
> are not declared 'static' ?

Yes, this is exactly my opinion.

--
Richard
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 2 of 13 ==
Date: Wed, Mar 17 2010 3:02 pm
From: Richard Delorme


Le 16/03/2010 08:15, jacob navia a écrit :
> James Kuyper a écrit :
>> Richard Delorme wrote:
>>> Le 05/03/2010 18:56, Casey Hawthorne a �crit :
>>>> Peter Van Der Linden in "Expert C Programming - Deep C Secrets" 1994
>>>> and I imagine others have pointed out some of C's idiosyncrasies.
>>>> Has thought been given given to a cleaned up C? Possibly called C+.
>>>
>>> While reading this thread, it looks that some people want to make
>>> additions to the language, like Jacob Navia's operator overloading &
>>> generic containers. To make the language simpler, or cleaner, why not
>>> rather remove things from it. For example :
>
> Contrary to what Mr Delorme writes, I have (in this forum and in
> comp.std.c) argued extensively AGAINST some "features" of the C library,
> specifically gets() and asctime().

I am sorry if I let you understand that. I just see a big debate in this
thread about adding operator overloading and generic containers to the
standard, and I thought they were your ideas. I am sorry if I put you
behind such proposals despite your true will.

--
Richard
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 3 of 13 ==
Date: Wed, Mar 17 2010 3:02 pm
From: Dag-Erling Smørgrav


Richard Delorme <abulmo@nospam.fr> writes:
> The problem is for the compiler to know the type of a function without
> asking the programmer to explicitly write a function declaration. If
> the function is defined in the same compilation unit I guess there is
> no much problem. When using several compilation units, we need to tell
> the compiler on how to find the information by itself. We can imagine
> several ways to achieve this:
> - In the source file, use a new instruction that indicates where to
> find the function type. For example:
>
> #interface "square.c"
>
> int main()
> {
> /*... code using the function square... */
> }
>
> So #interface will open the square.c file and decipher the function
> type from its definition.

What if square.c is not available?

DES
--
Dag-Erling Smørgrav - des@des.no
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 4 of 13 ==
Date: Wed, Mar 17 2010 3:03 pm
From: Keith Thompson


Willem <willem@turtle.stack.nl> writes:
> Keith Thompson wrote:
> ) Currently, I can have a file "square.c" that defines a number
> ) of functions, and another file "square.h" that provides visible
> ) declarations for *some* of them. Given your #interface proposal,
> ) how do I specify that some functions in "square.c" are intended to
> ) be used by client code, and some are internal?
>
> Err... You could use the 'static' keyword ?

Ok. What if I want to define two different interfaces for the same
*.c file. Say one that makes a certain set of functions visible for
general use, and another that makes a larger set of functions visible
for semi-internal use. That's easy to do with header files.

> ) Is #interface supposed to replace #include? If so, what about
> ) declarations for things other than functions (constants, typedefs,
> ) etc.)?
>
> It could pick up all constants, typedefs, variables and macros that
> are not declared 'static' ?

"static" doesn't apply to typedefs or macros.

The basic issue here is whether interface and implementation should
be physically separated. Eiffel, IIRC, doesn't do this; a single
source file defines a package/module/whatever, and the compiler
extracts the portions of it that are intended to be visible. (I think
there's a separate tool that produces a human-readable interface
specification.) Ada, on the other hand, forces you to physically
separate the interface from the implementation, and gives you a
compile-time error if they don't match.

There are legitimate arguments in favor of both approaches.
I personally prefer the physical separation. C as it's currently
designed doesn't really enforce either approach, but the traditional
use of .h and .c files encourages separation. Richard Delorme seems
to be advocating the other approach. There's nothing necessarily
wrong with that, but it's a radical change to the language with,
IMHO, not enough benefit to justify it.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 5 of 13 ==
Date: Wed, Mar 17 2010 3:04 pm
From: Nick <3-nospam@temporary-address.org.uk>


Willem <willem@turtle.stack.nl> writes:

> Keith Thompson wrote:
> ) Currently, I can have a file "square.c" that defines a number
> ) of functions, and another file "square.h" that provides visible
> ) declarations for *some* of them. Given your #interface proposal,
> ) how do I specify that some functions in "square.c" are intended to
> ) be used by client code, and some are internal?
>
> Err... You could use the 'static' keyword ?

How about labelling the functions you want exported "extern"al? Just to
give that otherwise pointless marking some purpose. Then ones marked
neither "static" nor "extern" could be - well we'll think of something.
We've overloaded "static" so much, it's time we redressed the balance
slightly.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 6 of 13 ==
Date: Wed, Mar 17 2010 3:06 pm
From: Jens Schmidt


Dag-Erling Smørgrav wrote:

> Andrew Poelstra <apoelstra@localhost.localdomain> writes:
>> Dag-Erling Smørgrav <des@des.no> wrote:
>> > Andrew Poelstra <apoelstra@localhost.localdomain> writes:
>> > > IRRC C99 required changes to linkers,
>> > Details? Apart from increasing the length of the significant portion
>> > of identifiers, that is.
>> That was it. It also added case-sensitivity, I think.
>
> Were there still linkers at that point which did not already meet those
> requirements?

Yes. The VMS was ignoring case until then. Around that time it got an
option to preserve case. The maximum significant name length was
unchanged at 31.
--
Viele Grüße,
Jens Schmidt
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 7 of 13 ==
Date: Wed, Mar 17 2010 3:09 pm
From: Ian Collins


On 03/18/10 11:01 AM, Richard Delorme wrote:
> Le 17/03/2010 18:44, Keith Thompson a écrit :
>> Richard Delorme<abulmo@nospam.fr> writes:
>
>> All this to avoid having to write a function declaration? I thought
>> you were trying to simplify things.
>
> From the programmer point of view this is a simplification. What I
> would appreciate, is to transfer some complexity from the programmer to
> the compiler.

By adding a set of unnecessarily complex set of lookup rules?

> This is exactly the opposite of what restrict is doing in
> current implementations.

How so? There's no way for a compiler to know what is going to be
passed to a function.

--
Ian Collins
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 8 of 13 ==
Date: Wed, Mar 17 2010 4:15 pm
From: Richard Delorme


Le 17/03/2010 23:03, Keith Thompson a écrit :
> Willem<willem@turtle.stack.nl> writes:
>> Keith Thompson wrote:
>> ) Currently, I can have a file "square.c" that defines a number
>> ) of functions, and another file "square.h" that provides visible
>> ) declarations for *some* of them. Given your #interface proposal,
>> ) how do I specify that some functions in "square.c" are intended to
>> ) be used by client code, and some are internal?
>>
>> Err... You could use the 'static' keyword ?
>
> Ok. What if I want to define two different interfaces for the same
> *.c file. Say one that makes a certain set of functions visible for
> general use, and another that makes a larger set of functions visible
> for semi-internal use. That's easy to do with header files.

I wonder if this is not a confusion between documentation and header
files. For your example, just provide two documentations, one for
internal usage and another one for general usage.

> The basic issue here is whether interface and implementation should
> be physically separated. Eiffel, IIRC, doesn't do this; a single
> source file defines a package/module/whatever, and the compiler
> extracts the portions of it that are intended to be visible. (I think
> there's a separate tool that produces a human-readable interface
> specification.) Ada, on the other hand, forces you to physically
> separate the interface from the implementation, and gives you a
> compile-time error if they don't match.
>
> There are legitimate arguments in favor of both approaches.
> I personally prefer the physical separation. C as it's currently
> designed doesn't really enforce either approach, but the traditional
> use of .h and .c files encourages separation. Richard Delorme seems
> to be advocating the other approach. There's nothing necessarily
> wrong with that, but it's a radical change to the language with,
> IMHO, not enough benefit to justify it.

I do not know for the general cases, but in a few projects of mine,
header files (excluding standard ones) contain between 5% to 10% of
lines of codes. So removing them is a productivity enhancement of about
5 to 10%. I think it's not a negligible benefit.

--
Richard
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 9 of 13 ==
Date: Wed, Mar 17 2010 4:16 pm
From: Richard Delorme


Le 17/03/2010 23:09, Ian Collins a écrit :
> On 03/18/10 11:01 AM, Richard Delorme wrote:
>> Le 17/03/2010 18:44, Keith Thompson a écrit :
>>> Richard Delorme<abulmo@nospam.fr> writes:
>>
>>> All this to avoid having to write a function declaration? I thought
>>> you were trying to simplify things.
>>
>> From the programmer point of view this is a simplification. What I
>> would appreciate, is to transfer some complexity from the programmer to
>> the compiler.
>
> By adding a set of unnecessarily complex set of lookup rules?

The programmer won't care much of this set of lookup rules.

>> This is exactly the opposite of what restrict is doing in
>> current implementations.
>
> How so? There's no way for a compiler to know what is going to be passed
> to a function.

Yes there is, using alias analysis.

--
Richard
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 10 of 13 ==
Date: Wed, Mar 17 2010 4:17 pm
From: Richard Delorme


Le 17/03/2010 23:02, Dag-Erling Smørgrav a écrit :
> Richard Delorme<abulmo@nospam.fr> writes:
>> The problem is for the compiler to know the type of a function without
>> asking the programmer to explicitly write a function declaration. If
>> the function is defined in the same compilation unit I guess there is
>> no much problem. When using several compilation units, we need to tell
>> the compiler on how to find the information by itself. We can imagine
>> several ways to achieve this:
>> - In the source file, use a new instruction that indicates where to
>> find the function type. For example:
>>
>> #interface "square.c"
>>
>> int main()
>> {
>> /*... code using the function square... */
>> }
>>
>> So #interface will open the square.c file and decipher the function
>> type from its definition.
>
> What if square.c is not available?

#interface "square"

The instruction meaning the compiler is going to look for the interface
in the file libsquare.a or square.dll or whatever depending on the
implementation.

--
Richard
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 11 of 13 ==
Date: Wed, Mar 17 2010 4:18 pm
From: pacman@kosh.dhis.org (Alan Curry)


In article <clcm-20100317-0010@plethora.net>,
Richard Delorme <abulmo@nospam.fr> wrote:
|Le 16/03/2010 20:10, Keith Thompson a écrit :
| - In the source file, use a new instruction that indicates where to
|find the function type. For example:
|
|#interface "square.c"
|
|int main()
|{
| /*... code using the function square... */
|}
|
|So #interface will open the square.c file and decipher the function type
|from its definition.

So I have to keep a permanent local copy of the full source code of every
library I want to compile against? Currently I only need the header files and
compiled lib*.(a|so) and as someone who doesn't buy a new hard drive every 6
months, I like it that way.

There are even some libraries that are deliberately distributed without
source code, so the users only have the header files and object code to work
with. Those people won't like your idea either.

--
Alan Curry
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 12 of 13 ==
Date: Wed, Mar 17 2010 4:37 pm
From: Seebs


On 2010-03-17, Richard Delorme <abulmo@nospam.fr> wrote:
> Le 17/03/2010 23:09, Ian Collins a écrit :
>> By adding a set of unnecessarily complex set of lookup rules?

> The programmer won't care much of this set of lookup rules.

I'm not at all convinced. This sounds like a nightmare to me -- I'd
never know where things were coming from or which things were liable to
come from somewhere.

That said!

I would be 100% in favor of a change to require 2-pass compilation, that
is to say, requiring only that a function be declared or defined SOMEWHERE
in a translation unit, rather than "before it is used". I think that would
make C a lot more consistent, and I really don't feel that the cost to
compiler vendors is all that bad.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


== 13 of 13 ==
Date: Wed, Mar 17 2010 4:54 pm
From: Keith Thompson


Richard Delorme <abulmo@nospam.fr> writes:
> Le 17/03/2010 23:03, Keith Thompson a écrit :
>> Willem<willem@turtle.stack.nl> writes:
>>> Keith Thompson wrote:
>>> ) Currently, I can have a file "square.c" that defines a number
>>> ) of functions, and another file "square.h" that provides visible
>>> ) declarations for *some* of them. Given your #interface proposal,
>>> ) how do I specify that some functions in "square.c" are intended to
>>> ) be used by client code, and some are internal?
>>>
>>> Err... You could use the 'static' keyword ?
>>
>> Ok. What if I want to define two different interfaces for the same
>> *.c file. Say one that makes a certain set of functions visible for
>> general use, and another that makes a larger set of functions visible
>> for semi-internal use. That's easy to do with header files.
>
> I wonder if this is not a confusion between documentation and header
> files. For your example, just provide two documentations, one for
> internal usage and another one for general usage.

I don't think so. If I try to call an internal function, I want the
compilation to fail.

[...]
> I do not know for the general cases, but in a few projects of mine,
> header files (excluding standard ones) contain between 5% to 10% of
> lines of codes. So removing them is a productivity enhancement of
> about 5 to 10%. I think it's not a negligible benefit.

That assumes that productivity depends merely on the number of
lines of code. I don't think that's a valid assumption.

I suppose you could write a tool that automatically generates a
.h file from a given .c file. You could then edit it to remove
anything you don't want visible to clients. (Maybe IDEs already
do this kind of thing?)

Incidentally, I don't see much point in cross-posting to
comp.lang.c.moderated and comp.lang.c. I'm cross-posting this
response, but directing followups just to clcm.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.

==============================================================================
TOPIC: Letter sent to Apress with concerns about Peter Seebach's online
behavior
http://groups.google.com/group/comp.lang.c/t/482b38643777da3c?hl=en
==============================================================================

== 1 of 11 ==
Date: Wed, Mar 17 2010 3:01 pm
From: Seebs


On 2010-03-17, Lubow <dynamitemike@hotmail.com> wrote:
> On Mar 16, 2:56 pm, Chad <cdal...@gmail.com> wrote:
>> The person that wrote the early *nix versions of Netscape, XEmacs,
>> XScreensavers, and Mozilla only had a high school diploma. His "email
>> algorithm" is used in alot of the modern email clients.  In an old
>> interview, he told the person interviewing him that he almost
>> considered dropping out of high school in the 11th grade because
>> school just wasn't working out for him.

> Did that guy also murder his wife?

Uh, no, that was (probably) Hans Reiser, not jwz.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!


== 2 of 11 ==
Date: Wed, Mar 17 2010 3:26 pm
From: Chad


On Mar 17, 3:01 pm, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-03-17, Lubow <dynamitem...@hotmail.com> wrote:
>
> > On Mar 16, 2:56 pm, Chad <cdal...@gmail.com> wrote:
> >> The person that wrote the early *nix versions of Netscape, XEmacs,
> >> XScreensavers, and Mozilla only had a high school diploma. His "email
> >> algorithm" is used in alot of the modern email clients.  In an old
> >> interview, he told the person interviewing him that he almost
> >> considered dropping out of high school in the 11th grade because
> >> school just wasn't working out for him.
> > Did that guy also murder his wife?
>
> Uh, no, that was (probably) Hans Reiser, not jwz.
>

Yeah. There is a former FreeBSD Engineer, who is know a Senior
Executive at Apple, who never actually graduated High School.


== 3 of 11 ==
Date: Wed, Mar 17 2010 3:28 pm
From: Chad


On Mar 17, 3:26 pm, Chad <cdal...@gmail.com> wrote:
> On Mar 17, 3:01 pm, Seebs <usenet-nos...@seebs.net> wrote:
>
> > On 2010-03-17, Lubow <dynamitem...@hotmail.com> wrote:
>
> > > On Mar 16, 2:56 pm, Chad <cdal...@gmail.com> wrote:
> > >> The person that wrote the early *nix versions of Netscape, XEmacs,
> > >> XScreensavers, and Mozilla only had a high school diploma. His "email
> > >> algorithm" is used in alot of the modern email clients.  In an old
> > >> interview, he told the person interviewing him that he almost
> > >> considered dropping out of high school in the 11th grade because
> > >> school just wasn't working out for him.
> > > Did that guy also murder his wife?
>
> > Uh, no, that was (probably) Hans Reiser, not jwz.
>
> Yeah. There is a former FreeBSD Engineer, who is know a Senior
> Executive at Apple, who never actually graduated High School.

er *who is now* (not *who is know*)


== 4 of 11 ==
Date: Wed, Mar 17 2010 3:34 pm
From: Seebs


On 2010-03-17, Chad <cdalten@gmail.com> wrote:
> Yeah. There is a former FreeBSD Engineer, who is know a Senior
> Executive at Apple, who never actually graduated High School.

It's surprisingly common. I usually save the Big Reveal that I never
finished high school (or got a GED, or anything comparable) until I have
someone like Nilges to play with, but given how much mileage he got
out of merely knowing I hadn't taken CS courses, I was sorta worried that
it would cause him to explode in outrage.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!


== 5 of 11 ==
Date: Wed, Mar 17 2010 5:40 pm
From: jamm


Kenny McCormack wrote:

> In article
> <17152fb7-aaf9-4da7-8483-3b91edde830c@g26g2000yqn.googlegroups.com>,
> Lubow <dynamitemike@hotmail.com> wrote:
>>On Mar 16, 2:56�pm, Chad <cdal...@gmail.com> wrote:
>>
>>>
>>> The person that wrote the early *nix versions of Netscape, XEmacs,
>>> XScreensavers, and Mozilla only had a high school diploma. His "email
>>> algorithm" is used in alot of the modern email clients. �In an old
>>> interview, he told the person interviewing him that he almost
>>> considered dropping out of high school in the 11th grade because
>>> school just wasn't working out for him.
>
> The point that we are trying to make here is that those days are gone.
> Programming has become, as spinoza puts it, overly-socialized. The
> maverick days are over.
>
> The denizens of this NG want to go on pretending that this isn't so.
>

Perhaps you meant to say, fully-institutionalized? I don't know.. it feels
that way in job interviews these days. Yet there is so much room for
innovation and innovaters even still. Look at Napster, Facebook, Twitter
etc.. pretty successful mavericks.

Thats why I find robotics to be very exciting at this point in time.. it is
so far NOT institutionalized despite efforts to make it so. Noone yet knows
how to really make a working speech recognition system, or usable real world
computer vision, or real AI. Its wide open!

== 6 of 11 ==
Date: Wed, Mar 17 2010 7:33 pm
From: spinoza1111


On Mar 18, 6:34 am, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-03-17, Chad <cdal...@gmail.com> wrote:
>
> > Yeah. There is a former FreeBSD Engineer, who is know a Senior
> > Executive at Apple, who never actually graduated High School.
>
> It's surprisingly common.  I usually save the Big Reveal that I never
> finished high school (or got a GED, or anything comparable) until I have
> someone like Nilges to play with, but given how much mileage he got
> out of merely knowing I hadn't taken CS courses, I was sorta worried that
> it would cause him to explode in outrage.

Actually, I was aware of that fact. I don't think it's cute that you
failed to graduate from high school.

You have a very troubling educational record. Had you accomplished
anything in programming, this would not be important. But you really,
really haven't. You are on record as giving up when things get
painful, sometimes with personal abuse directed at others. You don't
seem to have ever written anything useful: by your age, I'd developed
the first versions of an innovative hydrostatic stability program that
created a market for a company, and several other useful packages.

For example, it appears that you found DOS programming "too painful".
But this means you had no standing in criticising the work of someone
who, for market reasons, was required to write a DOS centric book.

But this bragging about educational FAILURE is the most troubling fact
about your background. I had excellent African American programming
students who had to graduate from high school or go to jail, because
unlike in your case, they didn't have an academic Mommy and Daddy to
coddle them.

But what's most troubling is your apparent record of educational
failure.
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

== 7 of 11 ==
Date: Wed, Mar 17 2010 7:35 pm
From: spinoza1111


On Mar 18, 6:26 am, Chad <cdal...@gmail.com> wrote:
> On Mar 17, 3:01 pm, Seebs <usenet-nos...@seebs.net> wrote:
>
> > On 2010-03-17, Lubow <dynamitem...@hotmail.com> wrote:
>
> > > On Mar 16, 2:56 pm, Chad <cdal...@gmail.com> wrote:
> > >> The person that wrote the early *nix versions of Netscape, XEmacs,
> > >> XScreensavers, and Mozilla only had a high school diploma. His "email
> > >> algorithm" is used in alot of the modern email clients.  In an old
> > >> interview, he told the person interviewing him that he almost
> > >> considered dropping out of high school in the 11th grade because
> > >> school just wasn't working out for him.
> > > Did that guy also murder his wife?
>
> > Uh, no, that was (probably) Hans Reiser, not jwz.
>
> Yeah. There is a former FreeBSD Engineer, who is know a Senior
> Executive at Apple, who never actually graduated High School.

These stories are exagerrated. Many of these individuals taught
themselves coding in the 1980s and produced the inferior first
versions of packages good enough to create a market. They were then
kicked upstairs. Now, they exploit and abuse, in an anti-intellectual
fashion, the MSen and PHDen under them.


== 8 of 11 ==
Date: Wed, Mar 17 2010 7:41 pm
From: ImpalerCore


On Mar 17, 6:34 pm, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-03-17, Chad <cdal...@gmail.com> wrote:
>
> > Yeah. There is a former FreeBSD Engineer, who is know a Senior
> > Executive at Apple, who never actually graduated High School.
>
> It's surprisingly common.  I usually save the Big Reveal that I never
> finished high school (or got a GED, or anything comparable) until I have
> someone like Nilges to play with, but given how much mileage he got
> out of merely knowing I hadn't taken CS courses, I was sorta worried that
> it would cause him to explode in outrage.

While you may not have finished high school or college, I'm sure you
put at least as much effort into learning programming as people who
did go to college, probably more. Some people work best when they are
self-directed because their interest drives a good work ethic. Then
there are those that won't do anything unless someone tells them they
need to do it. College is usually good for those kinds of people, but
it's certainly not a requirement to follow a career in programming.
Then there are those who won't do anything no matter who tells them to
do it.

Were you pretty much self-taught, or did you have a mentor of some
kind? As a college guy myself, I'm curious about people who found
their way as a programmer through paths less traveled.

> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

== 9 of 11 ==
Date: Wed, Mar 17 2010 8:40 pm
From: Walter Banks


spinoza1111 wrote:

> But what's most troubling is your apparent record of educational
> failure.

Didn't you say that you too dropped out of University.


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---


== 10 of 11 ==
Date: Wed, Mar 17 2010 7:47 pm
From: spinoza1111


On Mar 18, 4:24 am, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <17152fb7-aaf9-4da7-8483-3b91edde8...@g26g2000yqn.googlegroups.com>,
>
> Lubow  <dynamitem...@hotmail.com> wrote:
> >On Mar 16, 2:56 pm, Chad <cdal...@gmail.com> wrote:
>
> >> The person that wrote the early *nix versions of Netscape, XEmacs,
> >> XScreensavers, and Mozilla only had a high school diploma. His "email
> >> algorithm" is used in alot of the modern email clients.  In an old
> >> interview, he told the person interviewing him that he almost
> >> considered dropping out of high school in the 11th grade because
> >> school just wasn't working out for him.
>
> The point that we are trying to make here is that those days are gone.
> Programming has become, as spinoza puts it, overly-socialized.  The
> maverick days are over.

That's correct: and, in the "maverick" days, we early programmers (I
started in 1973) had in many cases been educated in strict,
traditional Catholic schools (in my case), equally strict and
traditional Communist schools (in the case of Szymonyi and others),
and public schools before California's prop. 13, a neutron bomb which
destroyed teachers in California and created today's hatred and
contempt for teachers.

We didn't jump into coding in an adolescent fashion. Instead, we were
able to write complete sentences such as "this program will match the
x and y files, removing duplicates from y; and for each pair of
matching records, this program will update the x record with
information from the y file".

It is often said the old bastards "always" do this, but there's a
strong possibility here that owing to the desire of the rich for world
domination based on wealth alone, younger people have indeed devolved
into Troglodytes by design.

Old programmers were disruptive. Companies had to hire us despite our
long hair because we could write complete, end to end solutions while
the Nixon voters from business schools were playing with their
dinguses. But Peter S and Richard Heathfield give no sign of being
actually able to develop code. Seebach is a script kiddie, and while
Heathfield seems to have been a PART of big projects, more a manager
than a coder, his linked list proves that his programming background
is light in weight.
>
> The denizens of this NG want to go on pretending that this isn't so.
>
> --
> (This discussion group is about C, ...)
>
> Wrong.  It is only OCCASIONALLY a discussion group
> about C; mostly, like most "discussion" groups, it is
> off-topic Rorsharch revelations of the childhood
> traumas of the participants...

== 11 of 11 ==
Date: Wed, Mar 17 2010 7:55 pm
From: spinoza1111


On Mar 18, 11:40 am, Walter Banks <wal...@bytecraft.com> wrote:
> spinoza1111wrote:
> > But what's most troubling is your apparent record of educational
> > failure.
>
> Didn't you say that you too dropped out of University.

I completed a BA and most of the work towards MSCS, but left the
latter program after completing most of the work with an A average. I
had family responsibilities.

I have said:

* It was not only possible, in the early days, to not take computer
science, it was necessary. There was no CS. I took the first ever CS
class offered at my undergrad university

* There have been many programmers with partial or no prep in
academic cs. But those programmers have produced interesting and
important code, and generally would be loth to attack someone with
Schildt's academic qualifications from a basic sense of standing and
decency.

The question is Seebach's strange attitude towards education. The
minorities I taught at DeVry had a respect for educations they
couldn't afford whereas Seebach seems, despite the fact that his
father seems to be a professor, to have a Fascistic anti-
intellectualism.

A Humble Programmer doesn't believe that academic preparation is
useless or pernicious, but there is an urban legend to this effect
which has destroyed good people, and far less important, projects.

Had Seebach been completely autodidact, this would have been OK. But
in his case, his lack of academic preparation is accompanied by a deep
level of ignorance and a George Bush-reminiscent level of incuriosity,
whence his claim that Herb couldn't speak of stacks and that the heap
is a DOS term.
>
> --- news://freenews.netfront.net/ - complaints: n...@netfront.net ---


==============================================================================
TOPIC: Does GCC optimize variadic functions to death?
http://groups.google.com/group/comp.lang.c/t/00b2bccdde28fde4?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Mar 17 2010 3:44 pm
From: Stephen Sprunk


On 16 Mar 2010 15:21, Elmar wrote:
> I just switched to GCC 4.4 (gcc44 (GCC) 4.4.0 20090514 (Red Hat
> 4.4.0-6)) and noted that quite a lot of my functions with variable
> arguments are not compiled correctly anymore at -O2 (things are OK at
> -O).

Incidentally, your code worked fine for me at -O2 but broke at -O3. Not
that the particular level matters, but apparently whatever optimization
is breaking your code moved from -O3 in GCC 4.2 to -O2 in GCC 4.4, which
might help you track down which one it is if you're curious...

> The problem is that in real life, lst_print from my minimum example is
> a much larger function, which I don't want to write twice, once as
> shown originally (other functions need to call it with a list, not
> with variable arguments), and once as typed out by you (would be a
> nasty code duplication).

Obviously, one should never duplicate massive amounts of code without a
very good reason, and this doesn't appear to be one of those cases.

> So the only correct alternative would be to turn val_print into a
> wrapper for lst_print, and use va_start and va_arg to create a list
> that is then passed to lst_print. This would require malloc/free etc.
> to create an exact copy of what is already beautifully laid out on the
> stack. My application is very performance critical, so creating
> intermediate exact copies is something I usually try to avoid.

You shouldn't need malloc/free for this at all; if so, you're probably
doing something wrong.

Here is a minimally modified version of your program, which compiles and
works just fine for me at all optimization levels and is, AFAICT,
completely portable:

#include <stdio.h>
#include <stdarg.h>

void lst_print(int count, va_list list) {
int i;

for (i=0; i<count; i++)
printf("Value %d: %d\n", i, va_arg(list, int));
}

void val_print(int count, ...) {
va_list list;

va_start(list, count);
lst_print(count, list);
va_end(list);
}

int main(int argc, char *argv[]) {
val_print(5, 10, 20, 30, 40, 50);
return 0;
}

This, as you noted, turns val_print() into a "wrapper" of sorts but
doesn't require additional memory allocation, copying data, etc. and
should perform at least as well as your code. The magic is in the
(va_list) parameter that is passed from val_print() to lst_print().

If you need other functions to be able to call lst_print() with a
variable argument list, just like val_print(), the trick is to create a
third function (by convention, with the same name as the simplest
wrapper with a "v" prefix or suffix) with the meat of the logic:

void lst_printv(int count, va_list list) {
int i;

for (i=0; i<count; i++)
printf("Value %d: %d\n", i, va_arg(list, int));
}

void lst_print(int count, ...) {
va_list list;

va_start(list, count);
lst_printv(count, list);
va_end(list);
}

void val_print(int count, ...) {
va_list list;

va_start(list, count);
/* do something complicated */
lst_printv(count, list);
va_end(list);
}


If neither of these solutions is workable in your specific scenario,
you'll need to provide more detail so that we can understand why not and
make better suggestions.

> Portability is not my concern, since my application has >100000 lines
> of assembler code and is tied to x86.
>
> That's why I hoped there would be a simple trick to tweak the GCC
> optimizer...

Unfortunately for you, when you change the optimization levels, you are
effectively getting a completely new C implementation which naturally
behaves differently--and all the "portability" problems that entails.

> A few months from now, I'll be in trouble anyway, when it's time to
> port to x86_64. There, va_start and va_arg are a true nightmare (the
> assembler code is blown up and slowed down by a factor 2-3 since
> variable arguments can end up in registers). So in case anyone has a
> brilliant idea how to make my original example work on x86_64, you'll
> be my hero!

If you make your code portable today, it'll work on x64 systems as well
without change. However, IIRC in x64 functions with variable argument
lists go on the stack just like in x86, and only functions with fixed
argument lists get the (faster) register-based calling convention.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate