In article <005801c07fad$15aec960$2e03280a@puma>, "Christian"
<christians / syd.microforte.com.au> wrote:

> 
>> Larry> Ada 95 generics are a far cleaner solution than C++ templates.
> 
> That's as maybe. I don't use Ada95, and to my embaressment I only have
> a passing familiarity with Ada95 and its generics. But I do know that
> Mr Stepanov chose to move from Ada95 to C++ to implement his STL. Why?

Actually, he didn't. From an interview in DDJ in March, 1995
(http://www.sgi.com/Technology/STL/drdobbs-interview.html):

"In 1988 I moved to HP Labs where I was hired to work on generic
libraries. For several years, instead of doing that I worked on disk
drives, which was exciting but was totally orthogonal to this area of
research. I returned to generic library development in 1992 when Bill
Worley, who was my lab director established an algorithms project with
me being its manager. C++ had templates by then. I discovered that
Bjarne had done a marvelous job at designing templates. I had
participated in several discussions early on at Bell Labs about
designing templates and argued rather violently with Bjarne that he
should make C++ templates as close to Ada generics as possible. I think
that I argued so violently that he decided against that. I realized the
importance of having template functions in C++ and not just template
classes, as some people believed. I thought, however, that template
functions should work like Ada generics, that is, that they should be
explicitly instantiated. Bjarne did not listen to me and he designed a
template function mechanism where templates are instantiated implicitly
using an overloading mechanism. This particular technique became crucial
for my work because I discovered that it allowed me to do many things
that were not possible in Ada. I view this particular design by Bjarne
as a marvelous piece of work and I'm very happy that he didn't follow my
advice."

Of course, the Ada being referred to here is Ada83. The differences
between Ada83 and Ada95 aren't as great as between C and C++, but Ada95
is a considerably nicer language. Even with a standard and the STL,
writing portable C++ seems to be somewhat problematic, as this page 
relates: http://www.mozilla.org/hacking/portable-cpp.html

> I am not sure, and since you dont give any reasons here or later on
> exactly why Ada95 is better than C++ I can only take your word for it.
> In any case, I'm sure no-one here is interested in a fight over
> languages per se.

True, but do have a look at
http://www.adaic.com/docs/flyers/95cplus.shtml

>> > How much do you read code compared to how much that code is
>> > executed? Carts and horses.
>>
>> Most code is read many more times than it is written.
> 
> I understand that. That's why I compared reading to *execution*, not
> to writing. Most code (at least, most good code) is executed more than
> it is either read /or/ written. The rubber has to hit the road at some
> point. What I meant by the carts and horses reference is that it is a
> trap to worry too much about either syntax or semantics: what we do is
> write software, and the practical use of that software is really all
> that matters.

If it's execution which truly matters, then wouldn't a modern OO
assembler be the way to go? :)  Seriously, though, maintenance is an
important part of much software engineering. 

> [snip Ada95 flag waving]
> 
>> > Meta-programming? C++. This is far more important than anything
>> > else.
>>
>> Never used Lisp, huh?
> 
> Ahh Larry you seem intent on attempting to belittle me.

Sorry, I'd been up a long time and was grumpy. The C++ flag-waving was
too much to resist. Sorry about that.

> I am familiar
> with Lisp. Who can get a degree (or two) and not be? No, I don't use
> it professionally. I don't use ML professionally either, but that
> doesn't mean I have no understanding of FP. FP rocks, we all know
> that. It is also very intellectual, and above most people. But that
> doesn't mean that we should throw away the notion of functions as
> first-class-objects.

Huh?

> Now, what about continuations as first-class-objects?

As in Scheme?

> Or a 'stackless' Ruby (http://www.tismer.com/research/stackless/)?

That might be interesting. I think of C mostly as a very high-level
portable assembler, but unfortunately it also forces a number of
assumptions about the environment that are difficult to escape. There's
a project somewhere to design a true VHL portable assembler without the
drawbacks of C, but I've lost the link and can't remember it.

One thing I particularly like about Ada95 over C++ is the way exception
handling is done. In Ada it's built-in, the only code you have to write
is the exception handler itself. If a block of code doesn't have an
exception handler for a given exception, it's handed up to the next
higher block of code until a handler is found. The default top-level
handlers will terminate the program and spit out an error message, of
course.  It's very clean from the programmer's point of view. I'm not
sure how that might be implemented in Ruby.

Larry

Larry