From: Walter Bright on
James Kanze wrote:
> As for a million words... I'd say that any language had that
> many, if you count all of the technical words (e.g. names of
> diseases, scientific names of plants and animals, ...).

I was counting them, and no other language has made such an accumulation
of them.

> On the
> other hand, I know of no English author who uses anywhere near
> that many. (I read somewhere that Aldous Huxley used something
> like 50000 words in his works, and that that was something of a
> record.)

A typical high school grad has a vocabulary of 10,000 words. College
grad, 30,000 words. Newspaper, about 2,000 words.

> In fact, there's no way you can compare the number of
> words in two different languages.

Sure you can. I didn't make up the figures. See Mario Puzo's books.

> Is it somehow significant
> that English has two words, watch and clock,

You forgot timepiece and chronometer.

> It's a language like any other.

No, it is not like any other. Languages are not interchangeable, as
people who attempt translations know. Languages are a reflection of the
culture they came from, and in turn influence that culture. Chicken or egg.

> And the reason it is so widely used
> has more to do with political, demographical and economical
> considerations than any intrinsic quality of the language.

Language can be the cause of those things. Words have power, and people
think in terms of their language. I know I think in english.

> Similarly, although there are far more significant differences
> between programming languages, the reason C++ is widespread has
> more to do with political and economical considerations than
> with any intrinsic qualities of the language.

I don't buy that at all. To say that is to say that attempts to improve
C++ are meaningless and irrelevant.

Like spoken languages influence culture, to an even greater extent
programming languages influence how we *think* about programming.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Walter Bright on
Peter Dimov wrote:
> In theory, they ought to fail. In practice, most of them work just
> fine. That's the beauty of UTF-8. In-place character manipulation
> doesn't work in general anyway, even for an ordinary single-byte
> encoding.

Having them 'mostly' work isn't good enough. Searching doesn't work, for
example.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Walter Bright on
kwikius wrote:
> A 2D 3D point or vector would be much more useful to me than complex
> numbers and of course I would want both vectors and complex numbers to
> work with my types, which I will bet the D version wont do.

Why would you assume it won't? Do int's not work with your types?

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Bob Bell on
Walter Bright wrote:
> Bob Bell wrote:
> > Walter Bright wrote:
> >> And why do users often write their apps in Python, and use C++ just for
> >> the bottlenecks?
> > Because they don't know what they're doing? ;-)
>
> LOL! But it doesn't pay to assume everyone who disagrees with one is an
> idiot.

Sorry, I didn't mean to imply that. I hoped the smiley would make it
obvious I had my toungue firmly in cheek. I was wrong.

> > Seriously, don't assume that this works just because developers feel
> > good when they do it. I know of a major project at my previous company
> > that was written that way, and it turned out to be a disaster. The
> > developers loved working on it, though -- the fact that they could make
> > a small correction and see it running in seconds gave them a great
> > feeling of power and control. They all felt extremely productive, that
> > Python made the project go very smoothly. The failed to notice several
> > factors:
>
> Google apparently uses Python in the manner I suggest. I don't think
> Google is populated by people who are so in love with their own code
> they forget all about the customer.

I wasn't saying that all projects that mix C++ and Python are doomed, I
was saying that mixing C++ and Python is no guarantee of success. I'm
aware of exactly one project that was written that way, where the
developers all thought it worked out great, but to an observer (me) it
was clear that it wasn't as smooth as the team thought.

Consider this opinion worth the price you paid for it. ;-)

Bob


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Walter Bright on
James Kanze wrote:
> Walter Bright wrote:
>> The C++98 Standard defines many operations on complex as taking an
>> argument of type complex&. That means taking a pointer to it, which puts
>> the kibosh on enregistering complex.
>
> In a naive implementation.

That would include 100% of current implementations.

> The C++98 Standard never forbids making the functions of complex
> inline, in which case, a compiler should be able to eliminate
> not only the call, but also taking the address, and so should be
> able to keep all of the values in registers.

Inlining a function doesn't necessarily imply replacing a reference type
with a value type.

The problem is, a compiler looks at a UDT from the lowest level
possible. It has *no idea* what that type is supposed to be; not a clue.
All it sees are the low level operations on it. Trying to infer
identities and high level operations from that is akin to handing an AI
engine a few identities and expecting it to construct all kinds of
useful theorems from them. It ain't gonna happen.

When the compiler sees a pointer to a type taken, that instance of that
type is banned from going into a register. If the pointers being taken
are part of the basic functionality of the type, such as construction,
assignment, or copy construction, that pretty much kills putting it into
a register.

Now, if you want to make the compiler aware of std::complex as being
complex numbers, which the Standard allows, then it is NO LONGER a UDT.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]